diff --git a/service_container.rst b/service_container.rst index fd14176a179..16ba006fbf0 100644 --- a/service_container.rst +++ b/service_container.rst @@ -15,7 +15,7 @@ a very special object called the **service container**. If you have the service then you can fetch a service by using that service's id:: $logger = $container->get('logger'); - $entityManager = $container->get('doctrine.entity_manager'); + $entityManager = $container->get('doctrine.orm.entity_manager'); The container is the *heart* of Symfony: it allows you to standardize and centralize the way objects are constructed. It makes your life easier, is super fast, and emphasizes diff --git a/service_container/parent_services.rst b/service_container/parent_services.rst index c72bda179aa..496c1e1f7b9 100644 --- a/service_container/parent_services.rst +++ b/service_container/parent_services.rst @@ -7,7 +7,7 @@ How to Manage Common Dependencies with Parent Services As you add more functionality to your application, you may well start to have related classes that share some of the same dependencies. For example, you may have multiple repository classes which need the -``doctrine.entity_manager`` service and an optional ``logger`` service:: +``doctrine.orm.entity_manager`` service and an optional ``logger`` service:: // src/AppBundle/Repository/BaseDoctrineRepository.php namespace AppBundle\Repository; @@ -67,7 +67,7 @@ duplicated service definitions: app.base_doctrine_repository: # as no class is configured, the parent service MUST be abstract abstract: true - arguments: ['@doctrine.entity_manager'] + arguments: ['@doctrine.orm.entity_manager'] calls: - [setLogger, ['@logger']] @@ -93,7 +93,7 @@ duplicated service definitions: - + @@ -124,7 +124,7 @@ duplicated service definitions: // as no class is configured, the parent service MUST be abstract $container->register('app.base_doctrine_repository') - ->addArgument(new Reference('doctrine.entity_manager')) + ->addArgument(new Reference('doctrine.orm.entity_manager')) ->addMethodCall('setLogger', array(new Reference('logger'))) ;