<?php
-
/*
+--------------------------------------------------------------------+
| CiviCRM version 4.6 |
* Get CiviCRM domain details
* {@getfields domain_create}
* @example DomainGet.php
+ * @param array $params
+ * @return array
+ * @throws \API_Exception
*/
function civicrm_api3_domain_get($params) {
$domains = _civicrm_api3_dao_to_array($bao, $params, TRUE, 'domain');
foreach ($domains as $domain) {
- if(!empty($domain['contact_id'])){
+ if (!empty($domain['contact_id'])) {
$values = array();
$locparams = array(
- 'contact_id' => $domain['contact_id']
+ 'contact_id' => $domain['contact_id'],
);
$values['location'] = CRM_Core_BAO_Location::getValues($locparams, TRUE);
'geo_code_1', 'geo_code_2',
);
- if ( !empty( $values['location']['email'] ) ) {
+ if (!empty($values['location']['email'])) {
$domain['domain_email'] = CRM_Utils_Array::value('email', $values['location']['email'][1]);
}
- if ( !empty( $values['location']['phone'] ) ) {
+ if (!empty($values['location']['phone'])) {
$domain['domain_phone'] = array(
'phone_type' => CRM_Core_OptionGroup::getLabel(
'phone_type',
'phone' => CRM_Utils_Array::value(
'phone',
$values['location']['phone'][1]
- )
+ ),
);
}
- if ( !empty( $values['location']['address'] ) ) {
+ if (!empty($values['location']['address'])) {
foreach ($address_array as $value) {
$domain['domain_address'][$value] = CRM_Utils_Array::value($value,
$values['location']['address'][1]