}
}
- /**
- * @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
*
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