Permalink
Browse files

[DDC-2572] Fix ResolveTargetEntityListener subscription example

  • Loading branch information...
1 parent 34b855e commit 0a42401a43dfe1e5c24018bb0fb65deab338d4b5 @FabioBatSilva FabioBatSilva committed Aug 8, 2013
Showing with 4 additions and 3 deletions.
  1. +4 −3 docs/en/cookbook/resolve-target-entity-listener.rst
@@ -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);

0 comments on commit 0a42401

Please sign in to comment.