CRM_Core_OptionValue
in package
Tags
Table of Contents
Properties
- $_exportableFields : array<string|int, mixed>
- Static field for all the option value information that we can potentially export.
- $_fields : array<string|int, mixed>
- Static field for all the option value information that we can potentially export.
- $_importableFields : array<string|int, mixed>
- Static field for all the option value information that we can potentially export.
Methods
- addOptionValue() : CRM_Core_DAO_OptionValue
- Add/edit option-value of a particular group
- getFields() : array<string|int, mixed>
- Check if there is a record with the same name in the db.
- getRows() : array<string|int, mixed>
- Return option-values of a particular group
- getValues() : array<string|int, mixed>
- Return option-values of a particular group
- optionExists() : bool
- Check if there is a record with the same name in the db.
- select() : mixed
- Build select query in case of option-values
Properties
$_exportableFields
Static field for all the option value information that we can potentially export.
public
static array<string|int, mixed>
$_exportableFields
= \NULL
$_fields
Static field for all the option value information that we can potentially export.
public
static array<string|int, mixed>
$_fields
= \NULL
$_importableFields
Static field for all the option value information that we can potentially export.
public
static array<string|int, mixed>
$_importableFields
= \NULL
Methods
addOptionValue()
Add/edit option-value of a particular group
public
static addOptionValue(array<string|int, mixed> &$params, string $optionGroupName, mixed $action, int $optionValueID) : CRM_Core_DAO_OptionValue
Parameters
- $params : array<string|int, mixed>
-
Array containing exported values from the invoking form.
- $optionGroupName : string
-
Array containing group fields whose option-values is to retrieved/saved.
- $action : mixed
- $optionValueID : int
-
Has the id of the optionValue being edited, disabled ..etc. Has the id of the optionValue being edited, disabled ..etc.
Return values
CRM_Core_DAO_OptionValuegetFields()
Check if there is a record with the same name in the db.
public
static getFields([string $mode = '' ][, string $contactType = 'Individual' ]) : array<string|int, mixed>
Parameters
- $mode : string = ''
- $contactType : string = 'Individual'
Return values
array<string|int, mixed>getRows()
Return option-values of a particular group
public
static getRows(array<string|int, mixed> $groupParams, array<string|int, mixed> $links[, string $orderBy = 'weight' ][, bool $skipEmptyComponents = TRUE ]) : array<string|int, mixed>
Parameters
- $groupParams : array<string|int, mixed>
-
Array containing group fields whose option-values is to retrieved.
- $links : array<string|int, mixed>
-
Has links like edit, delete, disable ..etc.
- $orderBy : string = 'weight'
-
For orderBy clause.
- $skipEmptyComponents : bool = TRUE
-
Whether to skip OptionValue rows with empty Component name (i.e. when Extension providing the Component is disabled)
Return values
array<string|int, mixed> —Array of option-values
getValues()
Return option-values of a particular group
public
static getValues(array<string|int, mixed> $groupParams[, array<string|int, mixed> &$values = [] ][, string $orderBy = 'weight' ][, bool $isActive = FALSE ]) : array<string|int, mixed>
Parameters
- $groupParams : array<string|int, mixed>
-
Array containing group fields. whose option-values is to retrieved.
- $values : array<string|int, mixed> = []
-
(reference) to the array which. will have the values for the group
- $orderBy : string = 'weight'
-
For orderBy clause.
- $isActive : bool = FALSE
-
Do you want only active option values?
Return values
array<string|int, mixed> —Array of option-values
optionExists()
Check if there is a record with the same name in the db.
public
static optionExists(string $value, string $daoName, string $daoID, int $optionGroupID, string $fieldName, bool $domainSpecific) : bool
Parameters
- $value : string
-
The value of the field we are checking.
- $daoName : string
-
The dao object name.
- $daoID : string
-
The id of the object being updated. u can change your name. as long as there is no conflict
- $optionGroupID : int
- $fieldName : string
-
The name of the field in the DAO.
- $domainSpecific : bool
-
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 values
bool —true if object exists
select()
Build select query in case of option-values
public
static select(CRM_Contact_BAO_Query &$query) : mixed
Parameters
- $query : CRM_Contact_BAO_Query