class CRM_Utils_PseudoConstant

Utilities for manipulating/inspecting CRM_*_PseudoConstant classes.

Methods

static array
getConstant(string $constant)

Get constant.

static array
flushConstant($constant)

Flush constant.

static string|NULL
findConstantClass(string $constant)

Determine where a constant lives.

static array
findConstants()

Scan for a list of pseudo-constants. A pseudo-constant is recognized by listing any static properties which have corresponding static methods.

static array
findConstantsByClass($class)

Scan for a list of pseudo-constants. A pseudo-constant is recognized by listing any static properties which have corresponding static methods.

static 
flushAll()

Flush all caches related to pseudo-constants.

Details

at line 66
static array getConstant(string $constant)

Get constant.

Wrapper for Pseudoconstant methods. We use this so the calling function doesn't need to know which class the Pseudoconstant is on (some are on the Contribute_Pseudoconstant Class etc

Parameters

string $constant

Return Value

array array reference of all relevant constant

at line 86
static array flushConstant($constant)

Flush constant.

Wrapper for Pseudoconstant methods. We use this so the calling function doesn't need to know which class the Pseudoconstant is on (some are on the Contribute_Pseudoconsant Class etc

Parameters

$constant

Return Value

array array reference of all relevant constant

at line 110
static string|NULL findConstantClass(string $constant)

Determine where a constant lives.

If there's a full, preloaded map, use it. Otherwise, use search class space.

Parameters

string $constant Constant-name.

Return Value

string|NULL class-name

at line 131
static array findConstants()

Scan for a list of pseudo-constants. A pseudo-constant is recognized by listing any static properties which have corresponding static methods.

This may be inefficient and should generally be avoided.

Return Value

array Array of string, constant names

at line 154
static array findConstantsByClass($class)

Scan for a list of pseudo-constants. A pseudo-constant is recognized by listing any static properties which have corresponding static methods.

This may be inefficient and should generally be avoided.

Parameters

$class

Return Value

array Array of string, constant names

at line 168
static flushAll()

Flush all caches related to pseudo-constants.

This may be inefficient and should generally be avoided.