Example #1
0
 /**
  * @return post
  */
 public function getNewBloggPost()
 {
     $post = new \blogg\model\blogg\Post(intval($this->getCleanInput($this->idPost)));
     $post->setText($this->getCleanInput($this->textPost));
     $post->setTitel($this->getCleanInput($this->titelPost));
     return $post;
 }
 public function getBloggPostById($id)
 {
     $postdbo = $this->findBy('id', $id);
     if ($postdbo !== null) {
         $post = new \blogg\model\blogg\Post($postdbo['id'], $postdbo['user_id']);
         $post->setTitel($postdbo['titel']);
         $post->setText($postdbo['text']);
         $post->setTime($postdbo['time']);
         return $post;
     }
     return null;
 }