Files
Kanboard-Prod/app/Filter/UserNameFilter.php
Frederic Guillot 11858be4e8 Filter refactoring
2016-04-09 22:42:17 -04:00

36 lines
645 B
PHP

<?php
namespace Kanboard\Filter;
use Kanboard\Core\Filter\FilterInterface;
class UserNameFilter extends BaseFilter implements FilterInterface
{
/**
* Get search attribute
*
* @access public
* @return string[]
*/
public function getAttributes()
{
return array('name');
}
/**
* Apply filter
*
* @access public
* @return FilterInterface
*/
public function apply()
{
$this->query->beginOr()
->ilike('username', '%'.$this->value.'%')
->ilike('name', '%'.$this->value.'%')
->closeOr();
return $this;
}
}