X-Git-Url: https://git.rapsys.eu/airbundle/blobdiff_plain/9aad88c45d93dadacd35176364b56df4734c017b..179f5c1ec9714b208bf90d39fd971048b9025210:/Entity/Slot.php diff --git a/Entity/Slot.php b/Entity/Slot.php index 10e5b3d..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,9 +164,9 @@ class Slot { */ public function preUpdate(PreUpdateEventArgs $eventArgs) { //Check that we have a slot instance - if (($user = $eventArgs->getEntity()) instanceof Slot) { + if (($slot = $eventArgs->getObject()) instanceof Slot) { //Set updated value - $user->setUpdated(new \DateTime('now')); + $slot->setUpdated(new \DateTime('now')); } }