/** * Fetch a user2note * * @param int $noteId * @throws \InvalidArgumentException * @return ApiProblem|mixed */ public function fetch($noteId) { /** @var Service\User $userService */ $userService = $this->getServiceManager()->get('user-service'); $user = $userService->getUserByMail($this->getIdentity()->getName()); $this->setEntityIdentifierName('userId.noteId'); return parent::fetch($user->getId() . '.' . $noteId); }