]> Raphaël G. Git Repositories - airbundle/commitdiff
Remove dance link on session
authorRaphaël Gertz <git@rapsys.eu>
Sat, 28 Aug 2021 03:46:53 +0000 (05:46 +0200)
committerRaphaël Gertz <git@rapsys.eu>
Sat, 28 Aug 2021 03:46:53 +0000 (05:46 +0200)
Add dance link on application
Fix variable name in preUpdate

Entity/Application.php
Entity/Location.php
Entity/Session.php
Entity/Slot.php

index b54b1e2e4cf42a20d5fbab633032d6fd4dc0b3de..48e69929edb8fd4d2163638124f73b2cfc859bbe 100644 (file)
@@ -22,6 +22,11 @@ class Application {
         */
        private $id;
 
         */
        private $id;
 
+       /**
+        * @var Dance
+        */
+       private $dance;
+
        /**
         * @var float
         */
        /**
         * @var float
         */
@@ -69,6 +74,28 @@ class Application {
                return $this->id;
        }
 
                return $this->id;
        }
 
+       /**
+        * Set dance
+        *
+        * @param Dance $dance
+        *
+        * @return Session
+        */
+       public function setDance(Dance $dance): Session {
+               $this->dance = $dance;
+
+               return $this;
+       }
+
+       /**
+        * Get dance
+        *
+        * @return Dance
+        */
+       public function getDance(): Dance {
+               return $this->dance;
+       }
+
        /**
         * Set score
         *
        /**
         * Set score
         *
@@ -206,9 +233,9 @@ class Application {
         */
        public function preUpdate(PreUpdateEventArgs $eventArgs) {
                //Check that we have an application instance
         */
        public function preUpdate(PreUpdateEventArgs $eventArgs) {
                //Check that we have an application instance
-               if (($user = $eventArgs->getEntity()) instanceof Application) {
+               if (($application = $eventArgs->getEntity()) instanceof Application) {
                        //Set updated value
                        //Set updated value
-                       $user->setUpdated(new \DateTime('now'));
+                       $application->setUpdated(new \DateTime('now'));
                }
        }
 }
                }
        }
 }
index 1fdca93803149aa9a4c241536af7b21366d0d3e4..6e66cea61a45df62a33d9731308a0a984fb0e492 100644 (file)
@@ -427,9 +427,9 @@ class Location {
         */
        public function preUpdate(PreUpdateEventArgs $eventArgs) {
                //Check that we have a location instance
         */
        public function preUpdate(PreUpdateEventArgs $eventArgs) {
                //Check that we have a location instance
-               if (($user = $eventArgs->getEntity()) instanceof Location) {
+               if (($location = $eventArgs->getEntity()) instanceof Location) {
                        //Set updated value
                        //Set updated value
-                       $user->setUpdated(new \DateTime('now'));
+                       $location->setUpdated(new \DateTime('now'));
                }
        }
 
                }
        }
 
index f5f0ef555def1e9607c9de464e99e9fbf7827961..fb0b8f3cc21a47c04a691622c6b7965a7e184711 100644 (file)
@@ -113,11 +113,6 @@ class Session {
         */
        private $application;
 
         */
        private $application;
 
-       /**
-        * @var Dance
-        */
-       private $dance;
-
        /**
         * @var Location
         */
        /**
         * @var Location
         */
@@ -579,28 +574,6 @@ class Session {
                return $this->applications;
        }
 
                return $this->applications;
        }
 
-       /**
-        * Set dance
-        *
-        * @param Dance $dance
-        *
-        * @return Session
-        */
-       public function setDance(Dance $dance): Session {
-               $this->dance = $dance;
-
-               return $this;
-       }
-
-       /**
-        * Get dance
-        *
-        * @return Dance
-        */
-       public function getDance(): Dance {
-               return $this->dance;
-       }
-
        /**
         * Set location
         *
        /**
         * Set location
         *
@@ -672,9 +645,9 @@ class Session {
         */
        public function preUpdate(PreUpdateEventArgs $eventArgs) {
                //Check that we have a session instance
         */
        public function preUpdate(PreUpdateEventArgs $eventArgs) {
                //Check that we have a session instance
-               if (($user = $eventArgs->getEntity()) instanceof Session) {
+               if (($session = $eventArgs->getEntity()) instanceof Session) {
                        //Set updated value
                        //Set updated value
-                       $user->setUpdated(new \DateTime('now'));
+                       $session->setUpdated(new \DateTime('now'));
                }
        }
 
                }
        }
 
index 10e5b3d6f8bb1c48d996be97b4e72f92029328b6..c5fcd86771529d784deea742fc2c368fb4253755 100644 (file)
@@ -161,9 +161,9 @@ class Slot {
         */
        public function preUpdate(PreUpdateEventArgs $eventArgs) {
                //Check that we have a slot instance
         */
        public function preUpdate(PreUpdateEventArgs $eventArgs) {
                //Check that we have a slot instance
-               if (($user = $eventArgs->getEntity()) instanceof Slot) {
+               if (($slot = $eventArgs->getEntity()) instanceof Slot) {
                        //Set updated value
                        //Set updated value
-                       $user->setUpdated(new \DateTime('now'));
+                       $slot->setUpdated(new \DateTime('now'));
                }
        }
 
                }
        }