Skip to content

Commit 8363273

Browse files
hamzahanafi11weaverryan
authored andcommitted
Update event_listeners_subscribers.rst
1 parent d4e78c4 commit 8363273

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

doctrine/event_listeners_subscribers.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,14 @@ a ``postPersist()`` method, which will be called when the event is dispatched::
131131
{
132132
public function postPersist(LifecycleEventArgs $args)
133133
{
134-
$object = $args->getEntity();
134+
$entity = $args->getEntity();
135135

136136
// only act on some "Product" entity
137-
if (!$object instanceof Product) {
137+
if (!$entity instanceof Product) {
138138
return;
139139
}
140140

141-
$objectManager = $args->getObjectManager();
141+
$entityManager = $args->getEntityManager();
142142
// ... do something with the Product
143143
}
144144
}
@@ -195,7 +195,7 @@ interface and have an event method for each event it subscribes to::
195195

196196
public function index(LifecycleEventArgs $args)
197197
{
198-
$entity = $args->getObject();
198+
$entity = $args->getEntity();
199199

200200
// perhaps you only want to act on some "Product" entity
201201
if ($entity instanceof Product) {

0 commit comments

Comments
 (0)