X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FBAO%2FCustomOption.php;h=179abf99abe17346112427941f21f192bde8ea2b;hb=2aa397bc9ba4608d4146278d55dedd4080c53aec;hp=07f3172a511c75568a85f30ff6c4c1d571f55b4f;hpb=c52174d854bcc01af1e112d3bb0eee0e201d65e6;p=civicrm-core.git diff --git a/CRM/Core/BAO/CustomOption.php b/CRM/Core/BAO/CustomOption.php index 07f3172a51..179abf99ab 100644 --- a/CRM/Core/BAO/CustomOption.php +++ b/CRM/Core/BAO/CustomOption.php @@ -1,7 +1,7 @@ copyValues($params); if ($customOption->find(TRUE)) { @@ -62,8 +63,10 @@ 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 bool $inactiveNeededDo we need inactive options ?. + * Do we need inactive options ?. * * @return array $customOption all active options for fieldId * @static @@ -107,17 +110,19 @@ class CRM_Core_BAO_CustomOption { * Returns the option label for a custom field with a specific value. Handles all * custom field data and html types * - * @param $fieldId int the custom field ID + * @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) + * @param $htmlType + * String the html type of the field (optional). + * @param $dataType + * String the data type of the field (optional). * * @return string the label to display for this custom field * @static - * @access public */ - static function getOptionLabel($fieldId, $value, $htmlType = NULL, $dataType = NULL) { + public static function getOptionLabel($fieldId, $value, $htmlType = NULL, $dataType = NULL) { if (!$fieldId) { return NULL; } @@ -166,9 +171,8 @@ WHERE id = %1 * param $optionId integer option id * * @static - * @access public */ - static function del($optionId) { + public static function del($optionId) { // get the customFieldID $query = " SELECT f.id as id, f.data_type as dataType @@ -212,7 +216,7 @@ WHERE id = %1"; * * @throws Exception */ - static function updateCustomValues($params) { + public static function updateCustomValues($params) { $optionDAO = new CRM_Core_DAO_OptionValue(); $optionDAO->id = $params['optionId']; $optionDAO->find(TRUE); @@ -267,7 +271,8 @@ WHERE id = %2"; $query = " UPDATE {$dao->tableName} SET {$dao->columnName} = REPLACE( {$dao->columnName}, %1, %2 )"; - $queryParams = array(1 => array($oldString, 'String'), + $queryParams = array( + 1 => array($oldString, 'String'), 2 => array($newString, 'String'), ); break; @@ -285,7 +290,7 @@ SET {$dao->columnName} = REPLACE( {$dao->columnName}, %1, %2 )"; * * @return array */ - static function valuesByID($customFieldID, $optionGroupID = NULL) { + public static function valuesByID($customFieldID, $optionGroupID = NULL) { if (!$optionGroupID) { $optionGroupID = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomField', $customFieldID, @@ -300,4 +305,3 @@ SET {$dao->columnName} = REPLACE( {$dao->columnName}, %1, %2 )"; return $options; } } -