Skip to content

Fixed entity manager service name #8228

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion service_container.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions service_container/parent_services.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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']]

Expand All @@ -93,7 +93,7 @@ duplicated service definitions:
<services>
<!-- as no class is configured, the parent service MUST be abstract -->
<service id="app.base_doctrine_repository" abstract="true">
<argument type="service" id="doctrine.entity_manager" />
<argument type="service" id="doctrine.orm.entity_manager" />

<call method="setLogger">
<argument type="service" id="logger" />
Expand Down Expand Up @@ -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')))
;

Expand Down