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