diff --git a/lib/Doctrine/ORM/Mapping/Driver/DriverChain.php b/lib/Doctrine/ORM/Mapping/Driver/DriverChain.php index 77c258a18..d84d2344b 100644 --- a/lib/Doctrine/ORM/Mapping/Driver/DriverChain.php +++ b/lib/Doctrine/ORM/Mapping/Driver/DriverChain.php @@ -88,15 +88,20 @@ class DriverChain implements Driver public function getAllClassNames() { $classNames = array(); + $driverClasses = array(); foreach ($this->_drivers AS $namespace => $driver) { - $driverClasses = $driver->getAllClassNames(); - foreach ($driverClasses AS $className) { + $oid = spl_object_hash($driver); + if (!isset($driverClasses[$oid])) { + $driverClasses[$oid] = $driver->getAllClassNames(); + } + + foreach ($driverClasses[$oid] AS $className) { if (strpos($className, $namespace) === 0) { - $classNames[] = $className; + $classNames[$className] = true; } } } - return array_unique($classNames); + return array_keys($classNames); } /**