From 3c6315b1e53988130d5419fa2908696fc816aa0b Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Mon, 9 Feb 2015 07:13:23 -0800 Subject: [PATCH] CRM_Core_DAO_AllCore_Tables - Add get() which returns full metadata. (Using the same format has hook_entityTypes) --- xml/templates/listAll.tpl | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/xml/templates/listAll.tpl b/xml/templates/listAll.tpl index f025a39cec..10897cdde7 100644 --- a/xml/templates/listAll.tpl +++ b/xml/templates/listAll.tpl @@ -38,6 +38,7 @@ class CRM_Core_DAO_AllCoreTables {ldelim} static private $tables = null; static private $daoToClass = null; + static private $entityTypes = null; static public function init($fresh = FALSE) {ldelim} static $init = FALSE; @@ -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} @@ -70,6 +72,16 @@ class CRM_Core_DAO_AllCoreTables {ldelim} 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} -- 2.25.1