summaryrefslogtreecommitdiff
path: root/app/Event/ProjectModificationDateListener.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Event/ProjectModificationDateListener.php')
-rw-r--r--app/Event/ProjectModificationDateListener.php30
1 files changed, 30 insertions, 0 deletions
diff --git a/app/Event/ProjectModificationDateListener.php b/app/Event/ProjectModificationDateListener.php
new file mode 100644
index 00000000..abc176b0
--- /dev/null
+++ b/app/Event/ProjectModificationDateListener.php
@@ -0,0 +1,30 @@
+<?php
+
+namespace Event;
+
+/**
+ * Project modification date listener
+ *
+ * Update the "last_modified" field for a project
+ *
+ * @package event
+ * @author Frederic Guillot
+ */
+class ProjectModificationDateListener extends Base
+{
+ /**
+ * Execute the action
+ *
+ * @access public
+ * @param array $data Event data dictionary
+ * @return bool True if the action was executed or false when not executed
+ */
+ public function execute(array $data)
+ {
+ if (isset($data['project_id'])) {
+ return $this->project->updateModificationDate($data['project_id']);
+ }
+
+ return false;
+ }
+}