Fixed getLoadedModels()
This commit is contained in:
parent
86939d83bd
commit
54050f8c81
@ -543,8 +543,8 @@ final class Doctrine
|
|||||||
$loadedModels = array();
|
$loadedModels = array();
|
||||||
|
|
||||||
foreach ((array) $classes as $name) {
|
foreach ((array) $classes as $name) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
$declaredBefore = get_declared_classes();
|
||||||
$class = new ReflectionClass($name);
|
$class = new ReflectionClass($name);
|
||||||
if (self::isValidModelClass($class)) {
|
if (self::isValidModelClass($class)) {
|
||||||
$loadedModels[] = $name;
|
$loadedModels[] = $name;
|
||||||
@ -554,11 +554,10 @@ final class Doctrine
|
|||||||
// The possibility exists that the class name(s) contained in the model
|
// The possibility exists that the class name(s) contained in the model
|
||||||
// file is not the same as the actual model file name itself
|
// file is not the same as the actual model file name itself
|
||||||
if (isset(self::$_loadedModels[$name])) {
|
if (isset(self::$_loadedModels[$name])) {
|
||||||
$declaredBefore = get_declared_classes();
|
|
||||||
try {
|
try {
|
||||||
|
$tmp = self::$_loadedModels[$name];
|
||||||
require_once self::$_loadedModels[$name];
|
require_once self::$_loadedModels[$name];
|
||||||
$declaredAfter = get_declared_classes();
|
$declaredAfter = get_declared_classes();
|
||||||
// Using array_slice since array_diff is broken is some versions
|
|
||||||
$foundClasses = array_slice($declaredAfter, count($declaredBefore)-1);
|
$foundClasses = array_slice($declaredAfter, count($declaredBefore)-1);
|
||||||
if ($foundClasses) {
|
if ($foundClasses) {
|
||||||
foreach ($foundClasses as $name) {
|
foreach ($foundClasses as $name) {
|
||||||
@ -575,7 +574,6 @@ final class Doctrine
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $loadedModels;
|
return $loadedModels;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user