CRM_Contribute_PseudoConstant
class CRM_Contribute_PseudoConstant extends CRM_Core_PseudoConstant
This class holds all the Pseudo constants that are specific to Contributions.
This avoids polluting the core class and isolates the mass mailer class.
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
DEPRECATED generic populate method.
Flush given pseudoconstant so it can be reread from db nex time it's requested.
Get all the State/Province from database.
Get all the State/Province abbreviations from the database.
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 County from database.
No description
No description
Get all the World Regions from Database.
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.
Construct array of default greeting values for contact type.
Get all options values.
Fetch the list of active extensions of type 'module'
DEPRECATED. Please use the buildOptions() method in the appropriate BAO object.
DEPRECATED. Please use the buildOptions() method in the appropriate BAO object.
DEPRECATED. Please use the buildOptions() method in the appropriate BAO object.
DEPRECATED. Please use the buildOptions() method in the appropriate BAO object.
Get all the valid accepted credit cards.
Get all premiums.
Get all the contribution statuses.
Get all the Personal campaign pages.
Get all PCP Statuses.
Get financial account for a Financial type.
Get all batches.
Details
in CRM_Core_PseudoConstant at line 206
static array|bool
get(string $daoName, string $fieldName, array $params = array(), string $context = NULL)
Low-level option getter, rarely accessed directly.
NOTE: Rather than calling this function directly use CRM_BAO::buildOptions()
in CRM_Core_PseudoConstant at line 430
static bool|null|string
getLabel(string $baoName, string $fieldName, string|Int $key)
Fetch the translated label for a field given its key.
in CRM_Core_PseudoConstant at line 450
static bool|null|string
getName(string $baoName, string $fieldName, string|Int $key)
Fetch the machine name for a field given its key.
in CRM_Core_PseudoConstant at line 470
static bool|null|string|int
getKey(string $baoName, string $fieldName, string|Int $value)
Fetch the key for a field option given its name.
in CRM_Core_PseudoConstant at line 483
static string|null
getOptionEditUrl($fieldSpec)
Lookup the admin page at which a field's option list can be edited
in CRM_Core_PseudoConstant at line 533
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 generic populate method.
All pseudoconstant functions that use this method are also @deprecated
The static array $var is populated from the db using the $name DAO.
Note: any database errors will be trapped by the DAO.
at line 175
static
flush(bool|string $name = 'cache')
Flush given pseudoconstant so it can be reread from db nex time it's requested.
in CRM_Core_PseudoConstant at line 611
static array
activityType()
deprecated
deprecated
in CRM_Core_PseudoConstant at line 689
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.
in CRM_Core_PseudoConstant at line 743
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.
in CRM_Core_PseudoConstant at line 800
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.
in CRM_Core_PseudoConstant at line 875
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.
in CRM_Core_PseudoConstant at line 910
static array
allGroup(string $groupType = NULL, bool $excludeHidden = TRUE)
deprecated
deprecated
in CRM_Core_PseudoConstant at line 938
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.
in CRM_Core_PseudoConstant at line 949
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.
in CRM_Core_PseudoConstant at line 971
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.
in CRM_Core_PseudoConstant at line 1011
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.
in CRM_Core_PseudoConstant at line 1053
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
in CRM_Core_PseudoConstant at line 1343
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.
in CRM_Core_PseudoConstant at line 1378
static array
paymentProcessor(bool $all = FALSE, bool $test = FALSE, null $additionalCond = NULL)
deprecated
deprecated
in CRM_Core_PseudoConstant at line 1413
static array
paymentProcessorType(bool $all = FALSE, int $id = NULL, string $return = 'title')
deprecated
deprecated
in CRM_Core_PseudoConstant at line 1433
static array
worldRegion(bool $id = FALSE)
Get all the World Regions from Database.
in CRM_Core_PseudoConstant at line 1463
static array
activityStatus(string $column = 'label')
deprecated
deprecated
in CRM_Core_PseudoConstant at line 1489
static array
visibility(string $column = 'label')
deprecated
deprecated
in CRM_Core_PseudoConstant at line 1507
static array
stateProvinceForCountry(int $countryID, string $field = 'name')
in CRM_Core_PseudoConstant at line 1561
static array
countyForState(int $stateID)
in CRM_Core_PseudoConstant at line 1623
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
in CRM_Core_PseudoConstant at line 1652
static array
greeting($filter, string $columnName = 'label')
Get all types of Greetings.
The static array of greeting is returned
in CRM_Core_PseudoConstant at line 1698
static array
greetingDefaults()
Construct array of default greeting values for contact type.
in CRM_Core_PseudoConstant at line 1733
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.
in CRM_Core_PseudoConstant at line 1765
static array
accountOptionValues(bool $optionGroupName, int $id = NULL, null $condition = NULL)
Get all options values.
The static array option values is returned
in CRM_Core_PseudoConstant at line 1786
static array
getModuleExtensions(bool $fresh = FALSE)
Fetch the list of active extensions of type 'module'
in CRM_Core_PseudoConstant at line 1799
static array
getTaxRates()
Get all tax rates.
The static array tax rates is returned
at line 108
static array
financialType(int $id = NULL)
DEPRECATED. Please use the buildOptions() method in the appropriate BAO object.
Get all the financial types
at line 142
static array
financialAccount(int $id = NULL, int $financialAccountTypeId = NULL, string $retrieveColumn = 'name', string $key = 'id')
DEPRECATED. Please use the buildOptions() method in the appropriate BAO object.
Get all the financial Accounts
at line 195
static array
contributionPage(int $id = NULL, bool $all = FALSE)
DEPRECATED. Please use the buildOptions() method in the appropriate BAO object.
Get all the contribution pages
at line 227
static array
paymentInstrument(string $columnName = 'label')
DEPRECATED. Please use the buildOptions() method in the appropriate BAO object.
Get all the payment instruments
at line 244
static array
creditCard()
Get all the valid accepted credit cards.
at line 256
static array
products(int $pageID = NULL)
Get all premiums.
at line 304
static array
contributionStatus(int $id = NULL, string $columnName = 'label')
Get all the contribution statuses.
at line 329
static array
pcPage(null $pageType = NULL, int $id = NULL)
Get all the Personal campaign pages.
at line 360
static array
pcpStatus(string $column = 'label')
Get all PCP Statuses.
The static array pcpStatus is returned
at line 384
static int
getRelationalFinancialAccount(int $entityId, string $accountRelationType, string $entityTable = 'civicrm_financial_type', string $returnField = 'financial_account_id')
Get financial account for a Financial type.
at line 408
static array
batch(int $id = NULL)
Get all batches.