summaryrefslogtreecommitdiff
path: root/app/Event/TaskModification.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Event/TaskModification.php')
-rw-r--r--app/Event/TaskModification.php51
1 files changed, 51 insertions, 0 deletions
diff --git a/app/Event/TaskModification.php b/app/Event/TaskModification.php
new file mode 100644
index 00000000..b1d412c7
--- /dev/null
+++ b/app/Event/TaskModification.php
@@ -0,0 +1,51 @@
+<?php
+
+namespace Event;
+
+use Core\Listener;
+use Model\Project;
+
+/**
+ * Task modification listener
+ *
+ * @package events
+ * @author Frederic Guillot
+ */
+class TaskModification implements Listener
+{
+ /**
+ * Project model
+ *
+ * @accesss private
+ * @var \Model\Project
+ */
+ private $project;
+
+ /**
+ * Constructor
+ *
+ * @access public
+ * @param \Model\Project $project Project model instance
+ */
+ public function __construct(Project $project)
+ {
+ $this->project = $project;
+ }
+
+ /**
+ * 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'])) {
+ $this->project->updateModificationDate($data['project_id']);
+ return true;
+ }
+
+ return false;
+ }
+}