/** * Returns Post with the corrsponding ID * * @param int $postId * @return PostInterface * @throws \InvalidArgumentException */ public function getPost($postId) { if (!is_int($postId)) { throw new \InvalidArgumentException('Post id must be an integer'); } $post = $this->postMapper->find($postId); return $post; }
/** * {@inheritDoc} */ public function findPost($id) { $post = $this->postMapper->find($id); if (!$post) { throw new InvalidArgumentException("No Post Found!"); } return $post; }
/** * @param int $id * @return PostInterface */ public function findPost($id) { return $this->postMapper->find($id); }