X-Git-Url: https://git.rapsys.eu/.gitweb.cgi/airbundle/blobdiff_plain/9aad88c45d93dadacd35176364b56df4734c017b..f369d52a2f5956cc644885f83f32360bb0ad6f23:/Entity/Session.php diff --git a/Entity/Session.php b/Entity/Session.php index f5f0ef5..70b2fc4 100644 --- a/Entity/Session.php +++ b/Entity/Session.php @@ -49,7 +49,7 @@ class Session { private $stop; /** - * @var boolean + * @var bool */ private $premium; @@ -113,11 +113,6 @@ class Session { */ private $application; - /** - * @var Dance - */ - private $dance; - /** * @var Location */ @@ -137,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; @@ -150,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(); } @@ -287,7 +286,7 @@ class Session { /** * Set premium * - * @param boolean $premium + * @param bool $premium * * @return Session */ @@ -579,28 +578,6 @@ class Session { 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 * @@ -652,7 +629,7 @@ class Session { * * @return Session */ - public function setApplication(Application $application): Session { + public function setApplication(?Application $application): Session { $this->application = $application; return $this; @@ -672,9 +649,9 @@ class Session { */ 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 - $user->setUpdated(new \DateTime('now')); + $session->setUpdated(new \DateTime('now')); } }