summaryrefslogtreecommitdiff
path: root/app/Model/TaskFilter.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-07-04 17:35:52 -0400
committerFrederic Guillot <fred@kanboard.net>2015-07-04 17:35:52 -0400
commit198f3eda90807c0295a013cd4ebdc3806545d608 (patch)
tree07420711d703bf71f0b1596a891ec6957c71719b /app/Model/TaskFilter.php
parent0e5756ecc162a8428e6ab3820562f45ef17f9e8b (diff)
Add search attribute to search by reference
Diffstat (limited to 'app/Model/TaskFilter.php')
-rw-r--r--app/Model/TaskFilter.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/app/Model/TaskFilter.php b/app/Model/TaskFilter.php
index e9d9ccbd..0bac3f46 100644
--- a/app/Model/TaskFilter.php
+++ b/app/Model/TaskFilter.php
@@ -68,6 +68,9 @@ class TaskFilter extends Base
case 'T_COLUMN':
$this->filterByColumnName($value);
break;
+ case 'T_REFERENCE':
+ $this->filterByReference($value);
+ break;
}
}
@@ -141,6 +144,22 @@ class TaskFilter extends Base
}
/**
+ * Filter by reference
+ *
+ * @access public
+ * @param string $reference
+ * @return TaskFilter
+ */
+ public function filterByReference($reference)
+ {
+ if (! empty($reference)) {
+ $this->query->eq(Task::TABLE.'.reference', $reference);
+ }
+
+ return $this;
+ }
+
+ /**
* Filter by title
*
* @access public