function _civicrm_entity_profile_get_profiles in CiviCRM Entity 7.2
Gets the profiles (uf_group) for an entity
Parameters
$entity_type:
$id:
$type:
Return value
array
1 call to _civicrm_entity_profile_get_profiles()
- _civicrm_entity_price_set_field_setup_event_registration_form_fapi in modules/
civicrm_entity_price_set_field/ includes/ civicrm_entity_price_set_field.event_registration.inc - Helper function to setup event registration form FAPI
File
- modules/
civicrm_entity_profile/ includes/ civicrm_entity_profile.profile.inc, line 221 - CiviCRM Entity Profile, Profile Form generation and processing, utility functions
Code
function _civicrm_entity_profile_get_profiles($entity_type, $id, $type) {
$profiles = array();
$uf_join_query = new EntityFieldQuery();
$uf_join_results = $uf_join_query
->entityCondition('entity_type', 'civicrm_uf_join')
->propertyCondition('is_active', 1)
->propertyCondition('module', $type)
->propertyCondition('entity_table', $entity_type)
->propertyCondition('entity_id', $id)
->propertyOrderBy('weight')
->execute();
if (!empty($uf_join_results['civicrm_uf_join'])) {
$uf_joins = entity_load('civicrm_uf_join', array_keys($uf_join_results['civicrm_uf_join']));
foreach ($uf_joins as $id => $uf_join) {
$profiles[] = $uf_join->uf_group_id;
}
}
return $profiles;
}