Exemplo n.º 1
0
 /**
  * This action shows all blog entries and the depending comment
  * 
  * @param View $view
  * @param array $parameters
  */
 public function actionShowAll(View $view, array $parameters)
 {
     $blogEntry = new BlogEntry($this->database);
     $blogEntries = $blogEntry->getAll();
     $view->setVar('blogEntries', $blogEntries);
     $commentEntry = new Comment($this->database);
     $comments = array();
     foreach ($blogEntries as $blogEntry) {
         $comments[$blogEntry->getId()] = $commentEntry->getAllByBlogEntry($blogEntry);
     }
     $view->setVar('comments', $comments);
     return $view;
 }