X-Git-Url: https://git.rapsys.eu/airbundle/blobdiff_plain/6d87d1dbad7e333cd41b57c641515ae05a7653f3..7e8ef252c23703363c351b23ff1d1ce9fac80ce5:/Entity/Slot.php?ds=inline diff --git a/Entity/Slot.php b/Entity/Slot.php index c5fcd86..445f053 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(); } @@ -161,7 +164,7 @@ class Slot { */ public function preUpdate(PreUpdateEventArgs $eventArgs) { //Check that we have a slot instance - if (($slot = $eventArgs->getEntity()) instanceof Slot) { + if (($slot = $eventArgs->getObject()) instanceof Slot) { //Set updated value $slot->setUpdated(new \DateTime('now')); }