From 198f3eda90807c0295a013cd4ebdc3806545d608 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 4 Jul 2015 17:35:52 -0400 Subject: Add search attribute to search by reference --- app/Model/TaskFilter.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'app/Model') 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; } } @@ -140,6 +143,22 @@ class TaskFilter extends Base return $this; } + /** + * 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 * -- cgit v1.2.3