INFRA-132 - Fix missing newlines in comments
[civicrm-core.git] / CRM / Core / BAO / Mapping.php
index 83473b728cee991a502e8e1fac34c3fb51fb06ea..3b5d659e4a5e2213ce2e13d88deb15a7e5fea4a8 100644 (file)
@@ -44,10 +44,12 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping {
   /**
    * Fetch object based on array of properties
    *
-   * @param array $params      (reference ) an assoc array of name/value pairs
-   * @param array $defaults    (reference ) an assoc array to hold the flattened values
+   * @param array $params
+   *   (reference ) an assoc array of name/value pairs.
+   * @param array $defaults
+   *   (reference ) an assoc array to hold the flattened values.
    *
-   * @return object     CRM_Core_DAO_Mapping object on success, otherwise null
+   * @return object     CRM_Core_DAO_Mapping object on success, otherwise NULL
    * @static
    */
   public static function retrieve(&$params, &$defaults) {
@@ -63,7 +65,8 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping {
   /**
    * Delete the mapping
    *
-   * @param int $id   mapping id
+   * @param int $id
+   *   Mapping id.
    *
    * @return boolean
    * @static
@@ -94,9 +97,10 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping {
    * contact object. the params array could contain additional unused name/value
    * pairs
    *
-   * @param array  $params an array of name/value pairs
+   * @param array $params
+   *   An array of name/value pairs.
    *
-   * @return object    CRM_Core_DAO_Mapper object on success, otherwise null
+   * @return object    CRM_Core_DAO_Mapper object on success, otherwise NULL
    * @static
    */
   public static function add($params) {
@@ -110,7 +114,8 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping {
   /**
    * Get the list of mappings
    *
-   * @param string  $mappingTypeId  mapping type id
+   * @param string $mappingTypeId
+   *   Mapping type id.
    *
    * @return array $mapping array of mapping name
    * @static
@@ -131,7 +136,8 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping {
   /**
    * Get the mapping fields
    *
-   * @param int $mappingId  mapping id
+   * @param int $mappingId
+   *   Mapping id.
    *
    * @return array $mappingFields array of mapping fields
    * @static
@@ -188,8 +194,10 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping {
   /**
    * Check Duplicate Mapping Name
    *
-   * @param $nameField  string mapping Name
-   * @param $mapTypeId string mapping Type
+   * @param string $nameField
+   *   mapping Name.
+   * @param string $mapTypeId
+   *   mapping Type.
    *
    * @return boolean
    */
@@ -203,9 +211,11 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping {
   /**
    * Function returns associated array of elements, that will be passed for search
    *
-   * @param int $smartGroupId smart group id
+   * @param int $smartGroupId
+   *   Smart group id.
    *
-   * @return array $returnFields  associated array of elements@static
+   * @return array $returnFields  associated array of elements
+   * @static
    */
   public static function getFormattedFields($smartGroupId) {
     $returnFields = array();
@@ -233,11 +243,13 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping {
    * Build the mapping form
    *
    * @param CRM_Core_Form $form
-   * @param string $mappingType (Export/Import/Search Builder)
+   * @param string $mappingType
+   *   (Export/Import/Search Builder).
    * @param int $mappingId
    * @param int $columnNo
-   * @param int $blockCount (no of blocks shown)
-   * @param null $exportMode
+   * @param int $blockCount
+   *   (no of blocks shown).
+   * @param NULL $exportMode
    *
    * @return void
    * @static
@@ -366,8 +378,8 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping {
       if (array_key_exists('note', $fields['Contact'])) {
         $noteTitle = $fields['Contact']['note']['title'];
         $fields['Contact']['note']['title'] = $noteTitle . ': ' . ts('Body and Subject');
-        $fields['Contact']['note_body']    = array( 'title' => $noteTitle . ': ' . ts('Body Only'),    'name' => 'note_body' );
-        $fields['Contact']['note_subject'] = array( 'title' => $noteTitle . ': ' . ts('Subject Only'), 'name' => 'note_subject' );
+        $fields['Contact']['note_body']    = array('title' => $noteTitle . ': ' . ts('Body Only'),    'name' => 'note_body');
+        $fields['Contact']['note_subject'] = array('title' => $noteTitle . ': ' . ts('Subject Only'), 'name' => 'note_subject');
       }
     }
 
@@ -587,7 +599,7 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping {
               // FIX ME: For now let's not expose custom data related to relationship
               $relationshipCustomFields = array();
               //$relationshipCustomFields    = self::getRelationTypeCustomGroupData( $id );
-              //asort( $relationshipCustomFields ) ;
+              //asort($relationshipCustomFields);
 
               $relationshipType = new CRM_Contact_BAO_RelationshipType();
               $relationshipType->id = $id;
@@ -860,7 +872,7 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping {
       $js .= implode(', ', $elements);
       $js .= "]";
       $js .= "
-                for(var i=0;i<nullArray.length;i++) {
+                for (var i=0;i<nullArray.length;i++) {
                     if ( {$formName}['mapper['+nullArray[i][0]+']['+nullArray[i][1]+']['+nullArray[i][2]+']'] ) {
                         {$formName}['mapper['+nullArray[i][0]+']['+nullArray[i][1]+']['+nullArray[i][2]+']'].style.display = '';
                     }
@@ -881,7 +893,7 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping {
       $js .= implode(', ', $elements);
       $js .= "]";
       $js .= "
-                for(var i=0;i<noneArray.length;i++) {
+                for (var i=0;i<noneArray.length;i++) {
                     if ( {$formName}['mapper['+noneArray[i][0]+']['+noneArray[i][1]+']['+noneArray[i][2]+']'] ) {
   {$formName}['mapper['+noneArray[i][0]+']['+noneArray[i][1]+']['+noneArray[i][2]+']'].style.display = 'none';
                     }
@@ -902,7 +914,8 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping {
    * Function returns all custom fields with group title and
    * field label
    *
-   * @param int $relationshipTypeId related relationship type id
+   * @param int $relationshipTypeId
+   *   Related relationship type id.
    *
    * @return array all custom field titles
    */
@@ -920,9 +933,11 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping {
   /**
    * Function returns all  Custom group Names
    *
-   * @param int $customfieldId related file id
+   * @param int $customfieldId
+   *   Related file id.
    *
-   * @return null|string $customGroupName all custom group names@static
+   * @return null|string $customGroupName all custom group names
+   * @static
    */
   public static function getCustomGroupName($customfieldId) {
     if ($customFieldId = CRM_Core_BAO_CustomField::getKeyID($customfieldId)) {
@@ -940,11 +955,14 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping {
   /**
    * Function returns associated array of elements, that will be passed for search
    *
-   * @param array $params associated array of submitted values
-   * @param bool $row  row no of the fields
+   * @param array $params
+   *   Associated array of submitted values.
+   * @param bool $row
+   *   Row no of the fields.
    *
    *
-   * @return array $returnFields  formatted associated array of elements@static
+   * @return array $returnFields  formatted associated array of elements
+   * @static
    */
   public static function formattedFields(&$params, $row = FALSE) {
     $fields = array();
@@ -1007,7 +1025,7 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping {
               'Multi-Select',
               'AdvMulti-Select',
               'Multi-Select State/Province',
-              'Multi-Select Country'
+              'Multi-Select Country',
             );
 
             // override the operator to handle separator ( note: this might have some performance issues )
@@ -1022,7 +1040,7 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping {
           }
 
           // CRM-14983: verify if values are comma separated convert to array
-          if (!is_array($value) && (strpos($value,',') !== false || strstr($value, '(')) && empty($isCustomField) && $params['operator'][$key][$k] == 'IN') {
+          if (!is_array($value) && (strpos($value,',') !== FALSE || strstr($value, '(')) && empty($isCustomField) && $params['operator'][$key][$k] == 'IN') {
             preg_match('#\((.*?)\)#', $value, $match);
             $tmpArray = explode(',', $match[1]);
             $value = array_combine(array_values($tmpArray),array_values($tmpArray));
@@ -1136,10 +1154,12 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping {
   /**
    * Save the mapping field info for search builder / export given the formvalues
    *
-   * @param array $params       asscociated array of formvalues
-   * @param int   $mappingId    mapping id
+   * @param array $params
+   *   Asscociated array of formvalues.
+   * @param int $mappingId
+   *   Mapping id.
    *
-   * @return null
+   * @return NULL
    * @static
    */
   public static function saveMappingFields(&$params, $mappingId) {