X-Git-Url: https://git.rapsys.eu/.gitweb.cgi/airbundle/blobdiff_plain/0efb8d5485db7c2bfca8a1fef10067f058b54e1a..29752e2d84ac7619cc760857d3a30624a5950155:/Entity/Snippet.php?ds=sidebyside diff --git a/Entity/Snippet.php b/Entity/Snippet.php index 20a1940..f8ae7d2 100644 --- a/Entity/Snippet.php +++ b/Entity/Snippet.php @@ -319,4 +319,15 @@ class Snippet { public function getUser() { return $this->user; } + + /** + * {@inheritdoc} + */ + public function preUpdate(\Doctrine\ORM\Event\PreUpdateEventArgs $eventArgs) { + //Check that we have an snippet instance + if (($snippet = $eventArgs->getEntity()) instanceof Snippet) { + //Set updated value + $snippet->setUpdated(new \DateTime('now')); + } + } }