diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-07-14 11:29:15 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-07-14 11:29:15 -0400 |
commit | 48ee733f9e2d0519150a881b18bf5510d6ed8e29 (patch) | |
tree | d26e4ba4c1d7e9913c0be5662d747e1781de3283 /app/Filter | |
parent | 3622c32f9975555db259dbef48522ce4bbec4993 (diff) |
Added search filter for task priority
Diffstat (limited to 'app/Filter')
-rw-r--r-- | app/Filter/TaskPriorityFilter.php | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/app/Filter/TaskPriorityFilter.php b/app/Filter/TaskPriorityFilter.php new file mode 100644 index 00000000..75f6ae3d --- /dev/null +++ b/app/Filter/TaskPriorityFilter.php @@ -0,0 +1,38 @@ +<?php + +namespace Kanboard\Filter; + +use Kanboard\Core\Filter\FilterInterface; +use Kanboard\Model\TaskModel; + +/** + * Class TaskPriorityFilter + * + * @package Kanboard\Filter + * @author Frederic Guillot + */ +class TaskPriorityFilter extends BaseFilter implements FilterInterface +{ + /** + * Get search attribute + * + * @access public + * @return string[] + */ + public function getAttributes() + { + return array('priority'); + } + + /** + * Apply filter + * + * @access public + * @return FilterInterface + */ + public function apply() + { + $this->query->eq(TaskModel::TABLE.'.priority', $this->value); + return $this; + } +} |