*/
public static function getGroupContacts($id) {
$params = [['group', 'IN', [1 => $id], 0, 0]];
- list($contacts, $_) = CRM_Contact_BAO_Query::apiQuery($params, ['contact_id']);
+ [$contacts] = CRM_Contact_BAO_Query::apiQuery($params, ['contact_id']);
return $contacts;
}
['group', 'IN', [$groupID], 0, 0],
['contact_id', '=', $contactID, 0, 0],
];
- list($contacts, $_) = CRM_Contact_BAO_Query::apiQuery($params, ['contact_id']);
+ [$contacts] = CRM_Contact_BAO_Query::apiQuery($params, ['contact_id']);
if (!empty($contacts)) {
return TRUE;
}
$params = [['contact_id', '=', $contactId, 0, 0]];
- list($contact, $_) = CRM_Contact_BAO_Query::apiQuery($params);
+ [$contact] = CRM_Contact_BAO_Query::apiQuery($params);
//CRM-4524
$contact = reset($contact);
if ($params['toEmail']) {
$contactParams = [['email', 'LIKE', $params['toEmail'], 0, 1]];
- list($contact, $_) = CRM_Contact_BAO_Query::apiQuery($contactParams);
+ [$contact] = CRM_Contact_BAO_Query::apiQuery($contactParams);
$prefs = array_pop($contact);
$params = [
['contact_id', '=', $contactId, 0, 0],
];
- list($contact, $_) = \CRM_Contact_BAO_Query::apiQuery($params);
+ [$contact] = \CRM_Contact_BAO_Query::apiQuery($params);
//CRM-4524
$contact = reset($contact);
if (!$contact || is_a($contact, 'CRM_Core_Error')) {
$searchParams = [[$key, '=', strtolower($value), 0, 1]];
}
- $result = CRM_Contact_BAO_Query::apiQuery($searchParams);
- $this->assertCount(1, $result[0], 'search for ' . $key);
- $contact = reset($result[0]);
+ [$result] = CRM_Contact_BAO_Query::apiQuery($searchParams);
+ $this->assertCount(1, $result, 'search for ' . $key);
+ $contact = reset($result);
$this->assertEquals('Minnie Mouse', $contact['display_name']);
$this->assertEquals('BOb', $contact['current_employer']);
}