Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[DDC-2572] Fix ResolveTargetEntityListener subscription example

  • Loading branch information...
commit 0a42401a43dfe1e5c24018bb0fb65deab338d4b5 1 parent 34b855e
@FabioBatSilva FabioBatSilva authored
Showing with 4 additions and 3 deletions.
  1. +4 −3 docs/en/cookbook/resolve-target-entity-listener.rst
View
7 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);
Please sign in to comment.
Something went wrong with that request. Please try again.