static $_values = array();
static $_cache = array();
- /*
+ /**
* $_domainIDGroups array maintains the list of option groups for whom
* domainID is to be considered.
- *
*/
static $_domainIDGroups = array(
'from_email_address',
* @param string $keyColumnName
* the column to use for 'key'.
*
- * @return array the values as specified by the above params
- * @static
+ * @return array
+ * the values as specified by the above params
* @void
*/
static function &values(
* @param bool $onlyActive
* @param bool $fresh
*
- * @return array of values as specified by the above params
- * @static
+ * @return array
+ * Array of values as specified by the above params
* @void
*/
public static function &valuesByID($id, $flip = FALSE, $grouping = FALSE, $localize = FALSE, $labelColumnName = 'label', $onlyActive = TRUE, $fresh = FALSE) {
*
* @return void
*
- * @static
*/
public static function lookupValues(&$params, &$names, $flip = FALSE) {
foreach ($names as $postName => $value) {
}
if ($flip) {
- $p = array(1 => array($postValue, 'String'));
+ $p = array(1 => array($postValue, 'String'));
$lookupBy = 'v.label= %1';
- $select = "v.value";
+ $select = "v.value";
}
else {
- $p = array(1 => array($postValue, 'Integer'));
+ $p = array(1 => array($postValue, 'Integer'));
$lookupBy = 'v.value = %1';
- $select = "v.label";
+ $select = "v.label";
}
$p[2] = array($value['groupName'], 'String');
$query .= " AND v.is_active = 1 ";
}
$p = array(
- 1 => array($groupName, 'String'),
+ 1 => array($groupName, 'String'),
2 => array($value, 'Integer'),
);
$dao = CRM_Core_DAO::executeQuery($query, $p);
";
$p = array(
- 1 => array($groupName, 'String'),
+ 1 => array($groupName, 'String'),
2 => array($label, $labelType),
);
$dao = CRM_Core_DAO::executeQuery($query, $p);
* @param string $groupName
* The name of the option group.
*
- * @static
*
- * @return string the value from the row where is_default = true
+ * @return string
+ * the value from the row where is_default = true
*/
public static function getDefaultValue($groupName) {
if (empty($groupName)) {
* @param null $groupTitle
* The optional label of the option group else set to group name.
*
- * @static
*
- * @return int the option group ID
+ * @return int
+ * the option group ID
*/
public static function createAssoc($groupName, &$values, &$defaultID, $groupTitle = NULL) {
self::deleteAssoc($groupName);
if (!empty($values)) {
- $group = new CRM_Core_DAO_OptionGroup();
- $group->name = $groupName;
- $group->title = empty($groupTitle) ? $groupName : $groupTitle;
+ $group = new CRM_Core_DAO_OptionGroup();
+ $group->name = $groupName;
+ $group->title = empty($groupTitle) ? $groupName : $groupTitle;
$group->is_reserved = 1;
- $group->is_active = 1;
+ $group->is_active = 1;
$group->save();
foreach ($values as $v) {
AND g.name = %1
AND v.value = %2";
$params = array(
- 1 => array($groupName, 'String'),
+ 1 => array($groupName, 'String'),
2 => array($value, 'String'),
);
return CRM_Core_DAO::singleValueQuery($query, $params);
}
$p = array(
- 1 => array($groupName, 'String'),
+ 1 => array($groupName, 'String'),
2 => array($fieldValue, $fieldType),
);
$dao = CRM_Core_DAO::executeQuery($query, $p);
if ($dao->fetch()) {
foreach (array(
- 'id', 'name', 'value', 'label', 'weight', 'description') as $fld) {
+ 'id',
+ 'name',
+ 'value',
+ 'label',
+ 'weight',
+ 'description'
+ ) as $fld) {
$row[$fld] = $dao->$fld;
}
}
return $row;
}
- /*
+ /**
* Wrapper for calling values with fresh set to true to empty the given value
*
* Since there appears to be some inconsistency
* (for example CRM_Contribution_Pseudoconstant::paymentInstrument doesn't specify isActive
* which is part of the cache key
* will do a couple of variations & aspire to someone cleaning it up later
- */
- /**
- * @param $name
+ *
+ * @param string $name
* @param array $params
*/
public static function flush($name, $params = array()) {