for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Todo\Application\Task;
use Todo\Domain\Repository\TaskRepositoryInterface;
use Todo\Domain\Task;
/**
* Class Query
*
* @category None
* @package Application\Task
* @author Martin Pham <[email protected]>
* @license None http://
* @link None
*/
class Query
{
* Task Repository
* @var TaskRepositoryInterface
protected $taskRepository;
* Query constructor
* @param TaskRepositoryInterface $taskRepository Task Repository
public function __construct(TaskRepositoryInterface $taskRepository)
$this->taskRepository = $taskRepository;
}
* Get All Remaining Tasks
* @return array
public function getAllRemainingTasks() : array
return $this->taskRepository->findAllByStatus(Task::STATUS_REMAINING);
* Get All Completed Tasks
public function getAllCompletedTasks() : array
return $this->taskRepository->findAllByStatus(Task::STATUS_COMPLETED);