Exemple #1
0
 /**
  * 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;
 }
Exemple #2
0
 /**
  * {@inheritDoc}
  */
 public function findPost($id)
 {
     $post = $this->postMapper->find($id);
     if (!$post) {
         throw new InvalidArgumentException("No Post Found!");
     }
     return $post;
 }
Exemple #3
0
 /**
  * @param int $id
  * @return PostInterface
  */
 public function findPost($id)
 {
     return $this->postMapper->find($id);
 }