Skip to content

[Component][Dependency Injection][Parent Services] - Adding compile call #1681

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 3 commits into from
Sep 15, 2012
Merged
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
9 changes: 9 additions & 0 deletions components/dependency_injection/parentservices.rst
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ a parent for a service.
.. code-block:: php

use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\DefinitionDecorator;
use Symfony\Component\DependencyInjection\Reference;

// ...
Expand Down Expand Up @@ -284,6 +285,12 @@ can only be used as a parent service and cannot be used directly as a service
to inject and will be removed at compile time. In other words, it exists merely
as a "template" that other services can use.

.. note::

In order for parent dependencies to resolve, the ``ContainerBuilder`` must
first be compiled. See :doc:`/components/dependency_injection/compilation`
for more details.

Overriding Parent Dependencies
------------------------------

Expand Down Expand Up @@ -364,6 +371,7 @@ to the ``NewsletterManager`` class, the config would look like this:
.. code-block:: php

use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\DefinitionDecorator;
use Symfony\Component\DependencyInjection\Reference;

// ...
Expand Down Expand Up @@ -482,6 +490,7 @@ If you had the following config:
.. code-block:: php

use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\DefinitionDecorator;
use Symfony\Component\DependencyInjection\Reference;

// ...
Expand Down