/** * @param Query|UserQuery $query * * @return Resource */ public function handle(Query $query) { $data = $this->repository->findUser($query->getId()); return new Resource($data, $this->serializer); }
/** * @param Query|PictureQuery $query * * @return Resource */ public function handle(Query $query) { $data = $this->repository->findOneUserPicture($query->getUserId(), $query->getFormat()); return new Resource($data, $this->serializer); }
/** * @param Query $query * * @return Collection */ public function handle(Query $query) { $data = $this->repository->findFriends($query->getUserId(), $query->getPageNumber(), $query->getPageSize()); return new Collection($data, $this->serializer); }
/** * @param Query $query * * @return LegacyCollection */ public function handle(Query $query) { $data = $this->repository->findUserPictures($query->getUserId()); return new Collection($data, $this->serializer); }