Skip to content

Commit

Permalink
[DDC-2572] Fix ResolveTargetEntityListener subscription example
Browse files Browse the repository at this point in the history
  • Loading branch information
FabioBatSilva committed Aug 8, 2013
1 parent 34b855e commit 0a42401
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions docs/en/cookbook/resolve-target-entity-listener.rst
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,14 @@ the targetEntity resolution will occur reliably:

.. code-block:: php
$evm = new \Doctrine\Common\EventManager;
$evm = new \Doctrine\Common\EventManager;
$rtel = new \Doctrine\ORM\Tools\ResolveTargetEntityListener;
// Adds a target-entity class
$rtel->addResolveTargetEntity('Acme\\InvoiceModule\\Model\\InvoiceSubjectInterface', 'Acme\\CustomerModule\\Entity\\Customer', array());
// Add the ResolveTargetEntityListener
$evm->addEventSubscriber($rtel);
$evm->addEventListener(Doctrine\ORM\Events::loadClassMetadata, $rtel);
$em = \Doctrine\ORM\EntityManager::create($connectionOptions, $config, $evm);
Expand Down

0 comments on commit 0a42401

Please sign in to comment.