diff --git a/lib/Doctrine/ORM/Mapping/Driver/DriverChain.php b/lib/Doctrine/ORM/Mapping/Driver/DriverChain.php deleted file mode 100644 index 70f681e3c..000000000 --- a/lib/Doctrine/ORM/Mapping/Driver/DriverChain.php +++ /dev/null @@ -1,103 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Mapping\Driver; - -use Doctrine\Common\Persistence\Mapping\Driver\MappingDriver, - Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain, - Doctrine\Common\Persistence\Mapping\ClassMetadata, - Doctrine\ORM\Mapping\MappingException; - -/** - * The DriverChain allows you to add multiple other mapping drivers for - * certain namespaces - * - * @since 2.0 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan H. Wage - * @author Roman Borschel - */ -class DriverChain extends MappingDriverChain -{ - /** - * The default driver - * - * @var MappingDriver - */ - private $defaultDriver; - - /** - * Get the default driver. - * - * @return MappingDriver|null - */ - public function getDefaultDriver() - { - return $this->defaultDriver; - } - - /** - * Set the default driver. - * - * @param MappingDriver $driver - */ - public function setDefaultDriver(MappingDriver $driver) - { - $this->defaultDriver = $driver; - } - - /** - * {@inheritDoc} - * @throws MappingException - */ - public function loadMetadataForClass($className, ClassMetadata $metadata) - { - /* @var $driver MappingDriver */ - foreach ($this->getDrivers() as $namespace => $driver) { - if (strpos($className, $namespace) === 0) { - $driver->loadMetadataForClass($className, $metadata); - return; - } - } - - if ($this->defaultDriver !== null) { - $this->defaultDriver->loadMetadataForClass($className, $metadata); - return; - } - - throw MappingException::classIsNotAValidEntityOrMappedSuperClass($className); - } - - /** - * {@inheritDoc} - */ - public function isTransient($className) - { - if (!parent::isTransient($className)) { - return false; - } - - if ($this->defaultDriver !== null) { - return $this->defaultDriver->isTransient($className); - } - - return true; - } -} diff --git a/lib/vendor/doctrine-common b/lib/vendor/doctrine-common index 8df9cdf3b..f7cdf27f0 160000 --- a/lib/vendor/doctrine-common +++ b/lib/vendor/doctrine-common @@ -1 +1 @@ -Subproject commit 8df9cdf3b921a3b59bbba51d5ba9063509ef6a1a +Subproject commit f7cdf27f04c27ce02e2c14a18ff9064cc37f7284 diff --git a/tests/Doctrine/Tests/ORM/Mapping/DriverChainTest.php b/tests/Doctrine/Tests/ORM/Mapping/DriverChainTest.php index 76ca9d29f..223de44b2 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/DriverChainTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/DriverChainTest.php @@ -2,7 +2,7 @@ namespace Doctrine\Tests\ORM\Mapping; -use Doctrine\ORM\Mapping\Driver\DriverChain; +use Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain as DriverChain; require_once __DIR__ . '/../../TestInit.php'; @@ -45,7 +45,7 @@ class DriverChainTest extends \Doctrine\Tests\OrmTestCase $chain = new DriverChain(); - $this->setExpectedException('Doctrine\ORM\Mapping\MappingException'); + $this->setExpectedException('Doctrine\Common\Persistence\Mapping\MappingException'); $chain->loadMetadataForClass($className, $classMetadata); }