Added search in comments

This commit is contained in:
Frederic Guillot
2016-04-09 23:24:26 -04:00
parent 11858be4e8
commit 7705f4c533
5 changed files with 116 additions and 6 deletions

View File

@@ -0,0 +1,41 @@
<?php
namespace Kanboard\Filter;
use Kanboard\Core\Filter\FilterInterface;
use Kanboard\Model\Comment;
use Kanboard\Model\Task;
/**
* Filter tasks by comment
*
* @package filter
* @author Frederic Guillot
*/
class TaskCommentFilter extends BaseFilter implements FilterInterface
{
/**
* Get search attribute
*
* @access public
* @return string[]
*/
public function getAttributes()
{
return array('comment');
}
/**
* Apply filter
*
* @access public
* @return FilterInterface
*/
public function apply()
{
$this->query->ilike(Comment::TABLE.'.comment', '%'.$this->value.'%');
$this->query->join(Comment::TABLE, 'task_id', 'id', Task::TABLE);
return $this;
}
}