<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
/**
* Create or update a contact (note you should always call this via civicrm_api() & never directly)
*
- * @param array $params input parameters
+ * @param array $params
+ * Input parameters.
*
* Allowed @params array keys are:
* {@getfields contact_create}
/**
* Adjust Metadata for Create action
*
- * @param array $params array or parameters determined by getfields
+ * @param array $params
+ * Array or parameters determined by getfields.
*/
function _civicrm_api3_contact_create_spec(&$params) {
$params['contact_type']['api.required'] = 1;
/**
* Retrieve one or more contacts, given a set of search params
*
- * @param array input parameters
+ * @param array input parameters
*
* @return array API Result Array
* (@getfields contact_get}
}
/**
- * @param $params
+ * @param array $params
*
* @return int
*/
/**
* Adjust Metadata for Get action
*
- * @param array $params array or parameters determined by getfields
+ * @param array $params
+ * Array or parameters determined by getfields.
*/
function _civicrm_api3_contact_get_spec(&$params) {
$params['contact_is_deleted']['api.default'] = 0;
*
* We also support 'filter_group_id' & 'filter.group_id'
*
- * @param array $params as passed into api get or getcount function
- * @param array $options array of options (so we can modify the filter)
+ * @param array $params
+ * As passed into api get or getcount function.
+ * @param array $options
+ * Array of options (so we can modify the filter).
*/
function _civicrm_api3_contact_get_supportanomalies(&$params, &$options) {
if (isset($params['showAll'])) {
/**
* Delete a contact with given contact id
*
- * @param array $params (reference ) input parameters, contact_id element required
+ * @param array $params
+ * (reference ) input parameters, contact_id element required.
*
* @return array API Result Array
* @access public
/**
- * @param $params
+ * @param array $params
* @param bool $dupeCheck
* @param bool $dupeErrorArray
* @param bool $obsoletevalue
- * @param null $dedupeRuleGroupID
+ * @param int $dedupeRuleGroupID
*
* @return null
* @throws API_Exception
if (!empty($params['contact_sub_type']) && !empty($params['contact_type'])) {
if (!(CRM_Contact_BAO_ContactType::isExtendsContactType($params['contact_sub_type'], $params['contact_type']))) {
- throw new API_Exception("Invalid or Mismatched Contact SubType: " . implode(', ', (array)$params['contact_sub_type']));
+ throw new API_Exception("Invalid or Mismatched Contact Subtype: " . implode(', ', (array)$params['contact_sub_type']));
}
}
* Takes an associative array and creates a contact object and all the associated
* derived objects (i.e. individual, location, email, phone etc)
*
- * @param array $params (reference ) an assoc array of name/value pairs
- * @param int $contactID if present the contact with that ID is updated
+ * @param array $params
+ * (reference ) an assoc array of name/value pairs.
+ * @param int $contactID
+ * If present the contact with that ID is updated.
*
- * @return object CRM_Contact_BAO_Contact object
+ * @return CRM_Contact_BAO_Contact object
* @access public
* @static
*/
/**
* Validate the addressee or email or postal greetings
*
- * @param array $params Associative array of property name/value
+ * @param array $params
+ * Associative array of property name/value.
* pairs to insert in new contact.
*
* @throws API_Exception
//CRM-10687
if (!empty($params['field_name']) && !empty($params['table_name'])) {
$table_name = CRM_Utils_String::munge($params['table_name']);
- $whereClause = " WHERE ( $table_name.$field_name LIKE '$strSearch')";
- $exactWhereClause = " WHERE ( $table_name.$field_name = '$name')";
+ $whereClause = " WHERE ( $table_name.$field_name LIKE '$strSearch') {$where}";
+ $exactWhereClause = " WHERE ( $table_name.$field_name = '$name') {$where}";
// Search by id should be exact
if ($field_name == 'id' || $field_name == 'external_identifier') {
$whereClause = $exactWhereClause;
/**
* Merges given pair of duplicate contacts.
*
- * @param array $params input parameters
+ * @param array $params
+ * Input parameters.
*
* Allowed @params array keys are:
* {int main_id main contact id with whom merge has to happen}
}
/**
- * @param $params
+ * @param array $params
*/
function _civicrm_api3_contact_proximity_spec(&$params) {
$params['latitude']['api.required'] = 1;
}
/**
- * @param $params
+ * @param array $params
*
* @return array
* @throws Exception
/**
* @see _civicrm_api3_generic_getlist_params
*
- * @param $request array
+ * @param $request
+ * Array.
*/
function _civicrm_api3_contact_getlist_params(&$request) {
// get the autocomplete options from settings
$request['params']['options']['sort'] = 'sort_name';
// Contact api doesn't support array(LIKE => 'foo') syntax
if (!empty($request['input'])) {
- // CRM-15442 - change spaces to % wildcards when searching by name
- $request['params'][$request['search_field']] = strpos($request['search_field'], 'name') ? str_replace(' ', '%', $request['input']) : $request['input'];
+ $request['params'][$request['search_field']] = $request['input'];
}
}
/**
* @see _civicrm_api3_generic_getlist_output
*
- * @param $result array
- * @param $request array
+ * @param $result
+ * Array.
+ * @param $request
+ * Array.
*
* @return array
*/