Merge pull request #4820 from kurund/CRM-15705
[civicrm-core.git] / CRM / Core / PseudoConstant.php
index 69e4be356d91e424f71792df7212a17c2c08bd0e..17c7c95332e2e3b0e30a05b6db358bd978c041f3 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.5                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
 class CRM_Core_PseudoConstant {
 
   /**
-   * static cache for pseudoconstant arrays
+   * Static cache for pseudoconstant arrays
    * @var array
    * @static
    */
   private static $cache;
 
   /**
-   * DEPRECATED. Please use the buildOptions() method in the appropriate BAO object.
+   * @deprecated Please use the buildOptions() method in the appropriate BAO object.
    *
    * activity type
    * @var array
@@ -66,42 +66,42 @@ class CRM_Core_PseudoConstant {
   private static $activityType;
 
   /**
-   * states, provinces
+   * States, provinces
    * @var array
    * @static
    */
   private static $stateProvince;
 
   /**
-   * counties
+   * Counties
    * @var array
    * @static
    */
   private static $county;
 
   /**
-   * states/provinces abbreviations
+   * States/provinces abbreviations
    * @var array
    * @static
    */
   private static $stateProvinceAbbreviation;
 
   /**
-   * country
+   * Country
    * @var array
    * @static
    */
   private static $country;
 
   /**
-   * countryIsoCode
+   * CountryIsoCode
    * @var array
    * @static
    */
   private static $countryIsoCode;
 
   /**
-   * DEPRECATED. Please use the buildOptions() method in the appropriate BAO object.
+   * @deprecated Please use the buildOptions() method in the appropriate BAO object.
    *
    * group
    * @var array
@@ -110,42 +110,42 @@ class CRM_Core_PseudoConstant {
   private static $group;
 
   /**
-   * groupIterator
+   * GroupIterator
    * @var mixed
    * @static
    */
   private static $groupIterator;
 
   /**
-   * relationshipType
+   * RelationshipType
    * @var array
    * @static
    */
   private static $relationshipType;
 
   /**
-   * civicrm groups that are not smart groups
+   * Civicrm groups that are not smart groups
    * @var array
    * @static
    */
   private static $staticGroup;
 
   /**
-   * currency codes
+   * Currency codes
    * @var array
    * @static
    */
   private static $currencyCode;
 
   /**
-   * payment processor
+   * Payment processor
    * @var array
    * @static
    */
   private static $paymentProcessor;
 
   /**
-   * payment processor types
+   * Payment processor types
    * @var array
    * @static
    */
@@ -159,7 +159,7 @@ class CRM_Core_PseudoConstant {
   private static $worldRegions;
 
   /**
-   * DEPRECATED. Please use the buildOptions() method in the appropriate BAO object.
+   * @deprecated Please use the buildOptions() method in the appropriate BAO object.
    *
    * activity status
    * @var array
@@ -454,7 +454,7 @@ class CRM_Core_PseudoConstant {
    *   NULL if the given key has no corresponding option
    *   String if label is found
    */
-  static function getLabel($baoName, $fieldName, $key) {
+  public static function getLabel($baoName, $fieldName, $key) {
     $values = $baoName::buildOptions($fieldName, 'get');
     if ($values === FALSE) {
       return FALSE;
@@ -474,7 +474,7 @@ class CRM_Core_PseudoConstant {
    *   NULL if the given key has no corresponding option
    *   String if label is found
    */
-  static function getName($baoName, $fieldName, $key) {
+  public static function getName($baoName, $fieldName, $key) {
     $values = $baoName::buildOptions($fieldName, 'validate');
     if ($values === FALSE) {
       return FALSE;
@@ -494,7 +494,7 @@ class CRM_Core_PseudoConstant {
    *   NULL if the given key has no corresponding option
    *   String|Number if key is found
    */
-  static function getKey($baoName, $fieldName, $value) {
+  public static function getKey($baoName, $fieldName, $value) {
     $values = $baoName::buildOptions($fieldName, 'validate');
     if ($values === FALSE) {
       return FALSE;
@@ -507,7 +507,7 @@ class CRM_Core_PseudoConstant {
    * @param $fieldSpec
    * @return string|null
    */
-  static function getOptionEditUrl($fieldSpec) {
+  public static function getOptionEditUrl($fieldSpec) {
     // If it's an option group, that's easy
     if (!empty($fieldSpec['pseudoconstant']['optionGroupName'])) {
       return 'civicrm/admin/options/' . $fieldSpec['pseudoconstant']['optionGroupName'];
@@ -531,7 +531,7 @@ class CRM_Core_PseudoConstant {
 
   /**
    * DEPRECATED generic populate method
-   * All pseudoconstant functions that use this method are also deprecated.
+   * All pseudoconstant functions that use this method are also @deprecated
    *
    * The static array $var is populated from the db
    * using the <b>$name DAO</b>.
@@ -550,7 +550,6 @@ class CRM_Core_PseudoConstant {
    * @param null $force
    *
    * @return void
-   * @access public
    * @static
    */
   public static function populate(
@@ -603,7 +602,6 @@ class CRM_Core_PseudoConstant {
    * Flush given pseudoconstant so it can be reread from db
    * nex time it's requested.
    *
-   * @access public
    * @static
    *
    * @param bool|string $name pseudoconstant to be flushed
@@ -618,15 +616,12 @@ class CRM_Core_PseudoConstant {
   }
 
   /**
-   * DEPRECATED. Please use the buildOptions() method in the appropriate BAO object.
+   * @deprecated Please use the buildOptions() method in the appropriate BAO object.
    *
    * Get all Activty types.
    *
    * The static array activityType is returned
    *
-   * @internal param bool $all - get All Activity  types - default is to get only active ones.
-   *
-   * @access public
    * @static
    *
    * @return array - array reference of all activity types.
@@ -701,7 +696,6 @@ class CRM_Core_PseudoConstant {
    *
    * Note: any database errors will be trapped by the DAO.
    *
-   * @access public
    * @static
    *
    * @param bool|int $id -  Optional id to return
@@ -757,7 +751,6 @@ class CRM_Core_PseudoConstant {
    *
    * Same as above, except gets the abbreviations instead of the names.
    *
-   * @access public
    * @static
    *
    * @param bool|int $id -     Optional id to return
@@ -825,7 +818,6 @@ WHERE  id = %1";
    *
    * Note: any database errors will be trapped by the DAO.
    *
-   * @access public
    * @static
    *
    * @param bool|int $id - Optional id to return
@@ -903,7 +895,6 @@ WHERE  id = %1";
    *
    * Note: any database errors will be trapped by the DAO.
    *
-   * @access public
    * @static
    *
    * @param bool $id
@@ -926,7 +917,7 @@ WHERE  id = %1";
   }
 
   /**
-   * DEPRECATED. Please use the buildOptions() method in the appropriate BAO object.
+   * @deprecated Please use the buildOptions() method in the appropriate BAO object.
    *
    * Get all groups from database
    *
@@ -937,9 +928,8 @@ WHERE  id = %1";
    * Note: any database errors will be trapped by the DAO.
    *
    * @param string $groupType type of group(Access/Mailing)
-   * @param bool|\boolen $excludeHidden exclude hidden groups.
+   * @param bool $excludeHidden exclude hidden groups.
    *
-   * @access public
    * @static
    *
    * @return array - array reference of all groups.
@@ -968,7 +958,6 @@ WHERE  id = %1";
    * called for the first time
    *
    *
-   * @access public
    * @static
    *
    * @param bool $styledLabels
@@ -998,7 +987,6 @@ WHERE  id = %1";
    * @param string $groupType type of group(Access/Mailing)
    * @param bool $excludeHidden exclude hidden groups.
    *
-   * @access public
    * @static
    *
    * @return array - array reference of all groups.
@@ -1028,7 +1016,6 @@ WHERE  id = %1";
    *
    * Note: any database errors will be trapped by the DAO.
    *
-   * @access public
    * @static
    *
    * @param bool $onlyPublic
@@ -1070,7 +1057,6 @@ WHERE  id = %1";
    * @param string $valueColumnName db column name/label.
    * @param boolean $reset          reset relationship types if true
    *
-   * @access public
    * @static
    *
    * @return array - array reference of all relationship types.
@@ -1106,11 +1092,10 @@ WHERE  id = %1";
   }
 
   /**
-   * get all the ISO 4217 currency codes
+   * Get all the ISO 4217 currency codes
    *
    * so far, we use this for validation only, so there's no point of putting this into the database
    *
-   * @access public
    *
    * @return array - array reference of all currency codes
    * @static
@@ -1399,7 +1384,6 @@ WHERE  id = %1";
    *
    * Note: any database errors will be trapped by the DAO.
    *
-   * @access public
    * @static
    *
    * @param bool|int $id -  Optional id to return
@@ -1425,12 +1409,11 @@ WHERE  id = %1";
   }
 
   /**
-   * DEPRECATED. Please use the buildOptions() method in the appropriate BAO object.
+   * @deprecated Please use the buildOptions() method in the appropriate BAO object.
    * Get all active payment processors
    *
    * The static array paymentProcessor is returned
    *
-   * @access public
    * @static
    *
    * @param boolean $all - get payment processors     - default is to get only active ones.
@@ -1461,16 +1444,15 @@ WHERE  id = %1";
   }
 
   /**
-   * DEPRECATED. Please use the buildOptions() method in the appropriate BAO object.
+   * @deprecated Please use the buildOptions() method in the appropriate BAO object.
    *
    * The static array paymentProcessorType is returned
    *
-   * @access public
    * @static
    *
    * @param boolean $all - get payment processors     - default is to get only active ones.
    *
-   * @param null $id
+   * @param int $id
    * @param string $return
    *
    * @return array - array of all payment processor types
@@ -1489,7 +1471,6 @@ WHERE  id = %1";
   /**
    * Get all the World Regions from Database
    *
-   * @access public
    *
    * @param bool $id
    *
@@ -1514,13 +1495,12 @@ WHERE  id = %1";
   }
 
   /**
-   * DEPRECATED. Please use the buildOptions() method in the appropriate BAO object.
+   * @deprecated Please use the buildOptions() method in the appropriate BAO object.
    *
    * Get all Activity Statuses.
    *
    * The static array activityStatus is returned
    *
-   * @access public
    * @static
    *
    * @param string $column
@@ -1541,13 +1521,12 @@ WHERE  id = %1";
   }
 
   /**
-   * DEPRECATED. Please use the buildOptions() method in the appropriate BAO object.
+   * @deprecated Please use the buildOptions() method in the appropriate BAO object.
    *
    * Get all Visibility levels.
    *
    * The static array visibility is returned
    *
-   * @access public
    * @static
    *
    * @param string $column
@@ -1567,7 +1546,7 @@ WHERE  id = %1";
   }
 
   /**
-   * @param $countryID
+   * @param int $countryID
    * @param string $field
    *
    * @return array
@@ -1622,7 +1601,7 @@ ORDER BY name";
   }
 
   /**
-   * @param $stateID
+   * @param int $stateID
    *
    * @return array
    */
@@ -1687,9 +1666,8 @@ ORDER BY name";
    *
    * @return int the country id that the state belongs to
    * @static
-   * @public
    */
-  static function countryIDForStateID($stateID) {
+  public static function countryIDForStateID($stateID) {
     if (empty($stateID)) {
       return CRM_Core_DAO::$_nullObject;
     }
@@ -1709,7 +1687,6 @@ WHERE  id = %1
    *
    * The static array of greeting is returned
    *
-   * @access public
    * @static
    *
    * @param $filter - get All Email Greetings - default is to get only active ones.
@@ -1760,7 +1737,6 @@ WHERE  id = %1
   /**
    * Construct array of default greeting values for contact type
    *
-   * @access public
    * @static
    *
    * @return array - array reference of default greetings.
@@ -1794,7 +1770,6 @@ WHERE  id = %1
    * FIXME: This is called by civix but not by any core code. We
    * should provide an API call which civix can use instead.
    *
-   * @access public
    * @static
    *
    * @return array - array($fullyQualifiedName => $label) list of extensions
@@ -1821,12 +1796,11 @@ WHERE  id = %1
    *
    * The static array option values is returned
    *
-   * @access public
    * @static
    *
    * @param boolean $optionGroupName - get All  Option Group values- default is to get only active ones.
    *
-   * @param null $id
+   * @param int $id
    * @param null $condition
    *
    * @return array - array reference of all Option Group Name
@@ -1847,7 +1821,6 @@ WHERE  id = %1
    * Fetch the list of active extensions of type 'module'
    *
    * @param $fresh bool whether to forcibly reload extensions list from canonical store
-   * @access public
    * @static
    *
    * @return array - array(array('prefix' => $, 'file' => $))
@@ -1862,7 +1835,6 @@ WHERE  id = %1
    *
    * The static array tax rates is returned
    *
-   * @access public
    * @static
    *
    * @return array - array list of tax rates with the financial type
@@ -1889,4 +1861,3 @@ WHERE  id = %1
     return self::$taxRates;
   }
 }
-