Merge pull request #2326 from eileenmcnaughton/CRM-14069
[civicrm-core.git] / CRM / Core / BAO / Setting.php
index 3f101c395cff1ddb40f34e13c580ba26c2744d69..98d88b0b2b9d92cda1f35897e7e5331cda6b6821 100644 (file)
@@ -67,7 +67,7 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting {
    *
    * @param string $group (required) The group name of the item
    * @param string $name (required) The name of the setting
-   * @param int $componentID The optional component ID (so componenets can share the same name space)
+   * @param int $componentID The optional component ID (so components can share the same name space)
    * @param int $contactID If set, this is a contactID specific setting, else its a global setting
    * @param bool|int $load if true, load from local cache (typically memcache)
    *
@@ -119,6 +119,15 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting {
     $globalCache->delete($cacheKey);
   }
 
+  /**
+   * @param $values
+   * @param $group
+   * @param null $componentID
+   * @param null $contactID
+   * @param null $domainID
+   *
+   * @return string
+   */
   static function setCache($values,
     $group,
     $componentID = NULL,
@@ -139,6 +148,15 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting {
     return $cacheKey;
   }
 
+  /**
+   * @param $group
+   * @param null $name
+   * @param null $componentID
+   * @param null $contactID
+   * @param null $domainID
+   *
+   * @return CRM_Core_DAO_Domain|CRM_Core_DAO_Setting
+   */
   static function dao($group,
     $name        = NULL,
     $componentID = NULL,
@@ -179,11 +197,12 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting {
    * Retrieve the value of a setting from the DB table
    *
    * @param string $group (required) The group name of the item
-   * @param string $name  (required) The name under which this item is stored
-   * @param int    $componentID The optional component ID (so componenets can share the same name space)
+   * @param string $name (required) The name under which this item is stored
+   * @param int $componentID The optional component ID (so componenets can share the same name space)
    * @param string $defaultValue The default value to return for this setting if not present in DB
-   * @param int    $contactID    If set, this is a contactID specific setting, else its a global setting
-
+   * @param int $contactID If set, this is a contactID specific setting, else its a global setting
+   *
+   * @param null $domainID
    *
    * @return object The data if present in the setting table, else null
    * @static
@@ -420,8 +439,11 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting {
    * _setItem() is the common logic shared by setItem() and setItems().
    *
    * @param array $params (required) An api formatted array of keys and values
+   * @param null $domains
+   *
+   * @throws api_Exception
    * @domains array an array of domains to get settings for. Default is the current domain
-   * @return void
+   * @return array
    * @static
    * @access public
    */
@@ -621,6 +643,11 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting {
    * @params string $name Name of specific setting e.g customCSSURL
    * @params integer $componentID id of relevant component.
    *
+   * @param null $componentID
+   * @param array $filters
+   * @param null $domainID
+   * @param null $profile
+   *
    * @return array $result - the following information as appropriate for each setting
    * - name
    * - type
@@ -801,6 +828,18 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting {
     }
   }
 
+  /**
+   * @param $group
+   * @param $name
+   * @param bool $system
+   * @param null $userID
+   * @param bool $localize
+   * @param string $returnField
+   * @param bool $returnNameANDLabels
+   * @param null $condition
+   *
+   * @return array
+   */
   static function valueOptions($group,
     $name,
     $system              = TRUE,
@@ -851,6 +890,14 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting {
     return ($returnNameANDLabels) ? $nameAndLabels : $returnValues;
   }
 
+  /**
+   * @param $group
+   * @param $name
+   * @param $value
+   * @param bool $system
+   * @param null $userID
+   * @param string $keyField
+   */
   static function setValueOption($group,
     $name,
     $value,
@@ -887,6 +934,10 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting {
     self::setItem($optionValue, $group, $name);
   }
 
+  /**
+   * @param $params
+   * @param null $domainID
+   */
   static function fixAndStoreDirAndURL(&$params, $domainID = NULL) {
     if (self::isUpgradeFromPreFourOneAlpha1()) {
       return;
@@ -958,6 +1009,10 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting {
     }
   }
 
+  /**
+   * @param $params
+   * @param $group
+   */
   static function storeDirectoryOrURLPreferences(&$params, $group) {
     foreach ($params as $name => $value) {
       // always try to store relative directory or url from CMS root
@@ -967,6 +1022,10 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting {
     }
   }
 
+  /**
+   * @param $params
+   * @param bool $setInConfig
+   */
   static function retrieveDirectoryAndURLPreferences(&$params, $setInConfig = FALSE) {
     if (CRM_Core_Config::isUpgradeMode()) {
       $isJoomla = (defined('CIVICRM_UF') && CIVICRM_UF == 'Joomla') ? TRUE : FALSE;