class CRM_Case_PseudoConstant extends CRM_Core_PseudoConstant

This class holds all the Pseudo constants that are specific for CiviCase.

Properties

static array $activityTypeList Activity type

Methods

static array|bool
get(string $daoName, string $fieldName, array $params = array(), string $context = NULL)

Low-level option getter, rarely accessed directly.

static bool|null|string
getLabel(string $baoName, string $fieldName, string|Int $key)

Fetch the translated label for a field given its key.

static bool|null|string
getName(string $baoName, string $fieldName, string|Int $key)

Fetch the machine name for a field given its key.

static bool|null|string|int
getKey(string $baoName, string $fieldName, string|Int $value)

Fetch the key for a field option given its name.

static string|null
getOptionEditUrl($fieldSpec)

Lookup the admin page at which a field's option list can be edited

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.

static 
flush(bool|string $name = 'cache')

Flush given pseudoconstant so it can be reread from db next time it's requested.

static array
activityType() deprecated

No description

static array
stateProvince(bool|int $id = FALSE, bool $limit = TRUE)

Get all the State/Province from database.

static array
stateProvinceAbbreviation(bool|int $id = FALSE, bool $limit = TRUE)

Get all the State/Province abbreviations from the database.

static array|null
country(bool|int $id = FALSE, bool $applyLimit = TRUE)

Get all the countries from database.

static array
countryIsoCode(bool $id = FALSE)

Get all the country ISO Code abbreviations from the database.

static array
allGroup(string $groupType = NULL, bool $excludeHidden = TRUE) deprecated

No description

static array
group(string $groupType = NULL, bool $excludeHidden = TRUE)

Get all permissioned groups from database.

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.

static array
staticGroup(bool $onlyPublic = FALSE, null $groupType = NULL, bool $excludeHidden = TRUE)

Get all permissioned groups from database.

static array
relationshipType(string $valueColumnName = 'label', bool $reset = FALSE, bool $isActive = 1)

Get all Relationship Types from database.

static array
currencyCode()

Get all the ISO 4217 currency codes

static array
county(bool|int $id = FALSE)

Get all the County from database.

static array
paymentProcessor(bool $all = FALSE, bool $test = FALSE, null $additionalCond = NULL) deprecated

No description

static array
paymentProcessorType(bool $all = FALSE, int $id = NULL, string $return = 'title') deprecated

No description

static array
worldRegion(bool $id = FALSE)

Get all the World Regions from Database.

static array
activityStatus(string $column = 'label') deprecated

No description

static array
visibility(string $column = 'label') deprecated

No description

static array
stateProvinceForCountry(int $countryID, string $field = 'name')

No description

static array
countyForState(int $stateID)

No description

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

static array
greeting($filter, string $columnName = 'label')

Get all types of Greetings.

static array
greetingDefaults()

Construct array of default greeting values for contact type.

static array
getExtensions()

Get all extensions.

static array
accountOptionValues(bool $optionGroupName, int $id = NULL, null $condition = NULL)

Get all options values.

static array
getModuleExtensions(bool $fresh = FALSE)

Fetch the list of active extensions of type 'module'

static array
getTaxRates()

Get all tax rates.

static array
caseStatus(string $column = 'label', bool $onlyActive = TRUE, null $condition = NULL, bool $fresh = FALSE)

Get all the case statues.

static array
redactionRule(null $filter = NULL)

Get all the redaction rules.

static array
caseType(string $column = 'title', bool $onlyActive = TRUE)

Get all the case type.

static array
encounterMedium(string $column = 'label', bool $onlyActive = TRUE)

Get all the Encounter Medium.

static array
caseActivityType(bool $indexName = TRUE, bool $all = FALSE)

Get all Activity types for the CiviCase component.

Details

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()

Parameters

string $daoName
string $fieldName
array $params
  • name string name of the option group
  • flip boolean results are return in id => label format if false if true, the results are reversed
  • grouping boolean if true, return the value in 'grouping' column (currently unsupported for tables other than option_value)
  • localize boolean if true, localize the results before returning
  • condition string|array add condition(s) to the sql query - will be concatenated using 'AND'
  • keyColumn string the column to use for 'id'
  • labelColumn string the column to use for 'label'
  • orderColumn string the column to use for sorting, defaults to 'weight' column if one exists, else defaults to labelColumn
  • onlyActive boolean return only the action option values
  • fresh boolean ignore cache entries and go back to DB
