X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FUpgrade%2FSnapshot%2FV4p2%2FPrice%2FBAO%2FFieldValue.php;h=5f73c8455beaf665b38f3b5ff1acf90884f55fd6;hb=674cb8b854f6008090d4dcce9372ee76346a198f;hp=f06a7a3acfa1758d127a88e7156818747edefd6b;hpb=11df99209d13885aaf45a5c94612bdc65eb490ff;p=civicrm-core.git diff --git a/CRM/Upgrade/Snapshot/V4p2/Price/BAO/FieldValue.php b/CRM/Upgrade/Snapshot/V4p2/Price/BAO/FieldValue.php index f06a7a3acf..5f73c8455b 100644 --- a/CRM/Upgrade/Snapshot/V4p2/Price/BAO/FieldValue.php +++ b/CRM/Upgrade/Snapshot/V4p2/Price/BAO/FieldValue.php @@ -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. | | | @@ -23,12 +23,12 @@ | 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$ * */ @@ -42,15 +42,14 @@ class CRM_Upgrade_Snapshot_V4p2_Price_BAO_FieldValue extends CRM_Upgrade_Snapsho /** * Insert/update a new entry in the database. * - * @param array $params (reference), array $ids + * @param array $params + * (reference), array $ids. * * @param $ids * - * @return CRM_Upgrade_Snapshot_V4p2_Price_DAO_FieldValue object - * @access public - * @static + * @return CRM_Upgrade_Snapshot_V4p2_Price_DAO_FieldValue */ - static function &add(&$params, $ids) { + public static function &add(&$params, $ids) { $fieldValueBAO = new CRM_Upgrade_Snapshot_V4p2_Price_BAO_FieldValue(); $fieldValueBAO->copyValues($params); @@ -71,22 +70,23 @@ class CRM_Upgrade_Snapshot_V4p2_Price_BAO_FieldValue extends CRM_Upgrade_Snapsho /** * Creates a new entry in the database. * - * @param array $params (reference), array $ids + * @param array $params + * (reference), array $ids. * * @param $ids * - * @return CRM_Upgrade_Snapshot_V4p2_Price_DAO_FieldValue object - * @access public - * @static + * @return CRM_Upgrade_Snapshot_V4p2_Price_DAO_FieldValue */ - static function create(&$params, $ids) { + public static function create(&$params, $ids) { if (!is_array($params) || empty($params)) { - return; + return NULL; } if ($id = CRM_Utils_Array::value('id', $ids)) { - if (isset($params['name']))unset($params['name']); + if (isset($params['name'])) { + unset($params['name']); + } $oldWeight = NULL; if ($id) { @@ -110,34 +110,36 @@ 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. * - * @param array $params (reference ) an assoc array - * @param array $defaults (reference ) an assoc array to hold the flattened values + * It also stores all the retrieved values in the default array. * - * @return CRM_Upgrade_Snapshot_V4p2_Price_DAO_FieldValue object - * @access public - * @static + * @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 */ - static function retrieve(&$params, &$defaults) { + 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 - * - * @param int $fieldId price_field_id - * @param array $values (reference ) to hold the values - * @param string $orderBy for order by, default weight + * Retrive the all values for given field id. + * + * @param int $fieldId + * Price_field_id. + * @param array $values + * (reference ) to hold the values. + * @param string $orderBy + * For order by, default weight. * @param bool|int $isActive is_active, default false * - * @return array $values + * @return array * - * @access public - * @static */ - static function getValues($fieldId, &$values, $orderBy = 'weight', $isActive = FALSE) { + public static function getValues($fieldId, &$values, $orderBy = 'weight', $isActive = FALSE) { $fieldValueDAO = new CRM_Upgrade_Snapshot_V4p2_Price_DAO_FieldValue(); $fieldValueDAO->price_field_id = $fieldId; $fieldValueDAO->orderBy($orderBy, 'label'); @@ -156,12 +158,11 @@ class CRM_Upgrade_Snapshot_V4p2_Price_BAO_FieldValue extends CRM_Upgrade_Snapsho /** * Get the price field option label. * - * @param int $id id of field option. + * @param int $id + * Id of field option. * - * @return string name - * - * @access public - * @static + * @return string + * name * */ public static function getOptionLabel($id) { @@ -169,31 +170,31 @@ class CRM_Upgrade_Snapshot_V4p2_Price_BAO_FieldValue extends CRM_Upgrade_Snapsho } /** - * Update the is_active flag in the db + * Update the is_active flag in the db. * - * @param int $id Id of the database record - * @param boolean $is_active Value we want to set the is_active field + * @param int $id + * Id of the database record. + * @param bool $is_active + * Value we want to set the is_active field. * - * @return Object DAO object on sucess, null otherwise + * @return Object + * DAO object on sucess, null otherwise * - * @access public - * @static */ - static function setIsActive($id, $is_active) { + 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 + * @param int $fieldId + * Price field id. * - * @return boolean + * @return bool * - * @access public - * @static */ - static function deleteValues($fieldId) { + public static function deleteValues($fieldId) { if (!$fieldId) { return FALSE; } @@ -206,14 +207,13 @@ class CRM_Upgrade_Snapshot_V4p2_Price_BAO_FieldValue extends CRM_Upgrade_Snapsho /** * Delete the value. * - * @param int $id Id + * @param int $id + * Id. * - * @return boolean + * @return bool * - * @access public - * @static */ - static function del($id) { + public static function del($id) { if (!$id) { return FALSE; } @@ -222,5 +222,5 @@ class CRM_Upgrade_Snapshot_V4p2_Price_BAO_FieldValue extends CRM_Upgrade_Snapsho $fieldValueDAO->id = $id; return $fieldValueDAO->delete(); } -} +}