Пример #1
0
 public function delCatAction()
 {
     $faqMapper = new FaqMapper();
     $countFaqs = count($faqMapper->getFaqs(array('cat_id' => $this->getRequest()->getParam('id'))));
     if ($countFaqs == 0) {
         if ($this->getRequest()->isSecure()) {
             $categoryMapper = new CategoryMapper();
             $categoryMapper->delete($this->getRequest()->getParam('id'));
             $this->addMessage('deleteSuccess');
             $this->redirect(array('action' => 'index'));
         }
     } else {
         $this->addMessage('deleteFailed', 'danger');
         $this->redirect(array('action' => 'index'));
     }
 }