Skip to content

Commit 3e800f3

Browse files
committed
Add support for latest Nettrine
1 parent ae88475 commit 3e800f3

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/ImageExtension.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,14 @@ public function getConfigSchema(): Schema
2727

2828
public function beforeCompile(): void
2929
{
30-
/** @var ServiceDefinition $annotationDriver */
31-
$annotationDriver = $this->getContainerBuilder()->getDefinitionByType(MappingDriver::class);
32-
$annotationDriver->addSetup('addPaths', [['vendor/rixafy/image']]);
30+
if (class_exists('Nettrine\ORM\DI\Helpers\MappingHelper')) {
31+
\Nettrine\ORM\DI\Helpers\MappingHelper::of($this)
32+
->addAnnotation('Rixafy\Image', __DIR__ . '/../../../rixafy/image');
33+
} else {
34+
/** @var ServiceDefinition $annotationDriver */
35+
$annotationDriver = $this->getContainerBuilder()->getDefinitionByType(MappingDriver::class);
36+
$annotationDriver->addSetup('addPaths', [['vendor/rixafy/image']]);
37+
}
3338
}
3439

3540
public function loadConfiguration(): void

0 commit comments

Comments
 (0)