Merge pull request #4693 from jaapjansma/CRM-15702
[civicrm-core.git] / CRM / Core / BAO / CustomOption.php
index 2035dc37cb96e6eadbc4e9fd6c87f5da4d705450..07f3172a511c75568a85f30ff6c4c1d571f55b4f 100644 (file)
 class CRM_Core_BAO_CustomOption {
 
   /**
-   * Takes a bunch of params that are needed to match certain criteria and
-   * retrieves the relevant objects. Typically the valid params are only
-   * contact_id. We'll tweak this function to be more full featured over a period
-   * of time. This is the inverse function of create. It also stores all the retrieved
-   * values in the default array
+   * 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
    *
-   * @return object CRM_Core_BAO_CustomOption object
+   * @return CRM_Core_BAO_CustomOption object
    * @access public
    * @static
    */
@@ -66,8 +62,8 @@ class CRM_Core_BAO_CustomOption {
   /**
    * Returns all active options ordered by weight for a given field
    *
-   * @param  int      $fieldId         field whose options are needed
-   * @param  boolean  $inactiveNeeded  do we need inactive options ?
+   * @param int $fieldID field whose options are needed
+   * @param  boolean $inactiveNeeded do we need inactive options ?
    *
    * @return array $customOption all active options for fieldId
    * @static
@@ -113,6 +109,7 @@ class CRM_Core_BAO_CustomOption {
    *
    * @param $fieldId  int    the custom field ID
    * @pram  $value    string the value (typically from the DB) of this custom field
+   * @param $value
    * @param $htmlType string the html type of the field (optional)
    * @param $dataType string the data type of the field (optional)
    *
@@ -164,7 +161,7 @@ WHERE  id = %1
   }
 
   /**
-   * Function to delete Option
+   * Delete Option
    *
    * param $optionId integer option id
    *
@@ -210,6 +207,11 @@ WHERE  id = %1";
     }
   }
 
+  /**
+   * @param array $params
+   *
+   * @throws Exception
+   */
   static function updateCustomValues($params) {
     $optionDAO = new CRM_Core_DAO_OptionValue();
     $optionDAO->id = $params['optionId'];
@@ -277,6 +279,12 @@ SET    {$dao->columnName} = REPLACE( {$dao->columnName}, %1, %2 )";
     }
   }
 
+  /**
+   * @param int $customFieldID
+   * @param int $optionGroupID
+   *
+   * @return array
+   */
   static function valuesByID($customFieldID, $optionGroupID = NULL) {
     if (!$optionGroupID) {
       $optionGroupID = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomField',