From e57e2a56e57db0151464014b5c482da4af00cca4 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Tue, 15 Dec 2015 16:29:20 -0500 Subject: [PATCH] CRM-17646 - Refactor out CRM_Core_BAO_CustomOption::valuesByID --- CRM/Core/BAO/CustomOption.php | 21 --------------------- CRM/Utils/Rule.php | 17 ----------------- 2 files changed, 38 deletions(-) diff --git a/CRM/Core/BAO/CustomOption.php b/CRM/Core/BAO/CustomOption.php index 6c44541c83..559f9cb638 100644 --- a/CRM/Core/BAO/CustomOption.php +++ b/CRM/Core/BAO/CustomOption.php @@ -333,27 +333,6 @@ SET {$dao->columnName} = REPLACE( {$dao->columnName}, %1, %2 )"; } } - /** - * @param int $customFieldID - * @param int $optionGroupID - * - * @return array - */ - public static function valuesByID($customFieldID, $optionGroupID = NULL) { - if (!$optionGroupID) { - $optionGroupID = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomField', - $customFieldID, - 'option_group_id' - ); - } - - $options = $optionGroupID ? CRM_Core_OptionGroup::valuesByID($optionGroupID) : array(); - - CRM_Utils_Hook::customFieldOptions($customFieldID, $options, FALSE); - - return $options; - } - /** * When changing the value of an option this is called to update all corresponding custom data * diff --git a/CRM/Utils/Rule.php b/CRM/Utils/Rule.php index ff361257a1..c3b483b921 100644 --- a/CRM/Utils/Rule.php +++ b/CRM/Utils/Rule.php @@ -737,23 +737,6 @@ class CRM_Utils_Rule { return is_dir(Civi::paths()->getPath($path)); } - /** - * @param $value - * @param $options - * - * @return bool - */ - public static function autocomplete($value, $options) { - if ($value) { - $selectOption = CRM_Core_BAO_CustomOption::valuesByID($options['fieldID'], $options['optionGroupID']); - - if (!in_array($value, $selectOption)) { - return FALSE; - } - } - return TRUE; - } - /** * @param $value * @param null $actualElementValue -- 2.25.1