-- CRM-15475, changed Cancelled mmebership status to reserved
[civicrm-core.git] / xml / templates / listAll.tpl
index f64a05832578e9bbba0feb817cf40eeb07bc5b90..f302ac11638f43c981f571196d9f16a28c73c51f 100644 (file)
@@ -2,9 +2,9 @@
 
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.3                                                |
+ | CiviCRM version 4.5                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013                                |
+ | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -29,7 +29,7 @@
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
  * $Id$
  *
  */
@@ -39,9 +39,9 @@ class CRM_Core_DAO_AllCoreTables {ldelim}
   static private $tables = null;
   static private $daoToClass = null;
 
-  static private function init() {ldelim}
+  static private function init($fresh = FALSE) {ldelim}
     static $init = FALSE;
-    if ($init) return;
+    if ($init && !$fresh) return;
 
     $entityTypes = array(
 {foreach from=$tables key=tableName item=table}
@@ -87,6 +87,10 @@ class CRM_Core_DAO_AllCoreTables {ldelim}
     return FALSE !== array_search($tableName, self::tables());
   {rdelim}
 
+  static public function getCanonicalClassName($className) {ldelim}
+    return str_replace('_BAO_', '_DAO_', $className);
+  {rdelim}
+
   static public function getClasses() {ldelim}
     return array_values(self::daoToClass());
   {rdelim}
@@ -103,4 +107,16 @@ class CRM_Core_DAO_AllCoreTables {ldelim}
     return CRM_Utils_Array::value($className, array_flip(self::daoToClass()));
   {rdelim}
 
+  /**
+   * @param string $className DAO or BAO name
+   * @return string|FALSE SQL table name
+   */
+  static public function getTableForClass($className) {ldelim}
+    return array_search(self::getCanonicalClassName($className), self::tables());
+  {rdelim}
+
+  static public function reinitializeCache($fresh = FALSE) {ldelim}
+    self::init($fresh);
+  {rdelim}
+
 {rdelim}