-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from biig-io/fix/doctrine-bundle-configurator
Add support of many entity managers
- Loading branch information
Showing
10 changed files
with
135 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
src/Integration/Symfony/DependencyInjection/EntityManagerConfigurator.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
namespace Biig\Component\Domain\Integration\Symfony\DependencyInjection; | ||
|
||
use Biig\Component\Domain\Event\DomainEventDispatcher; | ||
use Biig\Component\Domain\Model\Instantiator\DoctrineConfig\ClassMetadataFactory; | ||
use Doctrine\Bundle\DoctrineBundle\ManagerConfigurator; | ||
use Doctrine\ORM\EntityManager; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
class EntityManagerConfigurator | ||
{ | ||
/** | ||
* @var ManagerConfigurator | ||
*/ | ||
private $originalConfigurator; | ||
|
||
/** | ||
* @var DomainEventDispatcher | ||
*/ | ||
private $dispatcher; | ||
|
||
public function __construct(ManagerConfigurator $configurator, DomainEventDispatcher $dispatcher) | ||
{ | ||
$this->originalConfigurator = $configurator; | ||
$this->dispatcher = $dispatcher; | ||
} | ||
|
||
public function configure(EntityManager $entityManager) | ||
{ | ||
$this->originalConfigurator->configure($entityManager); | ||
$metadataFactory = $entityManager->getMetadataFactory(); | ||
|
||
if ($metadataFactory instanceof ClassMetadataFactory) { | ||
$metadataFactory->setDispatcher($this->dispatcher); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 0 additions & 25 deletions
25
src/Model/Instantiator/DoctrineConfig/EntityManagerConfigurator.php
This file was deleted.
Oops, something went wrong.