| 1 | <?php |
||
| 20 | class Query |
||
| 21 | { |
||
| 22 | /** |
||
| 23 | * Task Repository |
||
| 24 | * |
||
| 25 | * @var TaskRepositoryInterface |
||
| 26 | */ |
||
| 27 | protected $taskRepository; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Query constructor |
||
| 31 | * |
||
| 32 | * @param TaskRepositoryInterface $taskRepository Task Repository |
||
| 33 | */ |
||
| 34 | public function __construct(TaskRepositoryInterface $taskRepository) |
||
| 39 | |||
| 40 | /** |
||
| 41 | * Get tasks with remaining status |
||
| 42 | * |
||
| 43 | * @return array |
||
| 44 | */ |
||
| 45 | public function getAllRemainingTasks() : array |
||
| 49 | |||
| 50 | /** |
||
| 51 | * Get tasks with completed status |
||
| 52 | * |
||
| 53 | * @return array |
||
| 54 | */ |
||
| 55 | public function getAllCompletedTasks() : array |
||
| 59 | |||
| 60 | /** |
||
| 61 | * Get task object by Id |
||
| 62 | * |
||
| 63 | * @param string $taskId Task ID |
||
| 64 | * |
||
| 65 | * @return Task |
||
| 66 | * @throws TaskNotFoundException |
||
| 67 | */ |
||
| 68 | public function getTaskById($taskId) : Task |
||
| 78 | } |
||
| 79 |