CRM_Core_OptionGroup
class CRM_Core_OptionGroup
Properties
static | $_values | ||
static | $_cache | ||
static array | $_domainIDGroups | $_domainIDGroups array maintains the list of option groups for whom domainID is to be considered. |
Methods
No description
This function retrieves all the values for the specific option group by name this is primarily used to create various html based form elements (radio, select, checkbox etc). OptionGroups for most cases have the 'label' in the label column and the 'id' or 'name' in the value column
Counterpart to values() which removes the item from the cache
No description
This function retrieves all the values for the specific option group by id.
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).
No description
Get option_value.value from default option_value row for an option group
Creates a new option group with the passed in values.
No description
No description
No description
Wrapper for calling values with fresh set to true to empty the given value.
Flush all the places where option values are cached.
Details
at line 56
static array
valuesCommon(CRM_Core_DAO $dao, bool $flip = FALSE, bool $grouping = FALSE, bool $localize = FALSE, string $valueColumnName = 'label')
at line 118
static array
values(string $name, bool $flip = FALSE, bool $grouping = FALSE, bool $localize = FALSE, string $condition = NULL, string $labelColumnName = 'label', bool $onlyActive = TRUE, bool $fresh = FALSE, string $keyColumnName = 'value', string $orderBy = 'weight')
This function retrieves all the values for the specific option group by name this is primarily used to create various html based form elements (radio, select, checkbox etc). OptionGroups for most cases have the 'label' in the label column and the 'id' or 'name' in the value column
at line 194
static protected
flushValues(string $name, $flip, $grouping, $localize, $condition, string $labelColumnName, $onlyActive, string $keyColumnName = 'value')
Counterpart to values() which removes the item from the cache
at line 204
static protected string
createCacheKey($id)
at line 233
static array
valuesByID(int $id, bool $flip = FALSE, bool $grouping = FALSE, bool $localize = FALSE, string $labelColumnName = 'label', bool $onlyActive = TRUE, bool $fresh = FALSE)
This function retrieves all the values for the specific option group by id.
this is primarily used to create various html based form elements (radio, select, checkbox etc). OptionGroups for most cases have the 'label' in the label column and the 'id' or 'name' in the value column
at line 284
static
lookupValues(array $params, array $names, bool $flip = FALSE)
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).
at line 345
static null
getLabel(string $groupName, $value, bool $onlyActiveValue = TRUE)
deprecated
deprecated
at line 389
static null
getValue(string $groupName, $label, string $labelField = 'label', string $labelType = 'String', string $valueField = 'value')
deprecated
deprecated
at line 434
static string
getDefaultValue(string $groupName)
Get option_value.value from default option_value row for an option group
at line 482
static int
createAssoc(string $groupName, array $values, int $defaultID, null $groupTitle = NULL)
Creates a new option group with the passed in values.
at line 522
static
getAssoc(string $groupName, $values, bool $flip = FALSE, string $field = 'name')
at line 566
static
deleteAssoc(string $groupName, string $operator = "=")
at line 590
static array
getRowValues(string $groupName, $fieldValue, string $field = 'name', string $fieldType = 'String', bool $active = TRUE, bool $localize = FALSE)
at line 646
static
flush(string $name, array $params = [])
Wrapper for calling values with fresh set to true to empty the given value.
Since there appears to be some inconsistency (@todo remove inconsistency) around the pseudoconstant operations (for example CRM_Contribution_Pseudoconstant::paymentInstrument doesn't specify isActive which is part of the cache key will do a couple of variations & aspire to someone cleaning it up later
at line 684
static
flushAll()
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.