/** * Execute the action */ public function execute() { $this->id = $this->getParameter('id', 'int'); // does the item exist if ($this->id !== null && BackendAddressesModel::existsGroup($this->id)) { parent::execute(); $this->record = (array) BackendAddressesModel::getGroup($this->id); BackendAddressesModel::deleteGroup($this->id); BackendAddressesModel::deleteAddressesFromGroup($this->id); BackendModel::triggerEvent($this->getModule(), 'after_delete_group', array('id' => $this->id)); $this->redirect(BackendModel::createURLForAction('groups') . '&report=deleted&var=' . urlencode($this->record['title'])); } else { $this->redirect(BackendModel::createURLForAction('groups') . '&error=non-existing'); } }