X-Git-Url: https://git.rapsys.eu/airbundle/blobdiff_plain/6d87d1dbad7e333cd41b57c641515ae05a7653f3..f1d9cc59cfc96d5ee76e48d7a9569bb329cad501:/Entity/Session.php?ds=sidebyside

diff --git a/Entity/Session.php b/Entity/Session.php
index fb0b8f3..70b2fc4 100644
--- a/Entity/Session.php
+++ b/Entity/Session.php
@@ -49,7 +49,7 @@ class Session {
 	private $stop;
 
 	/**
-	 * @var boolean
+	 * @var bool
 	 */
 	private $premium;
 
@@ -132,10 +132,12 @@ class Session {
 	 * Constructor
 	 */
 	public function __construct() {
+		//Set defaults
 		$this->begin = null;
 		$this->start = null;
 		$this->length = null;
 		$this->stop = null;
+		$this->premium = 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->premium = null;
+		$this->created = new \DateTime('now');
+		$this->updated = new \DateTime('now');
+		$this->application = null;
 		$this->applications = new ArrayCollection();
 	}
 
@@ -282,7 +286,7 @@ class Session {
 	/**
 	 * Set premium
 	 *
-	 * @param boolean $premium
+	 * @param bool $premium
 	 *
 	 * @return Session
 	 */
@@ -625,7 +629,7 @@ class Session {
 	 *
 	 * @return Session
 	 */
-	public function setApplication(Application $application): Session {
+	public function setApplication(?Application $application): Session {
 		$this->application = $application;
 
 		return $this;