Exemplo n.º 1
0
 public function removeTravelWallPostAction()
 {
     $this->_helper->layout->disableLayout();
     $this->_helper->viewRenderer->setNoRender(true);
     $params = $this->getRequest()->getParams();
     $postId = $params['postId'];
     $objModelWall = new Application_Model_Wall();
     $objModelVote = new Application_Model_Vote();
     $objModelComment = new Application_Model_Comment();
     $whereWall = "id='{$postId}'";
     $whereVote = "item_id='{$postId}' AND item_type='status'";
     $whereComment = "item_id='{$postId}' AND item_type='status'";
     $arrComment = $objModelComment->fetchAll($whereComment);
     if (!empty($arrComment)) {
         foreach ($arrComment as $cmt) {
             $whereVt = "item_id='{$cmt->id}' AND item_type='status_comment'";
             $objModelVote->delete($whereVt);
         }
     }
     $objModelVote->delete($whereVote);
     $objModelComment->delete($whereComment);
     $objModelWall->delete($whereWall);
     exit;
 }