diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-07-04 17:35:52 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-07-04 17:35:52 -0400 |
commit | 198f3eda90807c0295a013cd4ebdc3806545d608 (patch) | |
tree | 07420711d703bf71f0b1596a891ec6957c71719b /app/Model/TaskFilter.php | |
parent | 0e5756ecc162a8428e6ab3820562f45ef17f9e8b (diff) |
Add search attribute to search by reference
Diffstat (limited to 'app/Model/TaskFilter.php')
-rw-r--r-- | app/Model/TaskFilter.php | 19 |
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 |