X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FBAO%2FOptionGroup.php;h=c03ed0e4dfb087fedf61b705c83be84b05b78937;hb=d36b8b20ac964dc3c0a74f98f580dc7b0ad7383e;hp=5d1e0abfa8b94f664f763bf917876258e541d470;hpb=11df99209d13885aaf45a5c94612bdc65eb490ff;p=civicrm-core.git diff --git a/CRM/Core/BAO/OptionGroup.php b/CRM/Core/BAO/OptionGroup.php index 5d1e0abfa8..c03ed0e4df 100644 --- a/CRM/Core/BAO/OptionGroup.php +++ b/CRM/Core/BAO/OptionGroup.php @@ -37,21 +37,22 @@ class CRM_Core_BAO_OptionGroup extends CRM_Core_DAO_OptionGroup { /** * Class constructor */ - function __construct() { + public function __construct() { parent::__construct(); } /** * 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 CRM_Core_BAO_OptionGroup object - * @access public + * @return CRM_Core_BAO_OptionGroup * @static */ - static function retrieve(&$params, &$defaults) { + public static function retrieve(&$params, &$defaults) { $optionGroup = new CRM_Core_DAO_OptionGroup(); $optionGroup->copyValues($params); if ($optionGroup->find(TRUE)) { @@ -64,29 +65,33 @@ class CRM_Core_BAO_OptionGroup extends CRM_Core_DAO_OptionGroup { /** * 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 * @static */ - static function setIsActive($id, $is_active) { + public static function setIsActive($id, $is_active) { return CRM_Core_DAO::setFieldValue('CRM_Core_DAO_OptionGroup', $id, 'is_active', $is_active); } /** * Add the Option Group * - * @param array $params reference array contains the values submitted by the form - * @param array $ids reference array contains the id + * @param array $params + * Reference array contains the values submitted by the form. + * @param array $ids + * Reference array contains the id. * - * @access public * @static * * @return object */ - static function add(&$params, $ids = array()) { - if(empty($params['id'])){ + public static function add(&$params, $ids = array()) { + if (empty($params['id'])) { $params['id'] = CRM_Utils_Array::value('optionGroup', $ids); } @@ -109,14 +114,14 @@ class CRM_Core_BAO_OptionGroup extends CRM_Core_DAO_OptionGroup { /** * Delete Option Group * - * @param int $optionGroupId Id of the Option Group to be deleted. + * @param int $optionGroupId + * Id of the Option Group to be deleted. * * @return void * - * @access public * @static */ - static function del($optionGroupId) { + public static function del($optionGroupId) { // need to delete all option value field before deleting group $optionValue = new CRM_Core_DAO_OptionValue(); $optionValue->option_group_id = $optionGroupId; @@ -130,18 +135,18 @@ class CRM_Core_BAO_OptionGroup extends CRM_Core_DAO_OptionGroup { /** * Get title of the option group * - * @param int $optionGroupId Id of the Option Group. + * @param int $optionGroupId + * Id of the Option Group. * - * @return String title + * @return String + * title * - * @access public * @static */ - static function getTitle($optionGroupId) { + public static function getTitle($optionGroupId) { $optionGroup = new CRM_Core_DAO_OptionGroup(); $optionGroup->id = $optionGroupId; $optionGroup->find(TRUE); return $optionGroup->name; } } -