/**
* Static cache for pseudoconstant arrays
* @var array
- * @static
*/
private static $cache;
*
* activity type
* @var array
- * @static
*/
private static $activityType;
/**
* States, provinces
* @var array
- * @static
*/
private static $stateProvince;
/**
* Counties
* @var array
- * @static
*/
private static $county;
/**
* States/provinces abbreviations
* @var array
- * @static
*/
private static $stateProvinceAbbreviation;
/**
* Country
* @var array
- * @static
*/
private static $country;
/**
* CountryIsoCode
* @var array
- * @static
*/
private static $countryIsoCode;
*
* group
* @var array
- * @static
*/
private static $group;
/**
* GroupIterator
* @var mixed
- * @static
*/
private static $groupIterator;
/**
* RelationshipType
* @var array
- * @static
*/
private static $relationshipType;
/**
* Civicrm groups that are not smart groups
* @var array
- * @static
*/
private static $staticGroup;
/**
* Currency codes
* @var array
- * @static
*/
private static $currencyCode;
/**
* Payment processor
* @var array
- * @static
*/
private static $paymentProcessor;
/**
* Payment processor types
* @var array
- * @static
*/
private static $paymentProcessorType;
/**
* World Region
* @var array
- * @static
*/
private static $worldRegions;
*
* activity status
* @var array
- * @static
*/
private static $activityStatus;
/**
* Visibility
* @var array
- * @static
*/
private static $visibility;
/**
* Greetings
* @var array
- * @static
*/
private static $greeting;
/**
* Default Greetings
* @var array
- * @static
*/
private static $greetingDefaults;
/**
* Extensions of type module
* @var array
- * @static
*/
private static $extensions;
/**
* Financial Account Type
* @var array
- * @static
*/
private static $accountOptionValues;
/**
* Tax Rates
* @var array
- * @static
*/
private static $taxRates;
* - 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
- * @param string $context: Context string
+ * @param string $context : Context string
*
- * @return Array|bool - array on success, FALSE on error.
+ * @return Array|bool
+ * array on success, FALSE on error.
*
- * @static
*/
public static function get($daoName, $fieldName, $params = array(), $context = NULL) {
CRM_Core_DAO::buildOptionsContext($context);
$wheres[] = 'domain_id = ' . CRM_Core_Config::domainID();
}
$queryParams = array(
- 1 => array($params['keyColumn'], 'String', CRM_Core_DAO::QUERY_FORMAT_NO_QUOTES),
- 2 => array($params['labelColumn'], 'String', CRM_Core_DAO::QUERY_FORMAT_NO_QUOTES),
- 3 => array($pseudoconstant['table'], 'String', CRM_Core_DAO::QUERY_FORMAT_NO_QUOTES),
+ 1 => array($params['keyColumn'], 'String', CRM_Core_DAO::QUERY_FORMAT_NO_QUOTES),
+ 2 => array($params['labelColumn'], 'String', CRM_Core_DAO::QUERY_FORMAT_NO_QUOTES),
+ 3 => array($pseudoconstant['table'], 'String', CRM_Core_DAO::QUERY_FORMAT_NO_QUOTES),
);
// Add orderColumn param
if (!empty($params['orderColumn'])) {
* @param null $force
*
* @return void
- * @static
*/
public static function populate(
&$var,
$force = NULL
) {
$cacheKey = "CRM_PC_{$name}_{$all}_{$key}_{$retrieve}_{$filter}_{$condition}_{$orderby}";
- $cache = CRM_Utils_Cache::singleton();
- $var = $cache->get($cacheKey);
+ $cache = CRM_Utils_Cache::singleton();
+ $var = $cache->get($cacheKey);
if ($var && empty($force)) {
return $var;
}
* Flush given pseudoconstant so it can be reread from db
* nex time it's requested.
*
- * @static
*
* @param bool|string $name pseudoconstant to be flushed
*/
*
* The static array activityType is returned
*
- * @static
*
* @return array
* array reference of all activity types.
*
* Note: any database errors will be trapped by the DAO.
*
- * @static
*
* @param bool|int $id - Optional id to return
*
$config = CRM_Core_Config::singleton();
if ($limit) {
$countryIsoCodes = self::countryIsoCode();
- $limitCodes = $config->provinceLimit();
- $limitIds = array();
+ $limitCodes = $config->provinceLimit();
+ $limitIds = array();
foreach ($limitCodes as $code) {
$limitIds = array_merge($limitIds, array_keys($countryIsoCodes, $code));
}
if ($tsLocale != '' and $tsLocale != 'en_US') {
$i18n = CRM_Core_I18n::singleton();
$i18n->localizeArray(self::$stateProvince, array(
- 'context' => 'province',
- ));
+ 'context' => 'province',
+ ));
self::$stateProvince = CRM_Utils_Array::asort(self::$stateProvince);
}
}
*
* Same as above, except gets the abbreviations instead of the names.
*
- * @static
*
* @param bool|int $id - Optional id to return
*
$whereClause = FALSE;
if ($limit) {
- $config = CRM_Core_Config::singleton();
+ $config = CRM_Core_Config::singleton();
$countryIsoCodes = self::countryIsoCode();
- $limitCodes = $config->provinceLimit();
- $limitIds = array();
+ $limitCodes = $config->provinceLimit();
+ $limitIds = array();
foreach ($limitCodes as $code) {
$tmpArray = array_keys($countryIsoCodes, $code);
*
* Note: any database errors will be trapped by the DAO.
*
- * @static
*
* @param bool|int $id - Optional id to return
*
if ($tsLocale != '' and $tsLocale != 'en_US') {
$i18n = CRM_Core_I18n::singleton();
$i18n->localizeArray(self::$country, array(
- 'context' => 'country',
- ));
+ 'context' => 'country',
+ ));
self::$country = CRM_Utils_Array::asort(self::$country);
}
}
*
* Note: any database errors will be trapped by the DAO.
*
- * @static
*
* @param bool $id
*
* @param bool $excludeHidden
* Exclude hidden groups.
*
- * @static
*
* @return array
* array reference of all groups.
* called for the first time
*
*
- * @static
*
* @param bool $styledLabels
*
- * @return mixed - instance of CRM_Contact_BAO_GroupNesting
+ * @return CRM_Contact_BAO_GroupNesting
*/
public static function &groupIterator($styledLabels = FALSE) {
if (!self::$groupIterator) {
- /*
- When used as an object, GroupNesting implements Iterator
- and iterates nested groups in a logical manner for us
- */
+ // When used as an object, GroupNesting implements Iterator
+ // and iterates nested groups in a logical manner for us
self::$groupIterator = new CRM_Contact_BAO_GroupNesting($styledLabels);
}
return self::$groupIterator;
* @param bool $excludeHidden
* Exclude hidden groups.
*
- * @static
*
* @return array
* array reference of all groups.
*
* Note: any database errors will be trapped by the DAO.
*
- * @static
*
* @param bool $onlyPublic
* @param null $groupType
* @param bool $reset
* Reset relationship types if true.
*
- * @static
*
* @return array
* array reference of all relationship types.
*
* @return array
* array reference of all currency codes
- * @static
*/
public static function ¤cyCode() {
if (!self::$currencyCode) {
*
* Note: any database errors will be trapped by the DAO.
*
- * @static
*
* @param bool|int $id - Optional id to return
*
*
* The static array paymentProcessor is returned
*
- * @static
*
* @param bool $all
* Get payment processors - default is to get only active ones.
*
* The static array paymentProcessorType is returned
*
- * @static
*
* @param bool $all
* Get payment processors - default is to get only active ones.
*
* @return array
* array reference of all World Regions
- * @static
*/
public static function &worldRegion($id = FALSE) {
if (!self::$worldRegions) {
*
* The static array activityStatus is returned
*
- * @static
*
* @param string $column
*
*
* The static array visibility is returned
*
- * @static
*
* @param string $column
*
*
* @return int
* the country id that the state belongs to
- * @static
*/
public static function countryIDForStateID($stateID) {
if (empty($stateID)) {
*
* The static array of greeting is returned
*
- * @static
*
* @param $filter
* Get All Email Greetings - default is to get only active ones.
/**
* Construct array of default greeting values for contact type
*
- * @static
*
* @return array
* array reference of default greetings.
public static function &greetingDefaults() {
if (!self::$greetingDefaults) {
$defaultGreetings = array();
- $contactTypes = self::get('CRM_Contact_DAO_Contact', 'contact_type', array('keyColumn' => 'id', 'labelColumn' => 'name'));
+ $contactTypes = self::get('CRM_Contact_DAO_Contact', 'contact_type', array(
+ 'keyColumn' => 'id',
+ 'labelColumn' => 'name'
+ ));
foreach ($contactTypes as $filter => $contactType) {
$filterCondition = " AND (v.filter = 0 OR v.filter = $filter) AND v.is_default = 1 ";
* FIXME: This is called by civix but not by any core code. We
* should provide an API call which civix can use instead.
*
- * @static
*
* @return array
* array($fullyQualifiedName => $label) list of extensions
*
* The static array option values is returned
*
- * @static
*
* @param bool $optionGroupName
* Get All Option Group values- default is to get only active ones.
*
* @param bool $fresh
* Whether to forcibly reload extensions list from canonical store.
- * @static
*
* @return array
* array(array('prefix' => $, 'file' => $))
*
* The static array tax rates is returned
*
- * @static
- *
* @return array
* array list of tax rates with the financial type
*/