Skip to content

Commit

Permalink
Merge pull request #1050 from nicolas-grekas/autow
Browse files Browse the repository at this point in the history
Restore autowiring alias for ManagerRegistry
  • Loading branch information
alcaeus committed Nov 12, 2019
2 parents 9229915 + 481b3b9 commit bd2bb65
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Repository/ServiceEntityRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*
* class YourEntityRepository extends ServiceEntityRepository
* {
* public function __construct(Registry $registry)
* public function __construct(ManagerRegistry $registry)
* {
* parent::__construct($registry, YourEntity::class);
* }
Expand Down
2 changes: 1 addition & 1 deletion Resources/config/dbal.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<argument>%doctrine.default_connection%</argument>
<argument>%doctrine.default_entity_manager%</argument>
</service>
<service id="Doctrine\Bundle\DoctrineBundle\Registry" alias="doctrine" public="false" />
<service id="Doctrine\Common\Persistence\ManagerRegistry" alias="doctrine" public="false" />

<service id="doctrine.twig.doctrine_extension" class="Doctrine\Bundle\DoctrineBundle\Twig\DoctrineExtension" public="false">
<tag name="twig.extension" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

namespace Fixtures\Bundles\RepositoryServiceBundle\Repository;

use Doctrine\Bundle\DoctrineBundle\Registry;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Common\Persistence\ManagerRegistry;
use Fixtures\Bundles\RepositoryServiceBundle\Entity\TestCustomServiceRepoEntity;

class TestCustomServiceRepoRepository extends ServiceEntityRepository
{
public function __construct(Registry $registry)
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, TestCustomServiceRepoEntity::class);
}
Expand Down
5 changes: 2 additions & 3 deletions UPGRADE-2.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,8 @@ Registry
Service aliases
---------------

* The `Doctrine\Common\Persistence\ManagerRegistry` and
`Symfony\Bridge\Doctrine\RegistryInterface` interfaces are no longer aliased
to the `doctrine` service, use `Doctrine\Bundle\DoctrineBundle\Registry`
* The `Symfony\Bridge\Doctrine\RegistryInterface` interface is no longer aliased
to the `doctrine` service, use `Doctrine\Common\Persistence\ManagerRegistry`
instead.
* The `Doctrine\Common\Persistence\ObjectManager` interface is no longer
aliased to the `doctrine.orm.entity_manager` service, use
Expand Down

0 comments on commit bd2bb65

Please sign in to comment.