X-Git-Url: https://git.rapsys.eu/airbundle/blobdiff_plain/010e38c2810846d5812a0ec91df98cddfdef8de4..3f4eae21e72bf3261fa8b939a50408de6b119f74:/Entity/Snippet.php diff --git a/Entity/Snippet.php b/Entity/Snippet.php index 4e9d406..fa5fe99 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->location = null; + $this->created = new \DateTime('now'); + $this->updated = new \DateTime('now'); } /** @@ -426,9 +430,9 @@ class Snippet { /** * {@inheritdoc} */ - public function preUpdate(\Doctrine\ORM\Event\PreUpdateEventArgs $eventArgs) { + public function preUpdate(PreUpdateEventArgs $eventArgs) { //Check that we have an snippet instance - if (($snippet = $eventArgs->getEntity()) instanceof Snippet) { + if (($snippet = $eventArgs->getObject()) instanceof Snippet) { //Set updated value $snippet->setUpdated(new \DateTime('now')); }