CRM_Core_PseudoConstant
class CRM_Core_PseudoConstant
Stores all constants and pseudo constants for CRM application.
examples of constants are "Contact Type" which will always be either 'Individual', 'Household', 'Organization'.
pseudo constants are entities from the database whose values rarely change. examples are list of countries, states, location types, relationship types.
currently we're getting the data from the underlying database. this will be reworked to use caching.
Note: All pseudoconstants should be uninitialized or default to NULL. This provides greater consistency/predictability after flushing.
Methods
Low-level option getter, rarely accessed directly.
Fetch the translated label for a field given its key.
Fetch the machine name for a field given its key.
Fetch the key for a field option given its name.
Lookup the admin page at which a field's option list can be edited
No description
Flush given pseudoconstant so it can be reread from db.
Get all the State/Province from database.
Get all the State/Province abbreviations from the database.
Get all the State/Province abbreviations from the database for the specified country.
Get all the State/Province abbreviations from the database for the default country.
Get all the countries from database.
Get all the country ISO Code abbreviations from the database.
Get all permissioned groups from database.
Fetch groups in a nested format suitable for use in select form element.
Get all permissioned groups from database.
Get all Relationship Types from database.
Get all the ISO 4217 currency codes
Get all the County from database.
No description
No description
Get all the World Regions from Database.
No description
No description
Given a state ID return the country ID, this allows us to populate forms and values for downstream code
Get all types of Greetings.
Get all extensions.
Get all options values.
Fetch the list of active extensions of type 'module'
Get all tax rates.
Get participant status class options.
Details
at line 198
static array|bool
get(string $daoName, string $fieldName, array $params = [], string $context = NULL)
Low-level option getter, rarely accessed directly.
NOTE: Rather than calling this function directly use CRM__BAO_::buildOptions()
at line 411
static bool|null|string
getLabel(string $baoName, string $fieldName, string|int $key)
Fetch the translated label for a field given its key.
at line 431
static bool|null|string
getName(string $baoName, string $fieldName, string|int $key)
Fetch the machine name for a field given its key.
at line 451
static bool|null|string|int
getKey(string $baoName, string $fieldName, string|int $value)
Fetch the key for a field option given its name.
at line 464
static string|null
getOptionEditUrl($fieldSpec)
Lookup the admin page at which a field's option list can be edited
at line 514
static array
populate(array $var, string $name, bool $all = FALSE, string $retrieve = 'name', string $filter = 'is_active', string $condition = NULL, bool $orderby = NULL, string $key = 'id', bool $force = NULL)
deprecated
deprecated
at line 571
static
flush(bool|string $name = 'cache')
Flush given pseudoconstant so it can be reread from db.
nex time it's requested.
at line 594
static array
activityType()
deprecated
deprecated
at line 672
static array
stateProvince(bool|int $id = FALSE, bool $limit = TRUE)
Get all the State/Province from database.
The static array stateProvince is returned, and if it's called the first time, the State Province DAO is used to get all the States.
Note: any database errors will be trapped by the DAO.
at line 726
static array
stateProvinceAbbreviation(bool|int $id = FALSE, bool $limit = TRUE)
Get all the State/Province abbreviations from the database.
Same as above, except gets the abbreviations instead of the names.
at line 774
static array
stateProvinceAbbreviationForCountry(int $countryID)
Get all the State/Province abbreviations from the database for the specified country.
at line 788
static array
stateProvinceAbbreviationForDefaultCountry()
Get all the State/Province abbreviations from the database for the default country.
at line 809
static array|null
country(bool|int $id = FALSE, bool $applyLimit = TRUE)
Get all the countries from database.
The static array country is returned, and if it's called the first time, the Country DAO is used to get all the countries.
Note: any database errors will be trapped by the DAO.
at line 884
static array
countryIsoCode(bool $id = FALSE)
Get all the country ISO Code abbreviations from the database.
The static array countryIsoCode is returned, and if it's called the first time, the Country DAO is used to get all the countries' ISO codes.
Note: any database errors will be trapped by the DAO.
at line 919
static array
allGroup(string $groupType = NULL, bool $excludeHidden = TRUE)
deprecated
deprecated
at line 952
static array
group(string $groupType = NULL, bool $excludeHidden = TRUE)
Get all permissioned groups from database.
The static array group is returned, and if it's called the first time, the Group DAO is used to get all the groups.
Note: any database errors will be trapped by the DAO.
at line 963
static array
nestedGroup(bool $checkPermissions = TRUE, string|null $groupType = NULL, bool $excludeHidden = TRUE)
Fetch groups in a nested format suitable for use in select form element.
at line 985
static array
staticGroup(bool $onlyPublic = FALSE, null $groupType = NULL, bool $excludeHidden = TRUE)
Get all permissioned groups from database.
The static array group is returned, and if it's called the first time, the Group DAO is used to get all the groups.
Note: any database errors will be trapped by the DAO.
at line 1025
static array
relationshipType(string $valueColumnName = 'label', bool $reset = FALSE, bool $isActive = 1)
Get all Relationship Types from database.
The static array group is returned, and if it's called the first time, the RelationshipType DAO is used to get all the relationship types.
Note: any database errors will be trapped by the DAO.
at line 1067
static array
currencyCode()
Get all the ISO 4217 currency codes
so far, we use this for validation only, so there's no point of putting this into the database
at line 1095
static array
county(bool|int $id = FALSE)
Get all the County from database.
The static array county is returned, and if it's called the first time, the County DAO is used to get all the Counties.
Note: any database errors will be trapped by the DAO.
at line 1130
static array
paymentProcessor(bool $all = FALSE, bool $test = FALSE, null $additionalCond = NULL)
deprecated
deprecated
at line 1165
static array
paymentProcessorType(bool $all = FALSE, int $id = NULL, string $return = 'title')
deprecated
deprecated
at line 1185
static array
worldRegion(bool $id = FALSE)
Get all the World Regions from Database.
at line 1215
static array
activityStatus(string $column = 'label')
deprecated
deprecated
at line 1241
static array
visibility(string $column = 'label')
deprecated
deprecated
at line 1259
static array
stateProvinceForCountry(int $countryID, string $field = 'name')
at line 1313
static array
countyForState(int $stateID)
at line 1375
static int|null
countryIDForStateID(int $stateID)
Given a state ID return the country ID, this allows us to populate forms and values for downstream code
at line 1404
static array
greeting($filter, string $columnName = 'label')
Get all types of Greetings.
The static array of greeting is returned
at line 1455
static array
getExtensions()
Get all extensions.
The static array extensions
FIXME: This is called by civix but not by any core code. We should provide an API call which civix can use instead.
at line 1491
static array
accountOptionValues(bool $optionGroupName, int $id = NULL, null $condition = NULL)
Get all options values.
The static array option values is returned
at line 1512
static array
getModuleExtensions(bool $fresh = FALSE)
Fetch the list of active extensions of type 'module'
at line 1524
static array
getTaxRates()
Get all tax rates.
The static array tax rates is returned
at line 1568
static array
emailOnHoldOptions()
Get participant status class options.