]> Raphaƫl G. Git Repositories - airbundle/blobdiff - Entity/Session.php
Protect from getLocale call on empty request happening in console commands
[airbundle] / Entity / Session.php
index fb0b8f3cc21a47c04a691622c6b7965a7e184711..70b2fc4bed5e92bb2855c4b65f4aa91cc08f65b0 100644 (file)
@@ -49,7 +49,7 @@ class Session {
        private $stop;
 
        /**
        private $stop;
 
        /**
-        * @var boolean
+        * @var bool
         */
        private $premium;
 
         */
        private $premium;
 
@@ -132,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;
@@ -145,7 +147,9 @@ 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->application = null;
                $this->applications = new ArrayCollection();
        }
 
                $this->applications = new ArrayCollection();
        }
 
@@ -282,7 +286,7 @@ class Session {
        /**
         * Set premium
         *
        /**
         * Set premium
         *
-        * @param boolean $premium
+        * @param bool $premium
         *
         * @return Session
         */
         *
         * @return Session
         */
@@ -625,7 +629,7 @@ class Session {
         *
         * @return Session
         */
         *
         * @return Session
         */
-       public function setApplication(Application $application): Session {
+       public function setApplication(?Application $application): Session {
                $this->application = $application;
 
                return $this;
                $this->application = $application;
 
                return $this;