Skip to content

Commit 200464a

Browse files
committed
[cookbook] Fixing bad namespace - closes symfony#702
1 parent 76787a7 commit 200464a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cookbook/doctrine/event_listeners_subscribers.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ a ``postSave`` method, which will be called when the event is thrown::
8585
namespace Acme\SearchBundle\Listener;
8686
8787
use Doctrine\ORM\Event\LifecycleEventArgs;
88+
use Acme\StoreBundle\Entity\Product;
8889
8990
class SearchIndexer
9091
{
@@ -94,7 +95,7 @@ a ``postSave`` method, which will be called when the event is thrown::
9495
$entityManager = $args->getEntityManager();
9596
9697
// perhaps you only want to act on some "Product" entity
97-
if ($entity instanceof Acme\StoreBundle\Entity\Product) {
98+
if ($entity instanceof Product) {
9899
// do something with the Product
99100
}
100101
}

0 commit comments

Comments
 (0)