<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
/**
* Utilities for manipulating/inspecting CRM_*_PseudoConstant classes
*/
class CRM_Utils_PseudoConstant {
- /*
- * CiviCRM pseudoconstant classes for wrapper functions
+ /**
+ * CiviCRM pseudoconstant classes for wrapper functions.
*/
private static $constantClasses = array(
'CRM_Core_PseudoConstant',
private static $constants = NULL;
/**
- * Get constant
+ * Get constant.
*
* Wrapper for Pseudoconstant methods. We use this so the calling function
* doesn't need to know which class the Pseudoconstant is on
* (some are on the Contribute_Pseudoconsant Class etc
*
- * @access public
- * @static
*
* @param $constant
*
- * @return array - array reference of all relevant constant
+ * @return array
+ * array reference of all relevant constant
*/
public static function getConstant($constant) {
$class = self::findConstantClass($constant);
}
/**
- * Flush constant
+ * Flush constant.
*
* Wrapper for Pseudoconstant methods. We use this so the calling function
* doesn't need to know which class the Pseudoconstant is on
* (some are on the Contribute_Pseudoconsant Class etc
*
- * @access public
- * @static
*
* @param $constant
*
- * @return array - array reference of all relevant constant
+ * @return array
+ * array reference of all relevant constant
*/
public static function flushConstant($constant) {
$class = self::findConstantClass($constant);
}
/**
- * Determine where a constant lives
+ * Determine where a constant lives.
*
* If there's a full, preloaded map, use it. Otherwise, use search
* class space.
*
- * @param $constant
+ * @param string $constant
+ * Constant-name.
*
- * @internal param string $name constant-name
- * @return string|NULL class-name
+ * @return string|NULL
+ * class-name
*/
public static function findConstantClass($constant) {
if (self::$constants !== NULL && isset(self::$constants[$constant])) {
*
* This may be inefficient and should generally be avoided.
*
- * @return array of string, constant names
+ * @return array
+ * Array of string, constant names
*/
public static function findConstants() {
if (self::$constants === NULL) {
*
* @param $class
*
- * @return array of string, constant names
+ * @return array
+ * Array of string, constant names
*/
public static function findConstantsByClass($class) {
$clazz = new ReflectionClass($class);
}
CRM_Core_PseudoConstant::flush();
}
+
}