class CRM_Core_OptionValue

Properties

static array $_exportableFields Static field for all the option value information that we can potentially export.
static array $_importableFields Static field for all the option value information that we can potentially export.
static array $_fields Static field for all the option value information that we can potentially export.

Methods

static array
getRows(array $groupParams, array $links, string $orderBy = 'weight', bool $skipEmptyComponents = TRUE)

Return option-values of a particular group

addOptionValue(array $params, array $groupParams, $action, int $optionValueID)

Add/edit option-value of a particular group

static bool
optionExists(string $value, string $daoName, string $daoID, int $optionGroupID, string $fieldName = 'name', bool $domainSpecific)

Check if there is a record with the same name in the db.

static array
getFields(string $mode = '', string $contactType = 'Individual')

Check if there is a record with the same name in the db.

static 
select($query)

Build select query in case of option-values

static array
getValues(array $groupParams, array $values, string $orderBy = 'weight', bool $isActive = FALSE)

Return option-values of a particular group

Details

at line 73
static array getRows(array $groupParams, array $links, string $orderBy = 'weight', bool $skipEmptyComponents = TRUE)

Return option-values of a particular group

Parameters

array $groupParams Array containing group fields whose option-values is to retrieved.
array $links Has links like edit, delete, disable ..etc.
string $orderBy For orderBy clause.
bool $skipEmptyComponents Whether to skip OptionValue rows with empty Component name (i.e. when Extension providing the Component is disabled)

Return Value

array Array of option-values

at line 194
static CRM_Core_DAO_OptionValue addOptionValue(array $params, array $groupParams, $action, int $optionValueID)

Add/edit option-value of a particular group

Parameters

array $params Array containing exported values from the invoking form.
array $groupParams Array containing group fields whose option-values is to retrieved/saved.
$action
int $optionValueID Has the id of the optionValue being edited, disabled ..etc. Has the id of the optionValue being edited, disabled ..etc.

Return Value

CRM_Core_DAO_OptionValue

at line 271
static bool optionExists(string $value, string $daoName, string $daoID, int $optionGroupID, string $fieldName = 'name', bool $domainSpecific)

Check if there is a record with the same name in the db.

Parameters

string $value The value of the field we are checking.
string $daoName The dao object name.
string $daoID The id of the object being updated. u can change your name. as long as there is no conflict
int $optionGroupID
string $fieldName The name of the field in the DAO.
bool $domainSpecific Filter this check to the current domain. Some optionGroups allow for same labels or same names but they must be in different domains, so filter the check to the current domain.

Return Value

bool true if object exists

at line 296
static array getFields(string $mode = '', string $contactType = 'Individual')

Check if there is a record with the same name in the db.

Parameters

string $mode
string $contactType

Return Value

array

at line 373
static select($query)

Build select query in case of option-values

Parameters

$query

at line 410
static array getValues(array $groupParams, array $values, string $orderBy = 'weight', bool $isActive = FALSE)

Return option-values of a particular group

Parameters

array $groupParams Array containing group fields. whose option-values is to retrieved.
array $values (reference) to the array which. will have the values for the group
string $orderBy For orderBy clause.
bool $isActive Do you want only active option values?

Return Value

array Array of option-values