summaryrefslogtreecommitdiff
path: root/app/Filter/TaskSubtaskAssigneeFilter.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-05-28 19:48:22 -0400
committerFrederic Guillot <fred@kanboard.net>2016-05-28 19:48:22 -0400
commit14713b0ec7ed93ca45578da069ad4e19a7d8addf (patch)
tree79972d53f6091a1ddb17f64a6a05a5523f5d5168 /app/Filter/TaskSubtaskAssigneeFilter.php
parent936376ffe74c583d3cb819e98f53a85137fdf8bc (diff)
Rename all models
Diffstat (limited to 'app/Filter/TaskSubtaskAssigneeFilter.php')
-rw-r--r--app/Filter/TaskSubtaskAssigneeFilter.php34
1 files changed, 17 insertions, 17 deletions
diff --git a/app/Filter/TaskSubtaskAssigneeFilter.php b/app/Filter/TaskSubtaskAssigneeFilter.php
index 4c757315..46553a3d 100644
--- a/app/Filter/TaskSubtaskAssigneeFilter.php
+++ b/app/Filter/TaskSubtaskAssigneeFilter.php
@@ -3,9 +3,9 @@
namespace Kanboard\Filter;
use Kanboard\Core\Filter\FilterInterface;
-use Kanboard\Model\Subtask;
-use Kanboard\Model\Task;
-use Kanboard\Model\User;
+use Kanboard\Model\SubtaskModel;
+use Kanboard\Model\TaskModel;
+use Kanboard\Model\UserModel;
use PicoDb\Database;
use PicoDb\Table;
@@ -81,9 +81,9 @@ class TaskSubtaskAssigneeFilter extends BaseFilter implements FilterInterface
$task_ids = $this->getSubQuery()->findAllByColumn('task_id');
if (! empty($task_ids)) {
- $this->query->in(Task::TABLE.'.id', $task_ids);
+ $this->query->in(TaskModel::TABLE.'.id', $task_ids);
} else {
- $this->query->eq(Task::TABLE.'.id', 0); // No match
+ $this->query->eq(TaskModel::TABLE.'.id', 0); // No match
}
}
@@ -95,15 +95,15 @@ class TaskSubtaskAssigneeFilter extends BaseFilter implements FilterInterface
*/
protected function getSubQuery()
{
- $subquery = $this->db->table(Subtask::TABLE)
+ $subquery = $this->db->table(SubtaskModel::TABLE)
->columns(
- Subtask::TABLE.'.user_id',
- Subtask::TABLE.'.task_id',
- User::TABLE.'.name',
- User::TABLE.'.username'
+ SubtaskModel::TABLE.'.user_id',
+ SubtaskModel::TABLE.'.task_id',
+ UserModel::TABLE.'.name',
+ UserModel::TABLE.'.username'
)
- ->join(User::TABLE, 'id', 'user_id', Subtask::TABLE)
- ->neq(Subtask::TABLE.'.status', Subtask::STATUS_DONE);
+ ->join(UserModel::TABLE, 'id', 'user_id', SubtaskModel::TABLE)
+ ->neq(SubtaskModel::TABLE.'.status', SubtaskModel::STATUS_DONE);
return $this->applySubQueryFilter($subquery);
}
@@ -118,19 +118,19 @@ class TaskSubtaskAssigneeFilter extends BaseFilter implements FilterInterface
protected function applySubQueryFilter(Table $subquery)
{
if (is_int($this->value) || ctype_digit($this->value)) {
- $subquery->eq(Subtask::TABLE.'.user_id', $this->value);
+ $subquery->eq(SubtaskModel::TABLE.'.user_id', $this->value);
} else {
switch ($this->value) {
case 'me':
- $subquery->eq(Subtask::TABLE.'.user_id', $this->currentUserId);
+ $subquery->eq(SubtaskModel::TABLE.'.user_id', $this->currentUserId);
break;
case 'nobody':
- $subquery->eq(Subtask::TABLE.'.user_id', 0);
+ $subquery->eq(SubtaskModel::TABLE.'.user_id', 0);
break;
default:
$subquery->beginOr();
- $subquery->ilike(User::TABLE.'.username', $this->value.'%');
- $subquery->ilike(User::TABLE.'.name', '%'.$this->value.'%');
+ $subquery->ilike(UserModel::TABLE.'.username', $this->value.'%');
+ $subquery->ilike(UserModel::TABLE.'.name', '%'.$this->value.'%');
$subquery->closeOr();
}
}