$searchParams = array( 'gender_id' => CRM_Core_PseudoConstant::getKey('CRM_Contact_DAO_Contact', 'gender_id', 'Female'), ); $contacts = civicrm_api3('Contact', 'get', $searchParams);
$form->add('select', 'gender_id', ts('Gender'), CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'gender_id'));This code adds a select drop-down list for gender to a form, with the options retrieved from the gender pseudo constant. Overall, the CRM_Core_PseudoConstant gender class provides a convenient way to manage gender options in a CRM system, allowing for easy retrieval and integration of predefined constants.