Test fixes for All kind of Custom Values
[civicrm-core.git] / CRM / Core / BAO / OptionValue.php
index 3eb2b944a8869a610bc0962301019f1012f0700b..116bcbca485dbc0dcde673572876e47ba5c577c1 100644 (file)
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014                                |
+ | Copyright CiviCRM LLC (c) 2004-2015                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
  | GNU Affero General Public License or the licensing of CiviCRM,     |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2014
+ * @copyright CiviCRM LLC (c) 2004-2015
  * $Id$
  *
  */
 class CRM_Core_BAO_OptionValue extends CRM_Core_DAO_OptionValue {
 
   /**
-   * Class constructor
+   * Class constructor.
    */
   public function __construct() {
     parent::__construct();
@@ -62,7 +62,7 @@ class CRM_Core_BAO_OptionValue extends CRM_Core_DAO_OptionValue {
   }
 
   /**
-   * Set default Parameters
+   * Set default Parameters.
    * This functions sets default parameters if not set:
    * - name & label are set to each other as required (it might make more sense for one
    * to be required but this would mean a change to the api level)
@@ -90,7 +90,7 @@ class CRM_Core_BAO_OptionValue extends CRM_Core_DAO_OptionValue {
   }
 
   /**
-   * Get next available value
+   * Get next available value.
    * We will take the highest numeric value (or 0 if no numeric values exist)
    * and add one. The calling function is responsible for any
    * more complex decision making
@@ -105,7 +105,7 @@ class CRM_Core_BAO_OptionValue extends CRM_Core_DAO_OptionValue {
   }
 
   /**
-   * Get next available value
+   * Get next available value.
    * We will take the highest numeric value (or 0 if no numeric values exist)
    * and add one. The calling function is responsible for any
    * more complex decision making
@@ -125,7 +125,7 @@ class CRM_Core_BAO_OptionValue extends CRM_Core_DAO_OptionValue {
   }
 
   /**
-   * Fetch object based on array of properties
+   * Fetch object based on array of properties.
    *
    * @param array $params
    *   (reference ) an assoc array of name/value pairs.
@@ -133,7 +133,6 @@ class CRM_Core_BAO_OptionValue extends CRM_Core_DAO_OptionValue {
    *   (reference ) an assoc array to hold the flattened values.
    *
    * @return CRM_Core_BAO_OptionValue
-   * @static
    */
   public static function retrieve(&$params, &$defaults) {
     $optionValue = new CRM_Core_DAO_OptionValue();
@@ -146,7 +145,7 @@ class CRM_Core_BAO_OptionValue extends CRM_Core_DAO_OptionValue {
   }
 
   /**
-   * Update the is_active flag in the db
+   * Update the is_active flag in the db.
    *
    * @param int $id
    *   Id of the database record.
@@ -155,21 +154,19 @@ class CRM_Core_BAO_OptionValue extends CRM_Core_DAO_OptionValue {
    *
    * @return Object
    *   DAO object on sucess, null otherwise
-   * @static
    */
   public static function setIsActive($id, $is_active) {
     return CRM_Core_DAO::setFieldValue('CRM_Core_DAO_OptionValue', $id, 'is_active', $is_active);
   }
 
   /**
-   * Add an Option Value
+   * Add an Option Value.
    *
    * @param array $params
    *   Reference array contains the values submitted by the form.
    * @param array $ids
    *   Reference array contains the id.
    *
-   * @static
    *
    * @return CRM_Core_DAO_OptionValue
    */
@@ -230,13 +227,12 @@ class CRM_Core_BAO_OptionValue extends CRM_Core_DAO_OptionValue {
   }
 
   /**
-   * Delete Option Value
+   * Delete Option Value.
    *
    * @param int $optionValueId
    *
-   * @return boolean
+   * @return bool
    *
-   * @static
    */
   public static function del($optionValueId) {
     $optionValue = new CRM_Core_DAO_OptionValue();
@@ -249,14 +245,13 @@ class CRM_Core_BAO_OptionValue extends CRM_Core_DAO_OptionValue {
   }
 
   /**
-   * Retrieve activity type label and description
+   * Retrieve activity type label and description.
    *
    * @param int $activityTypeId
    *   Activity type id.
    *
    * @return array
    *   label and description
-   * @static
    */
   public static function getActivityTypeDetails($activityTypeId) {
     $query = "SELECT civicrm_option_value.label, civicrm_option_value.description
@@ -281,7 +276,6 @@ class CRM_Core_BAO_OptionValue extends CRM_Core_DAO_OptionValue {
    * @return string
    *   title
    *
-   * @static
    */
   public static function getTitle($id) {
     return CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionValue', $id, 'label');
@@ -427,7 +421,6 @@ class CRM_Core_BAO_OptionValue extends CRM_Core_DAO_OptionValue {
    *   Options value , weight pair.
    *
    * @return void
-   * @static
    */
   public static function updateOptionWeights($opGroupId, $opWeights) {
     if (!is_array($opWeights) || empty($opWeights)) {
@@ -456,7 +449,6 @@ class CRM_Core_BAO_OptionValue extends CRM_Core_DAO_OptionValue {
    *
    * @return array
    *   an array of array of values for this option group
-   * @static
    */
   public static function getOptionValuesArray($optionGroupID) {
     // check if we can get the field values from the system cache
@@ -490,7 +482,6 @@ class CRM_Core_BAO_OptionValue extends CRM_Core_DAO_OptionValue {
    *
    * @return array
    *   an associative array of label, value pairs
-   * @static
    */
   public static function getOptionValuesAssocArray($optionGroupID) {
     $optionValues = self::getOptionValuesArray($optionGroupID);
@@ -511,7 +502,6 @@ class CRM_Core_BAO_OptionValue extends CRM_Core_DAO_OptionValue {
    *
    * @return array
    *   an associative array of label, value pairs
-   * @static
    */
   public static function getOptionValuesAssocArrayFromName($optionGroupName) {
     $dao = new CRM_Core_DAO_OptionGroup();