Merge pull request #6262 from civicrm/revert-6186-CRM-16826
[civicrm-core.git] / xml / templates / listAll.tpl
index f302ac11638f43c981f571196d9f16a28c73c51f..ed843c7432c7a54dec4f5d1cd036a52aeb7fe510 100644 (file)
@@ -2,9 +2,9 @@
 
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.5                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014                                |
+ | Copyright CiviCRM LLC (c) 2004-2015                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -29,7 +29,7 @@
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2014
+ * @copyright CiviCRM LLC (c) 2004-2015
  * $Id$
  *
  */
@@ -38,8 +38,9 @@ class CRM_Core_DAO_AllCoreTables {ldelim}
 
   static private $tables = null;
   static private $daoToClass = null;
+  static private $entityTypes = null;
 
-  static private function init($fresh = FALSE) {ldelim}
+  static public function init($fresh = FALSE) {ldelim}
     static $init = FALSE;
     if ($init && !$fresh) return;
 
@@ -55,6 +56,7 @@ class CRM_Core_DAO_AllCoreTables {ldelim}
 
     CRM_Utils_Hook::entityTypes($entityTypes);
 
+    self::$entityTypes = array();
     self::$tables = array();
     self::$daoToClass = array();
     foreach ($entityTypes as $entityType) {ldelim}
@@ -64,9 +66,22 @@ class CRM_Core_DAO_AllCoreTables {ldelim}
     $init = TRUE;
   {rdelim}
 
-  static private function registerEntityType($daoName, $className, $tableName) {ldelim}
+  /**
+   * (Quasi-Private) Do not call externally (except for unit-testing)
+   */
+  static public function registerEntityType($daoName, $className, $tableName) {ldelim}
     self::$daoToClass[$daoName] = $className;
     self::$tables[$tableName] = $className;
+    self::$entityTypes[$className] = array(
+      'name' => $daoName,
+      'class' => $className,
+      'table' => $tableName,
+    );
+  {rdelim}
+
+  static public function get() {ldelim}
+    self::init();
+    return self::$entityTypes;
   {rdelim}
 
   static public function tables() {ldelim}