public function getCategoryById(GetCategoryByIdQuery $query) { $result = $this->repository->getById($query->getId()); $query->setResult($result); }
private function getCategoryById($id) { if ($id) { $query = new GetCategoryByIdQuery($id); if ($query->getId()) { $this->queryBus->handle($query); } return $query->getResult(); } return null; }