string $context : Context string

Return Value

array|bool array on success, FALSE on error.

See also

http://wiki.civicrm.org/confluence/display/CRMDOC/Pseudoconstant+%28option+list%29+Reference NOTE: If someone undertakes a refactoring of this, please consider the use-case of the Setting.getoptions API. There is no DAO/field, but it would be nice to use the same 'pseudoconstant' struct in *.settings.php. This means loosening the coupling between $field lookup and the $pseudoconstant evaluation.

static bool|null|string getLabel(string $baoName, string $fieldName, string|Int $key)

Fetch the translated label for a field given its key.

Parameters

string $baoName
string $fieldName
string|Int $key TODO: Accept multivalued input?

Return Value

bool|null|string FALSE if the given field has no associated option list NULL if the given key has no corresponding option String if label is found

static bool|null|string getName(string $baoName, string $fieldName, string|Int $key)

Fetch the machine name for a field given its key.

Parameters

string $baoName
string $fieldName
string|Int $key

Return Value

bool|null|string FALSE if the given field has no associated option list NULL if the given key has no corresponding option String if label is found

static bool|null|string|int getKey(string $baoName, string $fieldName, string|Int $value)

Fetch the key for a field option given its name.

Parameters

string $baoName
string $fieldName
string|Int $value

Return Value

bool|null|string|int FALSE if the given field has no associated option list NULL if the given key has no corresponding option String|Number if key is found

static string|null getOptionEditUrl($fieldSpec)

Lookup the admin page at which a field's option list can be edited

Parameters

$fieldSpec

Return Value

string|null

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.

Parameters

array $var The associative array we will fill.
string $name The name of the DAO.
bool $all Get all objects. default is to get only active ones.
string $retrieve The field that we are interested in (normally name, differs in some objects).
string $filter The field that we want to filter the result set with.
string $condition The condition that gets passed to the final query as the WHERE clause.
bool $orderby
string $key
bool $force

Return Value

array

at line 209
static flush(bool|string $name = 'cache')

Flush given pseudoconstant so it can be reread from db next time it's requested.

Parameters

bool|string $name pseudoconstant to be flushed

static array activityType() deprecated

deprecated Please use the buildOptions() method in the appropriate BAO object. Get all Activty types. The static array activityType is returned

Return Value

array array reference of all activity types.

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.

Parameters

bool|int $id
  • Optional id to return
bool $limit

Return Value

array array reference of all State/Provinces.

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.

Parameters

bool|int $id
  • Optional id to return
bool $limit

Return Value

array array reference of all State/Province abbreviations.

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.

Parameters

bool|int $id
  • Optional id to return
bool $applyLimit

Return Value

array|null array reference of all countries.

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.

Parameters

bool $id

Return Value

array array reference of all country ISO codes.

static array allGroup(string $groupType = NULL, bool $excludeHidden = TRUE) deprecated

deprecated Please use the buildOptions() method in the appropriate BAO object. Get all 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.

Parameters

string $groupType Type of group(Access/Mailing).
bool $excludeHidden Exclude hidden groups.

Return Value

array array reference of all groups.

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.

Parameters

string $groupType Type of group(Access/Mailing).
bool $excludeHidden Exclude hidden groups.

Return Value

array array reference of all groups.

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.

Parameters

bool $checkPermissions
string|null $groupType
bool $excludeHidden

Return Value

array

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.

Parameters

bool $onlyPublic
null $groupType
bool $excludeHidden

Return Value

array array reference of all groups.

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.

Parameters

string $valueColumnName Db column name/label.
bool $reset Reset relationship types if true.
bool $isActive Filter by is_active. NULL to disable.

Return Value

array array reference of all relationship types.

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

Return Value

array array reference of all currency codes

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.

Parameters

bool|int $id
  • Optional id to return

Return Value

array array reference of all Counties

