]> Raphaƫl G. Git Repositories - airbundle/blobdiff - Entity/Session.php
Remove location short
[airbundle] / Entity / Session.php
index f5f0ef555def1e9607c9de464e99e9fbf7827961..084580e6af8debfbcd0dd6a0f63f31911a315352 100644 (file)
@@ -113,11 +113,6 @@ class Session {
         */
        private $application;
 
         */
        private $application;
 
-       /**
-        * @var Dance
-        */
-       private $dance;
-
        /**
         * @var Location
         */
        /**
         * @var Location
         */
@@ -137,10 +132,12 @@ class Session {
         * Constructor
         */
        public function __construct() {
         * Constructor
         */
        public function __construct() {
+               //Set defaults
                $this->begin = null;
                $this->start = null;
                $this->length = null;
                $this->stop = null;
                $this->begin = null;
                $this->start = null;
                $this->length = null;
                $this->stop = null;
+               $this->premium = null;
                $this->rainfall = null;
                $this->rainrisk = null;
                $this->realfeel = null;
                $this->rainfall = null;
                $this->rainrisk = null;
                $this->realfeel = null;
@@ -150,7 +147,8 @@ class Session {
                $this->temperaturemin = null;
                $this->temperaturemax = null;
                $this->locked = null;
                $this->temperaturemin = null;
                $this->temperaturemax = null;
                $this->locked = null;
-               $this->premium = null;
+               $this->created = new \DateTime('now');
+               $this->updated = new \DateTime('now');
                $this->applications = new ArrayCollection();
        }
 
                $this->applications = new ArrayCollection();
        }
 
@@ -579,28 +577,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 +648,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'));
                }
        }
 
                }
        }