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 d4e78c4

Browse filesBrowse files
hamzahanafi11weaverryan
authored andcommitted
Update event_listeners_subscribers.rst
By using $args->getEntity() you can have access to the generated id (primary key) of the object $args->getObject() returns the object before executing flush() method
1 parent 0df2f8a commit d4e78c4
Copy full SHA for d4e78c4

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+1
-1
lines changed

‎doctrine/event_listeners_subscribers.rst

Copy file name to clipboardExpand all lines: doctrine/event_listeners_subscribers.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ a ``postPersist()`` method, which will be called when the event is dispatched::
131131
{
132132
public function postPersist(LifecycleEventArgs $args)
133133
{
134-
$object = $args->getObject();
134+
$object = $args->getEntity();
135135

136136
// only act on some "Product" entity
137137
if (!$object instanceof Product) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.