$gender = 1; // Male $genderLabel = CRM_Core_PseudoConstant::getLabel('CRM_Contact_BAO_Contact', 'gender_id', $gender); // $genderLabel returns 'Male'
$relationshipType = 2; // Parent of $relationshipTypeLabel = CRM_Core_PseudoConstant::getLabel('CRM_Contact_BAO_Relationship', 'relationship_type_id', $relationshipType); // $relationshipTypeLabel returns 'Parent of'In this example, we retrieve the label associated with the relationship type value '2' (Parent of) in the CRM_Contact_BAO_Relationship pseudo constant set.