INFRA-132 - Batch 14 (g)
[civicrm-core.git] / api / v3 / Contact.php
index 281897beb8a6f890e40fc207d8ff69490f83c9d5..4a23bdd0b49182102b2562cccb69226c41e02687 100644 (file)
  * @throws API_Exception
  * @example ContactCreate.php Example of Create Call
  *
- * @return array  API Result Array
+ * @return array
+ *   API Result Array
  *
- * @static void
- * @access public
  */
 function civicrm_api3_contact_create($params) {
 
@@ -144,13 +143,8 @@ function _civicrm_api3_contact_create_spec(&$params) {
  *
  * @param array input parameters
  *
- * @return array API Result Array
- * (@getfields contact_get}
- * @static void
- * @access public
- *
- * @example ContactGet.php Standard GET example
- *
+ * @return array
+ *   API Result Array
  */
 function civicrm_api3_contact_get($params) {
   $options = array();
@@ -268,13 +262,10 @@ 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.
- *
- * @return array API Result Array
- * @access public
+ *   input parameters per getfields
  *
- * @example ContactDelete.php
- * {@getfields contact_delete}
+ * @return array
+ *   API Result Array
  */
 function civicrm_api3_contact_delete($params) {
 
@@ -305,16 +296,12 @@ function civicrm_api3_contact_delete($params) {
 /**
  * @param array $params
  * @param bool $dupeCheck
- * @param bool $dupeErrorArray
- * @param bool $obsoletevalue
- * @param int $dedupeRuleGroupID
  *
  * @return null
  * @throws API_Exception
  * @throws CiviCRM_API3_Exception
  */
-function _civicrm_api3_contact_check_params(&$params, $dupeCheck = TRUE, $dupeErrorArray = FALSE, $obsoletevalue = TRUE, $dedupeRuleGroupID = NULL)
-{
+function _civicrm_api3_contact_check_params(&$params, $dupeCheck) {
 
   switch (strtolower(CRM_Utils_Array::value('contact_type', $params))) {
     case 'household':
@@ -362,7 +349,7 @@ function _civicrm_api3_contact_check_params(&$params, $dupeCheck = TRUE, $dupeEr
     $ids = CRM_Dedupe_Finder::dupesByParams($dedupeParams, $params['contact_type'], 'Unsupervised', array());
 
     if (count($ids) > 0) {
-      throw new API_Exception("Found matching contacts: " .  implode(',', $ids), "duplicate", array("ids" => $ids));
+      throw new API_Exception("Found matching contacts: " . implode(',', $ids), "duplicate", array("ids" => $ids));
     }
   }
 
@@ -393,7 +380,7 @@ function _civicrm_api3_contact_check_params(&$params, $dupeCheck = TRUE, $dupeEr
     else {
       $result = civicrm_api3('contact', 'create', array(
         'organization_name' => $params['current_employer'],
-        'contact_type' => 'Organization'
+        'contact_type' => 'Organization',
       ));
       $params['employer_id'] = $result['id'];
     }
@@ -411,9 +398,7 @@ function _civicrm_api3_contact_check_params(&$params, $dupeCheck = TRUE, $dupeEr
  * @param int $contactID
  *   If present the contact with that ID is updated.
  *
- * @return CRM_Contact_BAO_Contact object
- * @access public
- * @static
+ * @return CRM_Contact_BAO_Contact|CRM_Core_Error
  */
 function _civicrm_api3_contact_update($params, $contactID = NULL) {
   //@todo - doesn't contact create support 'id' which is already set- check & remove
@@ -433,7 +418,6 @@ function _civicrm_api3_contact_update($params, $contactID = NULL) {
  *
  * @throws API_Exception
  *
- * @access public
  */
 function _civicrm_api3_greeting_format_params($params) {
   $greetingParams = array('', '_id', '_custom');
@@ -558,7 +542,9 @@ function _civicrm_api3_greeting_format_params($params) {
  * @deprecated
  *
  * {@example ContactGetquick.php 0}
- *
+ * @param array $params
+ * @return array
+ * @throws \API_Exception
  */
 function civicrm_api3_contact_getquick($params) {
   civicrm_api3_verify_mandatory($params, NULL, array('name'));
@@ -834,16 +820,16 @@ LIMIT    0, {$limit}
         $contactList = array(
           array(
           'data' => $currEmpDetails['data'],
-            'id'   => $currEmpDetails['id']
-          )
+            'id'   => $currEmpDetails['id'],
+          ),
         );
       }
       else {
         $contactList = array(
           array(
             'data' => $name,
-            'id'   => $name
-          )
+            'id'   => $name,
+          ),
         );
       }
     }
@@ -854,7 +840,8 @@ LIMIT    0, {$limit}
 
 /**
  * @deprecated api notice
- * @return array of deprecated actions
+ * @return array
+ *   Array of deprecated actions
  */
 function _civicrm_api3_contact_deprecation() {
   return array('getquick' => 'The "getquick" action is deprecated in favor of "getlist".');
@@ -873,10 +860,9 @@ function _civicrm_api3_contact_deprecation() {
  *                      A 'safe' value skips the merge if there are no conflicts. Does a force merge otherwise.}
  * {boolean auto_flip   wether to let api decide which contact to retain and which to delete.}
  *
- * @return array  API Result Array
+ * @return array
+ *   API Result Array
  *
- * @static void
- * @access public
  */
 function civicrm_api3_contact_merge($params) {
   $mode = CRM_Utils_Array::value('mode', $params, 'safe');