public function deleteAction() { $form = $this->view->form = new Yntour_Form_Admin_Tour_Delete(); // In smoothbox $this->_helper->layout->setLayout('admin-simple'); $id = $this->_getParam('id'); $model = new Yntour_Model_DbTable_Tours(); // Check post if ($this->getRequest()->isPost()) { $db = $model->getAdapter(); $db->beginTransaction(); try { $item = $model->find($id)->current(); // delete the blog entry into the database $item->delete(); $db->commit(); } catch (Exception $e) { $db->rollBack(); throw $e; } $this->_forward('success', 'utility', 'core', array('smoothboxClose' => 10, 'parentRefresh' => 10, 'messages' => array('Successful.'))); } }
public function getTourOptions() { $model = new Yntour_Model_DbTable_Tours(); $select = $model->select()->from($model->info('name'), array('tour_id', 'title')); return $model->getAdapter()->fetchPairs($select); }