Esempio n. 1
0
 public function showAction()
 {
     $posts = new Application_Model_Posts();
     //Pega todos os posts
     $listaPost = $posts->fetchAll();
     //Pega o primeiro post
     $post = $listaPost->getRow(0);
     //busca todos os comentarios relacionados com o post
     $listaPostComments = $post->findDependentRowset('Application_Model_Comments');
     //Coloca na variavel post
     $this->view->comments = $listaPostComments;
 }
Esempio n. 2
0
 /**
  * Método utilizado para exibir todos os registros do banco de dados.
  * @method retrieveAction
  * @access public
  * @return array $data
  */
 public function retrieveAction()
 {
     $post = new Application_Model_Posts();
     $data = $post->fetchAll();
     $this->view->data = $data;
 }