Skip to content

Commit

Permalink
Merge pull request #122 from chives/2.1
Browse files Browse the repository at this point in the history
Fixed compatibility with different versions of doctrine-bundle
  • Loading branch information
chives authored Jul 24, 2021
2 parents 22b770a + 8c0b2bd commit 230c908
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"ext-pdo_sqlite": "*",
"ext-simplexml": "*",
"doctrine/dbal": "^2.5",
"doctrine/doctrine-bundle": "^1.3|^2.0",
"phpstan/phpstan": "^0.12.26",
"phpunit/phpunit": "^7.5|^8.0",
"squizlabs/php_codesniffer": "^3.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace FSi\DoctrineExtensions\Mapping;

use Doctrine\Bundle\DoctrineBundle\Mapping\MappingDriver as DoctrineBundleMappingDriver;
use Doctrine\Common\Annotations\Reader;
use Doctrine\Common\Cache\Cache;
use Doctrine\ORM\EntityManagerInterface;
Expand Down Expand Up @@ -169,6 +170,9 @@ private function getDriver(MappingDriver $omDriver): DriverInterface
{
$className = get_class($omDriver);
$driverName = substr($className, strrpos($className, '\\') + 1);
if (class_exists(DoctrineBundleMappingDriver::class) && $omDriver instanceof DoctrineBundleMappingDriver) {
$omDriver = $omDriver->getDriver();
}
if ($omDriver instanceof MappingDriverChain) {
$driver = new DriverChain();
foreach ($omDriver->getDrivers() as $namespace => $nestedOmDriver) {
Expand Down

0 comments on commit 230c908

Please sign in to comment.