]> Raphaël G. Git Repositories - airbundle/commitdiff
Add defaults
authorRaphaël Gertz <git@rapsys.eu>
Sat, 28 Aug 2021 07:55:54 +0000 (09:55 +0200)
committerRaphaël Gertz <git@rapsys.eu>
Sat, 28 Aug 2021 07:55:54 +0000 (09:55 +0200)
Fix inproper strict return

Entity/Application.php
Entity/Dance.php
Entity/Location.php
Entity/Session.php

index 48e69929edb8fd4d2163638124f73b2cfc859bbe..5d3120360342c6761cf51c76bca43fe7e2df1a60 100644 (file)
@@ -61,6 +61,11 @@ class Application {
         * Constructor
         */
        public function __construct() {
+               //Set defaults
+               $this->score = null;
+               $this->canceled = null;
+               $this->created = new \DateTime('now');
+               $this->updated = new \DateTime('now');
                $this->session = null;
                $this->user = null;
        }
@@ -79,9 +84,9 @@ class Application {
         *
         * @param Dance $dance
         *
-        * @return Session
+        * @return Application
         */
-       public function setDance(Dance $dance): Session {
+       public function setDance(Dance $dance): Application {
                $this->dance = $dance;
 
                return $this;
index fa07ba9693b153c6323fdb92cc15e29b5dbb9e94..e3779da83fc03d8558dbaa0c4dead87b3aea33a8 100644 (file)
@@ -52,6 +52,9 @@ class Dance {
         * Constructor
         */
        public function __construct() {
+               //Set defaults
+               $this->created = new \DateTime('now');
+               $this->updated = new \DateTime('now');
                $this->applications = new ArrayCollection();
                $this->users = new ArrayCollection();
        }
index 4af12808f9cf23e92cd57565941383fe03ee3048..57af698c4ced30112a6c7fcd7d67939ffe248967 100644 (file)
@@ -87,6 +87,9 @@ class Location {
         * Constructor
         */
        public function __construct() {
+               //Set defaults
+               $this->created = new \DateTime('now');
+               $this->updated = new \DateTime('now');
                $this->sessions = new ArrayCollection();
                $this->snippets = new ArrayCollection();
                $this->users = new ArrayCollection();
index fb0b8f3cc21a47c04a691622c6b7965a7e184711..084580e6af8debfbcd0dd6a0f63f31911a315352 100644 (file)
@@ -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,8 @@ 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->applications = new ArrayCollection();
        }