INFRA-132 - api - Convert single-line @param to multi-line
[civicrm-core.git] / api / v3 / Contact.php
index 8e55caf96b14112d140c6ab0443f5436f9ec0f80..e3dbcd3ca39ab9bea93aefe892f3f2807aa2894e 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
   +--------------------------------------------------------------------+
-  | CiviCRM version 4.5                                                |
+  | CiviCRM version 4.6                                                |
   +--------------------------------------------------------------------+
   | Copyright CiviCRM LLC (c) 2004-2014                                |
   +--------------------------------------------------------------------+
@@ -40,7 +40,8 @@
 /**
  * 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}
@@ -116,7 +117,8 @@ function civicrm_api3_contact_create($params) {
 /**
  * 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;
@@ -137,7 +139,7 @@ function _civicrm_api3_contact_create_spec(&$params) {
 /**
  * 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}
@@ -155,7 +157,7 @@ function civicrm_api3_contact_get($params) {
 }
 
 /**
- * @param $params
+ * @param array $params
  *
  * @return int
  */
@@ -169,7 +171,8 @@ function civicrm_api3_contact_getcount($params) {
 /**
  * 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;
@@ -221,8 +224,10 @@ function _civicrm_api3_contact_get_spec(&$params) {
  *
  * 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'])) {
@@ -257,7 +262,8 @@ function _civicrm_api3_contact_get_supportanomalies(&$params, &$options) {
 /**
  * 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
@@ -292,11 +298,11 @@ function civicrm_api3_contact_delete($params) {
 
 
 /**
- * @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
@@ -330,7 +336,7 @@ function _civicrm_api3_contact_check_params( &$params, $dupeCheck = true, $dupeE
 
   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']));
       }
     }
 
@@ -393,10 +399,12 @@ function _civicrm_api3_contact_check_params( &$params, $dupeCheck = true, $dupeE
  * 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
  */
@@ -412,7 +420,8 @@ function _civicrm_api3_contact_update($params, $contactID = NULL) {
 /**
  * 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
@@ -849,7 +858,8 @@ function _civicrm_api3_contact_deprecation() {
 /**
  * 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}
@@ -881,7 +891,7 @@ function civicrm_api3_contact_merge($params) {
 }
 
 /**
- * @param $params
+ * @param array $params
  */
 function _civicrm_api3_contact_proximity_spec(&$params) {
   $params['latitude']['api.required'] = 1;
@@ -893,7 +903,7 @@ function _civicrm_api3_contact_proximity_spec(&$params) {
 }
 
 /**
- * @param $params
+ * @param array $params
  *
  * @return array
  * @throws Exception
@@ -946,7 +956,8 @@ WHERE     $whereClause
 /**
  * @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
@@ -982,16 +993,17 @@ function _civicrm_api3_contact_getlist_params(&$request) {
   $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
  */