| <?php |
|
|
| namespace Kanboard\Filter; |
|
|
| use Kanboard\Core\Filter\FilterInterface; |
| use Kanboard\Model\ProjectModel; |
| use Kanboard\Model\TaskModel; |
|
|
| |
| |
| |
| |
| |
| |
| class TaskProjectFilter extends BaseFilter implements FilterInterface |
| { |
| |
| |
| |
| |
| |
| |
| public function getAttributes() |
| { |
| return array('project'); |
| } |
|
|
| |
| |
| |
| |
| |
| |
| public function apply() |
| { |
| |
| |
| if (is_int($this->value) || ctype_digit((string) $this->value) && $this->value < 2147483647) { |
| $this->query->eq(TaskModel::TABLE.'.project_id', $this->value); |
| } else { |
| $this->query->ilike(ProjectModel::TABLE.'.name', $this->value); |
| } |
|
|
| return $this; |
| } |
| } |
|
|