Example #1
0
 protected function _postDelete()
 {
     $tblPollIp = new App_Model_Db_Table_PollIp();
     $tblPollIp->delete("pollGuid='" . $this->guid . "'");
     $tblPollOpt = new App_Model_Db_Table_PollOption();
     $tblPollOpt->delete("pollGuid='" . $this->guid . "'");
 }
Example #2
0
 public function deleteAction()
 {
     $this->_helper->getHelper('layout')->disableLayout();
     $this->_helper->getHelper('viewRenderer')->setNoRender();
     $this->preProcessSession();
     $request = $this->getRequest();
     $result = 'RESULT_ERROR';
     if ($request->isPost()) {
         $guid = $request->getPost('guid');
         $ids = array();
         $ids = Zend_Json::decode($guid);
         $pollingDb = new App_Model_Db_Table_Poll();
         $pollingOptionDb = new App_Model_Db_Table_PollOption();
         foreach ($ids as $pollId) {
             $pollingDb->delete(['guid=?' => $pollId]);
             $pollingOptionDb->delete(['pollGuid=?' => $pollId]);
         }
         $result = 'RESULT_OK';
     }
     $this->getResponse()->setBody($result);
 }