in CRM_Core_PseudoConstant at line 1378
static array paymentProcessor(bool $all = FALSE, bool $test = FALSE, null $additionalCond = NULL) deprecated

deprecated Please use the buildOptions() method in the appropriate BAO object. Get all active payment processors The static array paymentProcessor is returned

Parameters

bool $all Get payment processors - default is to get only active ones.
bool $test Get test payment processors.
null $additionalCond

Return Value

array array of all payment processors

in CRM_Core_PseudoConstant at line 1413
static array paymentProcessorType(bool $all = FALSE, int $id = NULL, string $return = 'title') deprecated

deprecated Please use the buildOptions() method in the appropriate BAO object. The static array paymentProcessorType is returned

Parameters

bool $all Get payment processors - default is to get only active ones.
int $id
string $return

Return Value

array array of all payment processor types

in CRM_Core_PseudoConstant at line 1433
static array worldRegion(bool $id = FALSE)

Get all the World Regions from Database.

Parameters

bool $id

Return Value

array array reference of all World Regions

in CRM_Core_PseudoConstant at line 1463
static array activityStatus(string $column = 'label') deprecated

deprecated Please use the buildOptions() method in the appropriate BAO object. Get all Activity Statuses. The static array activityStatus is returned

Parameters

string $column

Return Value

array array reference of all activity statuses

in CRM_Core_PseudoConstant at line 1489
static array visibility(string $column = 'label') deprecated

deprecated Please use the buildOptions() method in the appropriate BAO object. Get all Visibility levels. The static array visibility is returned

Parameters

string $column

Return Value

array array reference of all Visibility levels.

in CRM_Core_PseudoConstant at line 1507
static array stateProvinceForCountry(int $countryID, string $field = 'name')

Parameters

int $countryID
string $field

Return Value

array

in CRM_Core_PseudoConstant at line 1561
static array countyForState(int $stateID)

Parameters

int $stateID

Return Value

array

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

Parameters

int $stateID

Return Value

int|null the country id that the state belongs to

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

Parameters

$filter Get All Email Greetings - default is to get only active ones.
string $columnName

Return Value

array array reference of all greetings.

in CRM_Core_PseudoConstant at line 1698
static array greetingDefaults()

Construct array of default greeting values for contact type.

Return Value

array array reference of default greetings.

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.

Return Value

array array($fullyQualifiedName => $label) list of extensions

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

Parameters

bool $optionGroupName Get All Option Group values- default is to get only active ones.
int $id
null $condition

Return Value

array array reference of all Option Group Name

in CRM_Core_PseudoConstant at line 1786
static array getModuleExtensions(bool $fresh = FALSE)

Fetch the list of active extensions of type 'module'

Parameters

bool $fresh Whether to forcibly reload extensions list from canonical store.

Return Value

array array(array('prefix' => $, 'file' => $))

in CRM_Core_PseudoConstant at line 1799
static array getTaxRates()

Get all tax rates.

The static array tax rates is returned

Return Value

array array list of tax rates with the financial type

at line 57
static array caseStatus(string $column = 'label', bool $onlyActive = TRUE, null $condition = NULL, bool $fresh = FALSE)

Get all the case statues.

Parameters

string $column
bool $onlyActive
null $condition
bool $fresh

Return Value

array array reference of all case statues

at line 78
static array redactionRule(null $filter = NULL)

Get all the redaction rules.

Parameters

null $filter

Return Value

array array reference of all redaction rules

at line 100
static array caseType(string $column = 'title', bool $onlyActive = TRUE)

Get all the case type.

Parameters

string $column
bool $onlyActive

Return Value

array array reference of all case type

at line 133
static array encounterMedium(string $column = 'label', bool $onlyActive = TRUE)

Get all the Encounter Medium.

Parameters

string $column
bool $onlyActive

Return Value

array array reference of all Encounter Medium.

at line 155
static array caseActivityType(bool $indexName = TRUE, bool $all = FALSE)

Get all Activity types for the CiviCase component.

The static array activityType is returned

Parameters

bool $indexName True return activity name in array. key else activity id as array key.
bool $all

Return Value

array array reference of all activity types.