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