|
<?php |
|
|
|
namespace Kanboard\Filter; |
|
|
|
use Kanboard\Core\Filter\FilterInterface; |
|
use Kanboard\Model\ColumnModel; |
|
use Kanboard\Model\TaskModel; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class TaskColumnFilter extends BaseFilter implements FilterInterface |
|
{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
public function getAttributes() |
|
{ |
|
return array('column'); |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function apply() |
|
{ |
|
if (is_int($this->value) || ctype_digit((string) $this->value)) { |
|
$this->query->eq(TaskModel::TABLE.'.column_id', $this->value); |
|
} else { |
|
$this->query->eq(ColumnModel::TABLE.'.title', $this->value); |
|
} |
|
|
|
return $this; |
|
} |
|
} |
|
|