public function deleteAction() { $this->_helper->viewRenderer->setNoRender(); $this->_helper->getHelper('layout')->disableLayout(); $topicGroupId = $this->_getParam("id"); $message = ""; if ($topicGroupId) { //Check belong this user $topicGroupTbl = new VC_DbTable_Store_TopicGroup(); $getTopic = $topicGroupTbl->fetchRow("id = " . $topicGroupId . " AND user_id = " . $this->userId); if ($getTopic) { $topicGroupTbl->delete("id = " . $topicGroupId); //Delete all topic of this $topicTbl = new VC_DbTable_Store_Topic(); $topicTbl->deleteTopicByTopicGroup($topicGroupId); $this->_helper->flashMessenger->addMessage(array('manage' => "Bạn đã xóa thành công.")); } else { $this->_helper->flashMessenger->addMessage(array('manage' => "Thông tin nhóm chủ đề không hợp lệ.")); } } else { $this->_helper->flashMessenger->addMessage(array('manage' => "Thông tin nhóm chủ đề không hợp lệ.")); } $this->_redirect("topic-group/index"); }