]> Raphaël G. Git Repositories - userbundle/commitdiff
Use getObject event args member function instead of deprecated getEntity
authorRaphaël Gertz <git@rapsys.eu>
Thu, 7 Mar 2024 10:30:47 +0000 (11:30 +0100)
committerRaphaël Gertz <git@rapsys.eu>
Thu, 7 Mar 2024 10:30:47 +0000 (11:30 +0100)
Entity/Civility.php
Entity/Group.php
Entity/User.php

index 9ec56e9053f16b299b72772195313401725fbb54..ea8b95b1a0ec1c3ed5c6c0c884b6aea759c2fd6b 100644 (file)
@@ -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'));
                }
index 901fbc64d82897989cad5722861d93b161020ee9..aa60f77e0f9e48c3a77a1a42f6aa154b53e89806 100644 (file)
@@ -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'));
                }
index 68b0dcf1ee1d6baf1f8ccb3e8f6391970ac7a61e..7d15a367f358f08e7c44f83daba7af4b14b6e159 100644 (file)
@@ -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'));
                }