1
0
mirror of synced 2025-01-18 14:31:40 +03:00

[DDC-2572] Fix ResolveTargetEntityListener subscription example

This commit is contained in:
Fabio B. Silva 2013-08-08 19:13:13 -04:00
parent 34b855e253
commit 0a42401a43

View File

@ -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);