Refactor ProjectActivity model to use Filter and Formatter interface

This commit is contained in:
Frederic Guillot
2016-04-10 12:13:42 -04:00
parent 7b74f55a28
commit 2eadfb2291
23 changed files with 649 additions and 212 deletions

View File

@@ -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;
}
}