/** * Execute the action */ public function execute() { $this->id = $this->getParameter('id', 'int'); if ($this->id !== null && BackendFaqModel::exists($this->id)) { parent::execute(); $this->record = BackendFaqModel::get($this->id); // delete item BackendFaqModel::delete($this->id); BackendModel::triggerEvent($this->getModule(), 'after_delete', array('item' => $this->record)); $this->redirect(BackendModel::createURLForAction('index') . '&report=deleted&var=' . urlencode($this->record['question'])); } else { $this->redirect(BackendModel::createURLForAction('index') . '&error=non-existing'); } }