You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
minor #3545 Example of getting entity managers directly from the container (colinodell)
This PR was merged into the 2.3 branch.
Discussion
----------
Example of getting entity managers directly from the container
The documentation didn't provide examples of how to obtain the entity managers directly from the DI container. This is useful when needing to inject the em into other services.
The ems are added to the container using the service id `doctrine.orm.%s_entity_manager`, where `%s` is the em's name. This is done by [`\Doctrine\Bundle\DoctrineBundle\DependencyInjection\DoctrineExtension::loadOrmEntityManager()`](https://github.com/doctrine/DoctrineBundle/blob/v1.0.0/DependencyInjection/DoctrineExtension.php#L342)
| Q | A
| ------------- | ---
| Doc fix? | no
| New docs? | yes? (added example of existing feature)
| Applies to | all (doctrine/doctrine-bundle v1.0.0+)
| Fixed tickets | n/a
Commits
-------
eb7594c Example of getting entity managers directly from the container
0 commit comments