Esempio n. 1
0
 public function listAction()
 {
     $this->_disableRender();
     $json = new ZendT_Json_Result();
     try {
         $_notificacao = $this->getMapper();
         if ($this->getRequest()->getParam('count')) {
             $result = array('qtd' => $_notificacao->count());
         } else {
             $arrayResult = $_notificacao->feeds();
             $result = Cms_Helper_Feeds::feeds($arrayResult);
             if (!$result) {
                 $result = "Você não possui nenhuma notificação!";
             }
         }
         $json->setResult($result);
     } catch (Exception $ex) {
         $json->setException($ex);
     }
     echo $json->render();
 }