Skip to content

Commit

Permalink
Fix incompatibility with Nette/DI 2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
enumag committed Apr 17, 2016
1 parent 823fbae commit bde1a7a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Kdyby/Doctrine/DI/OrmExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -601,17 +601,17 @@ protected function processMetadataDriver(Nette\DI\ServiceDefinition $metadataDri
$driver = new Statement(self::ANNOTATION_DRIVER, is_array($paths) ? $paths : [$paths]);
}

$impl = $driver instanceof \stdClass ? $driver->value : ($driver instanceof Statement ? $driver->entity : (string) $driver);
$impl = $driver instanceof \stdClass ? $driver->value : ($driver instanceof Statement ? $driver->getEntity() : (string) $driver);
list($driver) = CacheHelpers::filterArgs($driver);
/** @var Statement $driver */

if (isset($this->metadataDriverClasses[$impl])) {
$driver->entity = $this->metadataDriverClasses[$impl];
$driver->setEntity($this->metadataDriverClasses[$impl]);
}

if (is_string($driver->entity) && substr($driver->entity, 0, 1) === '@') {
$metadataDriver->addSetup('addDriver', [$driver->entity, $namespace]);
return $driver->entity;
if (is_string($driver->getEntity()) && substr($driver->getEntity(), 0, 1) === '@') {
$metadataDriver->addSetup('addDriver', [$driver->getEntity(), $namespace]);
return $driver->getEntity();
}

if ($impl === self::ANNOTATION_DRIVER) {
Expand All @@ -625,7 +625,7 @@ protected function processMetadataDriver(Nette\DI\ServiceDefinition $metadataDri

$this->getContainerBuilder()->addDefinition($serviceName)
->setClass('Doctrine\Common\Persistence\Mapping\Driver\MappingDriver')
->setFactory($driver->entity, $driver->arguments)
->setFactory($driver->getEntity(), $driver->arguments)
->setAutowired(FALSE)
->setInject(FALSE);

Expand Down

0 comments on commit bde1a7a

Please sign in to comment.