1
0
mirror of synced 2025-01-18 06:21:40 +03:00

Fixed DefaultRepositoryClassName which should follow the Persistence interface, not ORM class.

This commit is contained in:
Guilherme Blanco 2012-07-25 01:23:52 -04:00
parent e5979b5ef2
commit 9dd3b66fe6

View File

@ -589,13 +589,13 @@ class Configuration extends \Doctrine\DBAL\Configuration
* *
* @since 2.2 * @since 2.2
* @param string $className * @param string $className
* @throws ORMException If not is a \Doctrine\ORM\EntityRepository * @throws ORMException If not is a \Doctrine\Common\Persistence\ObjectRepository
*/ */
public function setDefaultRepositoryClassName($className) public function setDefaultRepositoryClassName($className)
{ {
$entityRepositoryClassName = 'Doctrine\ORM\EntityRepository'; $objectRepositoryClassName = 'Doctrine\Common\Persistence\ObjectRepository';
if ($className !== $entityRepositoryClassName && ! is_subclass_of($className, $entityRepositoryClassName)) { if ($className !== $objectRepositoryClassName && ! is_subclass_of($className, $objectRepositoryClassName)) {
throw ORMException::invalidEntityRepository($className); throw ORMException::invalidEntityRepository($className);
} }