summaryrefslogtreecommitdiff
path: root/app/Event
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-12-01 22:52:58 -0500
committerFrederic Guillot <fred@kanboard.net>2016-12-01 22:52:58 -0500
commitf73d0d2ac9daee5eaa03a7b89c639678fec46467 (patch)
tree130d67dc841de8200361afb393873924caf7378c /app/Event
parentbe83821ef7885ca45da36f15ea7a26cbf3e33fd9 (diff)
Make user mentions great again
Diffstat (limited to 'app/Event')
-rw-r--r--app/Event/GenericEvent.php22
-rw-r--r--app/Event/ProjectFileEvent.php8
2 files changed, 30 insertions, 0 deletions
diff --git a/app/Event/GenericEvent.php b/app/Event/GenericEvent.php
index 94a51479..e87d9481 100644
--- a/app/Event/GenericEvent.php
+++ b/app/Event/GenericEvent.php
@@ -14,6 +14,28 @@ class GenericEvent extends BaseEvent implements ArrayAccess
$this->container = $values;
}
+ public function getTaskId()
+ {
+ if (isset($this->container['task']['id'])) {
+ return $this->container['task']['id'];
+ }
+
+ if (isset($this->container['task_id'])) {
+ return $this->container['task_id'];
+ }
+
+ return null;
+ }
+
+ public function getProjectId()
+ {
+ if (isset($this->container['task']['project_id'])) {
+ return $this->container['task']['project_id'];
+ }
+
+ return null;
+ }
+
public function getAll()
{
return $this->container;
diff --git a/app/Event/ProjectFileEvent.php b/app/Event/ProjectFileEvent.php
index 5d57e463..e1d29c48 100644
--- a/app/Event/ProjectFileEvent.php
+++ b/app/Event/ProjectFileEvent.php
@@ -4,4 +4,12 @@ namespace Kanboard\Event;
class ProjectFileEvent extends GenericEvent
{
+ public function getProjectId()
+ {
+ if (isset($this->container['file']['project_id'])) {
+ return $this->container['file']['project_id'];
+ }
+
+ return null;
+ }
}