X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FOptionGroup.php;h=250c93cff309723831aec292d907c1066d97aec0;hb=7c990617d04cdb233309f428d94e4be3bf3b57e3;hp=c6e8a79c9a05d2227e07e2b41100b373d03f9c2f;hpb=33266e23955cce5adeb2c3e1b923d6ec36737125;p=civicrm-core.git diff --git a/CRM/Core/OptionGroup.php b/CRM/Core/OptionGroup.php index c6e8a79c9a..250c93cff3 100644 --- a/CRM/Core/OptionGroup.php +++ b/CRM/Core/OptionGroup.php @@ -262,9 +262,9 @@ WHERE v.option_group_id = g.id } /** - * Lookup titles OR ids for a set of option_value populated fields. The retrieved value - * is assigned a new fieldname by id or id's by title - * (each within a specificied option_group) + * Lookup titles OR ids for a set of option_value populated fields. The + * retrieved value is assigned a new field name by id or id's by title + * (each within a specified option_group). * * @param array $params * Reference array of values submitted by the form. Based on. @@ -274,14 +274,13 @@ WHERE v.option_group_id = g.id * If $flip = true, adds actual field name => id * * @param array $names - * Reference array of fieldnames we want transformed. + * Array of field names we want transformed. * Array key = 'postName' (field name submitted by form in $params). * Array value = array('newName' => $newName, 'groupName' => $groupName). * - * * @param bool $flip */ - public static function lookupValues(&$params, &$names, $flip = FALSE) { + public static function lookupValues(&$params, $names, $flip = FALSE) { foreach ($names as $postName => $value) { // See if $params field is in $names array (i.e. is a value that we need to lookup) if ($postalName = CRM_Utils_Array::value($postName, $params)) { @@ -343,6 +342,7 @@ WHERE v.option_group_id = g.id * @return null */ public static function getLabel($groupName, $value, $onlyActiveValue = TRUE) { + Civi::log()->warning('Deprecated function, use CRM_Core_PseudoConstant::getLabel', array('civi.tag' => 'deprecated')); if (empty($groupName) || empty($value) ) { @@ -396,6 +396,8 @@ WHERE v.option_group_id = g.id return NULL; } + Civi::log()->warning('Deprecated function, use CRM_Core_PseudoConstant::getKey', array('civi.tag' => 'deprecated')); + $query = " SELECT v.label as label ,v.{$valueField} as value FROM civicrm_option_value v, @@ -674,6 +676,12 @@ WHERE v.option_group_id = g.id ); } + /** + * Flush all the places where option values are cached. + * + * Note that this is called from CRM_Core_PseudoConstant::flush() so we should resist + * the intuitive urge to flush that class. + */ public static function flushAll() { self::$_values = array(); self::$_cache = array();