diff options
author | Frédéric Guillot <fred@kanboard.net> | 2014-10-12 15:32:35 -0400 |
---|---|---|
committer | Frédéric Guillot <fred@kanboard.net> | 2014-10-12 15:32:35 -0400 |
commit | 4061927d215c846ff8eb196301bf61532018042b (patch) | |
tree | 0e14a0e458ee8739754f75f8c158cc42a9b593a4 /jsonrpc.php | |
parent | b7060b33ef317eeac576c504b1fb840d4471e411 (diff) |
Move some Task model methods to the TaskFinder class
Diffstat (limited to 'jsonrpc.php')
-rw-r--r-- | jsonrpc.php | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/jsonrpc.php b/jsonrpc.php index f577ef82..99d14806 100644 --- a/jsonrpc.php +++ b/jsonrpc.php @@ -6,6 +6,7 @@ use JsonRPC\Server; use Model\Project; use Model\ProjectPermission; use Model\Task; +use Model\TaskFinder; use Model\TaskValidator; use Model\User; use Model\Config; @@ -24,6 +25,7 @@ $config->setupTimezone(); $project = new Project($registry); $projectPermission = new ProjectPermission($registry); $task = new Task($registry); +$taskFinder = new TaskFinder($registry); $taskValidator = new TaskValidator($registry); $user = new User($registry); $category = new Category($registry); @@ -178,12 +180,12 @@ $server->register('createTask', function($title, $project_id, $color_id = '', $c return $valid && $task->create($values) !== false; }); -$server->register('getTask', function($task_id) use ($task) { - return $task->getById($task_id); +$server->register('getTask', function($task_id) use ($taskFinder) { + return $taskFinder->getById($task_id); }); -$server->register('getAllTasks', function($project_id, $status) use ($task) { - return $task->getAll($project_id, $status); +$server->register('getAllTasks', function($project_id, $status) use ($taskFinder) { + return $taskFinder->getAll($project_id, $status); }); $server->register('updateTask', function($id, $title = null, $project_id = null, $color_id = null, $column_id = null, $owner_id = null, $creator_id = null, $date_due = null, $description = null, $category_id = null, $score = null) use ($task, $taskValidator) { |