From: Raphaƫl Gertz Date: Thu, 7 Mar 2024 10:30:47 +0000 (+0100) Subject: Use getObject event args member function instead of deprecated getEntity X-Git-Tag: 0.4.0~19 X-Git-Url: https://git.rapsys.eu/userbundle/commitdiff_plain/c9dfa6d8941bcd0dedf0f938c53d86fa7b59e4ae Use getObject event args member function instead of deprecated getEntity --- diff --git a/Entity/Civility.php b/Entity/Civility.php index 9ec56e9..ea8b95b 100644 --- a/Entity/Civility.php +++ b/Entity/Civility.php @@ -169,7 +169,7 @@ class Civility { */ public function preUpdate(PreUpdateEventArgs $eventArgs) { //Check that we have a civility instance - if (($user = $eventArgs->getEntity()) instanceof Civility) { + if (($user = $eventArgs->getObject()) instanceof Civility) { //Set updated value $user->setUpdated(new \DateTime('now')); } diff --git a/Entity/Group.php b/Entity/Group.php index 901fbc6..aa60f77 100644 --- a/Entity/Group.php +++ b/Entity/Group.php @@ -169,7 +169,7 @@ class Group { */ public function preUpdate(PreUpdateEventArgs $eventArgs) { //Check that we have a group instance - if (($user = $eventArgs->getEntity()) instanceof Group) { + if (($user = $eventArgs->getObject()) instanceof Group) { //Set updated value $user->setUpdated(new \DateTime('now')); } diff --git a/Entity/User.php b/Entity/User.php index 68b0dcf..7d15a36 100644 --- a/Entity/User.php +++ b/Entity/User.php @@ -432,7 +432,7 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface { */ public function preUpdate(PreUpdateEventArgs $eventArgs) { //Check that we have an user instance - if (($user = $eventArgs->getEntity()) instanceof User) { + if (($user = $eventArgs->getObject()) instanceof User) { //Set updated value $user->setUpdated(new \DateTime('now')); }