/** * @inheritdoc */ public function getById(\string $id) : CustomerView { $key = self::KEY . ':' . $id; if ($this->client->exists($key)) { $item = $this->client->hgetall($key); $model = $this->createViewModel($item); } else { $model = $this->repository->getById($id); $this->save($model); } return $model; }
public function getActualCustomer(GetActualCustomerQuery $query) { $user = $this->getActualUser(); $result = $this->viewRepository->getById($user->getId()); $query->setResult($result); }