function crm_core_user_sync_get_contact_type_for_account in CRM Core 7
Same name and namespace in other branches
- 8.2 modules/crm_core_user_sync/crm_core_user_sync.module \crm_core_user_sync_get_contact_type_for_account()
Returns corresponding contact type for user account to synchronize with.
1 call to crm_core_user_sync_get_contact_type_for_account()
- crm_core_user_sync_sync in modules/
crm_core_user_sync/ crm_core_user_sync.module - Synchronizes user amd contact.
File
- modules/
crm_core_user_sync/ crm_core_user_sync.module, line 216
Code
function crm_core_user_sync_get_contact_type_for_account($account) {
$rules = variable_get('crm_core_user_sync_rules', array());
uasort($rules, 'crm_core_user_sync_weight_cmp');
foreach ($rules as $rule) {
if ($rule['enabled'] && in_array($rule['rid'], array_keys($account->roles))) {
return $rule['contact_type'];
}
}
return FALSE;
}