X-Git-Url: https://git.rapsys.eu/airbundle/blobdiff_plain/0efb8d5485db7c2bfca8a1fef10067f058b54e1a..1b7242349ed40063750d8e914a07aa1293f90af7:/Entity/Snippet.php

diff --git a/Entity/Snippet.php b/Entity/Snippet.php
index 20a1940..99bc040 100644
--- a/Entity/Snippet.php
+++ b/Entity/Snippet.php
@@ -29,6 +29,16 @@ class Snippet {
 	 */
 	protected $class;
 
+	/**
+	 * @var string
+	 */
+	protected $short;
+
+	/**
+	 * @var integer
+	 */
+	protected $rate;
+
 	/**
 	 * @var string
 	 */
@@ -144,6 +154,50 @@ class Snippet {
 		return $this->class;
 	}
 
+	/**
+	 * Set short
+	 *
+	 * @param string $short
+	 *
+	 * @return Snippet
+	 */
+	public function setShort($short) {
+		$this->short = $short;
+
+		return $this;
+	}
+
+	/**
+	 * Get short
+	 *
+	 * @return string
+	 */
+	public function getShort() {
+		return $this->short;
+	}
+
+	/**
+	 * Set rate
+	 *
+	 * @param string $rate
+	 *
+	 * @return Snippet
+	 */
+	public function setRate($rate) {
+		$this->rate = $rate;
+
+		return $this;
+	}
+
+	/**
+	 * Get rate
+	 *
+	 * @return string
+	 */
+	public function getRate() {
+		return $this->rate;
+	}
+
 	/**
 	 * Set contact
 	 *
@@ -319,4 +373,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'));
+		}
+	}
 }