diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-04-10 12:13:42 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-04-10 12:13:42 -0400 |
commit | 2eadfb22912d94e76a479b694070735fbb0298f1 (patch) | |
tree | 4280c1bc33851da2188f4bc0aa49310a5923e021 /app/Filter/ProjectActivityTaskTitleFilter.php | |
parent | 7b74f55a285d2785f83be148abdeab95e2b4a7c6 (diff) |
Refactor ProjectActivity model to use Filter and Formatter interface
Diffstat (limited to 'app/Filter/ProjectActivityTaskTitleFilter.php')
-rw-r--r-- | app/Filter/ProjectActivityTaskTitleFilter.php | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/app/Filter/ProjectActivityTaskTitleFilter.php b/app/Filter/ProjectActivityTaskTitleFilter.php new file mode 100644 index 00000000..ed3f36d6 --- /dev/null +++ b/app/Filter/ProjectActivityTaskTitleFilter.php @@ -0,0 +1,38 @@ +<?php + +namespace Kanboard\Filter; + +use Kanboard\Core\Filter\FilterInterface; +use Kanboard\Model\Task; + +/** + * Filter activity events by task title + * + * @package filter + * @author Frederic Guillot + */ +class ProjectActivityTaskTitleFilter extends BaseFilter implements FilterInterface +{ + /** + * Get search attribute + * + * @access public + * @return string[] + */ + public function getAttributes() + { + return array('title'); + } + + /** + * Apply filter + * + * @access public + * @return FilterInterface + */ + public function apply() + { + $this->query->ilike(Task::TABLE.'.title', '%'.$this->value.'%'); + return $this; + } +} |