Created
February 10, 2014 04:32
-
-
Save simonwelsh/8910402 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/core/ClassInfo.php b/core/ClassInfo.php | |
index 5a25a4a..c341b5f 100644 | |
--- a/core/ClassInfo.php | |
+++ b/core/ClassInfo.php | |
@@ -153,16 +153,17 @@ class ClassInfo { | |
public static function ancestry($class, $tablesOnly = false) { | |
if (!is_string($class)) $class = get_class($class); | |
$cacheKey = $class . '_' . (string)$tablesOnly; | |
$parent = $class; | |
if(!isset(self::$_cache_ancestry[$cacheKey])) { | |
$ancestry = array(); | |
+ class_exists($parent); | |
do { | |
if (!$tablesOnly || DataObject::has_own_table($parent)) { | |
$ancestry[$parent] = $parent; | |
} | |
} while ($parent = get_parent_class($parent)); | |
self::$_cache_ancestry[$cacheKey] = array_reverse($ancestry); | |
} | |
return self::$_cache_ancestry[$cacheKey]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment