Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8363273

Browse filesBrowse files
hamzahanafi11weaverryan
authored andcommitted
Update event_listeners_subscribers.rst
1 parent d4e78c4 commit 8363273
Copy full SHA for 8363273

File tree

Expand file treeCollapse file tree

1 file changed

+4
-4
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-4
lines changed

‎doctrine/event_listeners_subscribers.rst

Copy file name to clipboardExpand all lines: doctrine/event_listeners_subscribers.rst
+4-4Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.