Backend\Modules\Profiles\Actions\DeleteGroup::execute PHP Метод

execute() публичный Метод

Execute the action.
public execute ( )
    public function execute()
    {
        // get parameters
        $this->id = $this->getParameter('id', 'int');
        // does the item exist
        if ($this->id !== null && BackendProfilesModel::existsGroup($this->id)) {
            // call parent, this will probably add some general CSS/JS or other required files
            parent::execute();
            // get group
            $group = BackendProfilesModel::getGroup($this->id);
            // delete group
            BackendProfilesModel::deleteGroup($this->id);
            // trigger event
            BackendModel::triggerEvent($this->getModule(), 'after_delete_group', array('id' => $this->id));
            // group was deleted, so redirect
            $this->redirect(BackendModel::createURLForAction('Groups') . '&report=deleted&var=' . rawurlencode($group['name']));
        } else {
            $this->redirect(BackendModel::createURLForAction('Groups') . '&error=non-existing');
        }
    }
DeleteGroup