Skip to content

Update event_listeners_subscribers.rst #8688

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

hamzahanafi11
Copy link
Contributor

By using $args->getEntity() you can have access to the generated id (primary key) of the object

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
@weaverryan
Copy link
Member

That's a great idea! Both methods do the same thing, but this is indeed more expressive to me.

Further up, we also use getObjectManager(). Could you change that getEntityManager()?

@weaverryan
Copy link
Member

Status: Needs work

@hamzahanafi11
Copy link
Contributor Author

@weaverryan changes done, I also edited the one inside the function named index()
I think these changes must be done for all symfony versions not only symfony:3.3

@weaverryan
Copy link
Member

You're right! I've merged this into 2.7 (and we'll merge up to the other branches). Thank you @hamzahanafi11!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants