Skip to content

Commit e8b7a0e

Browse files
authored
Merge pull request #183 from piotrantosik/patch-2
Use ContainerAwareTrait in example if possible
2 parents 9a11422 + a0c1032 commit e8b7a0e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Resources/doc/index.rst

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,17 +312,22 @@ your data structure. This could be necessary to update relations with some speci
312312
logic or to create new entities.
313313

314314
Therefore you can just implement the ContainerAwareInterface with its needed methods
315-
to get full access to the container.
315+
to get full access to the container or ContainerAwareTrait if you use Symfony >= 2.4.
316316

317317
.. code-block:: php
318318
319319
// ...
320320
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
321321
use Symfony\Component\DependencyInjection\ContainerInterface;
322+
// Symfony >= 2.4
323+
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
322324
323325
class Version20130326212938 extends AbstractMigration implements ContainerAwareInterface
324326
{
325-
327+
// Symfony >= 2.4
328+
use ContainerAwareTrait;
329+
330+
// Symfony 2.3
326331
private $container;
327332
328333
public function setContainer(ContainerInterface $container = null)

0 commit comments

Comments
 (0)