From: Raphaƫl Gertz Date: Sat, 28 Aug 2021 07:56:58 +0000 (+0200) Subject: Add defaults X-Git-Tag: 0.2.0~44 X-Git-Url: https://git.rapsys.eu/airbundle/commitdiff_plain/ca46631d1280ea5c387ae40b0b9ad1f77cb4e1c0?ds=sidebyside;hp=f0ed7af138b95f31354f8d5a37cb4cd27b902a75 Add defaults --- diff --git a/Entity/Slot.php b/Entity/Slot.php index c5fcd86..116c29f 100644 --- a/Entity/Slot.php +++ b/Entity/Slot.php @@ -47,6 +47,9 @@ class Slot { * Constructor */ public function __construct() { + //Set defaults + $this->created = new \DateTime('now'); + $this->updated = new \DateTime('now'); $this->sessions = new ArrayCollection(); } diff --git a/Entity/Snippet.php b/Entity/Snippet.php index 4e9d406..ee5b262 100644 --- a/Entity/Snippet.php +++ b/Entity/Snippet.php @@ -96,6 +96,7 @@ class Snippet { * Constructor */ public function __construct() { + //Set defaults $this->description = null; $this->class = null; $this->short = null; @@ -105,6 +106,9 @@ class Snippet { $this->donate = null; $this->link = null; $this->profile = null; + $this->created = new \DateTime('now'); + $this->updated = new \DateTime('now'); + $this->location = null; } /**