Entity listeners: what's the difference between passed object and event arguments object #10922
Answered
by
ghost
ToshY
asked this question in
Support Questions
-
I'm looking at the documentation regarding "Entity Listeners", and I see the following example for <?php
use Doctrine\ORM\Event\PreUpdateEventArgs;
class UserListener
{
public function preUpdate(User $user, PreUpdateEventArgs $event)
{
// Do something on pre update.
}
} The explanation above that example denotes the following:
My question:
|
Beta Was this translation helpful? Give feedback.
Answered by
ghost
Oct 21, 2023
Replies: 1 comment 1 reply
-
Yes, they are the same. You can see it in |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
ToshY
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes, they are the same. You can see it in
UnitOfWork::executeUpdates
where the event is dispatched or just check it yourself with===
comparison. I don't know why this is that way but there might be no reason and this is still fine.