codespell: CRM/*
[civicrm-core.git] / CRM / Upgrade / Snapshot / V4p2 / Price / BAO / FieldValue.php
index 3285fe9acb4553d65d1484bea827de95bfbe0db8..571695fc2f7f3528ec516762e5b598632fb8d21b 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$
  *
  */
@@ -47,8 +47,7 @@ class CRM_Upgrade_Snapshot_V4p2_Price_BAO_FieldValue extends CRM_Upgrade_Snapsho
    *
    * @param $ids
    *
-   * @return CRM_Upgrade_Snapshot_V4p2_Price_DAO_FieldValue object
-   * @static
+   * @return CRM_Upgrade_Snapshot_V4p2_Price_DAO_FieldValue
    */
   public static function &add(&$params, $ids) {
 
@@ -76,13 +75,12 @@ class CRM_Upgrade_Snapshot_V4p2_Price_BAO_FieldValue extends CRM_Upgrade_Snapsho
    *
    * @param $ids
    *
-   * @return CRM_Upgrade_Snapshot_V4p2_Price_DAO_FieldValue object
-   * @static
+   * @return CRM_Upgrade_Snapshot_V4p2_Price_DAO_FieldValue
    */
   public static function create(&$params, $ids) {
 
     if (!is_array($params) || empty($params)) {
-      return;
+      return NULL;
     }
 
     if ($id = CRM_Utils_Array::value('id', $ids)) {
@@ -112,23 +110,23 @@ class CRM_Upgrade_Snapshot_V4p2_Price_BAO_FieldValue extends CRM_Upgrade_Snapsho
   }
 
   /**
-   * Takes a bunch of params that are needed to match certain criteria and
-   * retrieves the relevant objects.
+   * Retrieve DB object based on input parameters.
+   *
+   * It also stores all the retrieved values in the default array.
    *
    * @param array $params
    *   (reference ) an assoc array.
    * @param array $defaults
    *   (reference ) an assoc array to hold the flattened values.
    *
-   * @return CRM_Upgrade_Snapshot_V4p2_Price_DAO_FieldValue object
-   * @static
+   * @return CRM_Upgrade_Snapshot_V4p2_Price_DAO_FieldValue
    */
   public static function retrieve(&$params, &$defaults) {
     return CRM_Core_DAO::commonRetrieve('CRM_Upgrade_Snapshot_V4p2_Price_DAO_FieldValue', $params, $defaults);
   }
 
   /**
-   * Retrive the all values for given field id
+   * Retrive the all values for given field id.
    *
    * @param int $fieldId
    *   Price_field_id.
@@ -140,7 +138,6 @@ class CRM_Upgrade_Snapshot_V4p2_Price_BAO_FieldValue extends CRM_Upgrade_Snapsho
    *
    * @return array
    *
-   * @static
    */
   public static function getValues($fieldId, &$values, $orderBy = 'weight', $isActive = FALSE) {
     $fieldValueDAO = new CRM_Upgrade_Snapshot_V4p2_Price_DAO_FieldValue();
@@ -167,14 +164,13 @@ class CRM_Upgrade_Snapshot_V4p2_Price_BAO_FieldValue extends CRM_Upgrade_Snapsho
    * @return string
    *   name
    *
-   * @static
    */
   public static function getOptionLabel($id) {
     return CRM_Core_DAO::getFieldValue('CRM_Upgrade_Snapshot_V4p2_Price_DAO_FieldValue', $id, 'label');
   }
 
   /**
-   * Update the is_active flag in the db
+   * Update the is_active flag in the db.
    *
    * @param int $id
    *   Id of the database record.
@@ -182,23 +178,21 @@ class CRM_Upgrade_Snapshot_V4p2_Price_BAO_FieldValue extends CRM_Upgrade_Snapsho
    *   Value we want to set the is_active field.
    *
    * @return Object
-   *   DAO object on sucess, null otherwise
+   *   DAO object on success, null otherwise
    *
-   * @static
    */
   public static function setIsActive($id, $is_active) {
     return CRM_Core_DAO::setFieldValue('CRM_Upgrade_Snapshot_V4p2_Price_DAO_FieldValue', $id, 'is_active', $is_active);
   }
 
   /**
-   * Delete all values of the given field id
+   * Delete all values of the given field id.
    *
    * @param int $fieldId
    *   Price field id.
    *
-   * @return boolean
+   * @return bool
    *
-   * @static
    */
   public static function deleteValues($fieldId) {
     if (!$fieldId) {
@@ -216,9 +210,8 @@ class CRM_Upgrade_Snapshot_V4p2_Price_BAO_FieldValue extends CRM_Upgrade_Snapsho
    * @param int $id
    *   Id.
    *
-   * @return boolean
+   * @return bool
    *
-   * @static
    */
   public static function del($id) {
     if (!$id) {
@@ -229,4 +222,5 @@ class CRM_Upgrade_Snapshot_V4p2_Price_BAO_FieldValue extends CRM_Upgrade_Snapsho
     $fieldValueDAO->id = $id;
     return $fieldValueDAO->delete();
   }
+
 }