diff options
Diffstat (limited to 'app/Filter/TaskReferenceFilter.php')
-rw-r--r-- | app/Filter/TaskReferenceFilter.php | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/app/Filter/TaskReferenceFilter.php b/app/Filter/TaskReferenceFilter.php new file mode 100644 index 00000000..4ad47dd5 --- /dev/null +++ b/app/Filter/TaskReferenceFilter.php @@ -0,0 +1,38 @@ +<?php + +namespace Kanboard\Filter; + +use Kanboard\Core\Filter\FilterInterface; +use Kanboard\Model\Task; + +/** + * Filter tasks by reference + * + * @package filter + * @author Frederic Guillot + */ +class TaskReferenceFilter extends BaseFilter implements FilterInterface +{ + /** + * Get search attribute + * + * @access public + * @return string[] + */ + public function getAttributes() + { + return array('reference', 'ref'); + } + + /** + * Apply filter + * + * @access public + * @return FilterInterface + */ + public function apply() + { + $this->query->eq(Task::TABLE.'.reference', $this->value); + return $this; + } +} |