Role delete

@param $id
@return \yii\web\Response
488286
public function actionDelete($id) {
    Yii::$app->authManager->getRole($id);
    //if (Yii::$app->authManager->remove($id)) {
    //  Yii::$app->session->setFlash('success', 'Роль удалена');
    //}

    Yii::$app->session->setFlash('success', 'Удаление ролей не возможно');

    return $this->redirect(['index']);
  }
380938
public function destroy($id)
    {
        $currentUser = $this->users->getUser();

        if ($currentUser->id === (int) $id)
        {
            return Redirect::back()
                ->with('error', Lang::get('cpanel::users.delete_denied') );
        }

        try
        {
            $this->users->delete($id);
            return Redirect::route('cpanel.users.index')
                ->with('success',Lang::get('cpanel::users.delete_success'));
        }
        catch (UserNotFoundException $e)
        {
            return Redirect::route('cpanel.users.index')
                ->with('error',$e->getMessage());
        }
    }
678531
public function delete($id)
    {
        $data = $this->findById($id);

        $this->client
            ->DebtorContact_Delete(array(
                "debtorContactHandle" => $data->Handle
            ));

        return true;
    }
1069175
public function removeRole($id, $role)
    {
        $user = $this->getUser($id);

        if (empty($user) || empty($role)) {
            return false;
        }

        // Remove the role from the $user['roles'] array.
        $user['roles'] = array_diff($user['roles'], [(string) $role]);

        return $this->saveUser($user);
    }
220171
public function actionDelete($id)
    {
        $model = $this->findModel($id);
        $model->pageSize = intval($this->module->params['pageSizeAdmin']);
        $page = $model->calcPage();
        $result = $model->delete();
        if ($result) {
            Yii::$app->session->setFlash('success', Yii::t($this->tcModule, 'User #{id} deleted.', ['id' => $id]));
        } else {
            Yii::$app->session->setFlash('error', Yii::t($this->tcModule, 'Deletion user #{id} fail.', ['id' => $id]));
        }
        return $this->redirect(['index', 'id' => $id, 'page' => $page]);
    }
16432
public function actionDelete($id)
    {
        $ret = $this->findModel($id)->delete();
        if($ret === false)
        {
            Yii::$app->session->setFlash('error', Module::t('message', 'Failed to delete!') . ' (ID = '.$id.')');
        }else{
            Yii::$app->session->setFlash('success', Module::t('message', 'Successfully deleted.') . ' (ID = '.$id.')');
        }

        return $this->redirect(['index']);
    }
539176
public function delete($id)
    {
        try {
            $this->permissionRepositoryInterface->delete($id);
        } catch (PermissionsException $e) {
            Flash::error($e->getMessage());

            return redirect()->route('permissions.index');
        }

        Flash::success(trans('dashboard::dashboard.flash.permission.delete.success'));

        return redirect()->route('permissions.index');
    }
826091
public function remove($id) {
		$event  = $this->getProfiler()->startDelete('Remove: ' . $id);
		$result = $this->getBackend()->remove($id);
		
		if ($result === false) {
			$event->stopError();
		} else {
			$event->stopSuccess();
		}
		
		return $result;
	}
806564
public function delete($id)
    {
        if ($this->hasDeleteTrait($this->modelInstance)) {
            return $this->destroy($id);
        }

        return $this->modelInstance->destroy($id);
    }
282394
public function delete($id)
	{
		Yii::trace('Deleting "'.$id.'" from cache','system.caching.'.get_class($this));
		return $this->deleteValue($this->generateUniqueKey($id));
	}
194529
public function delete($id)
    {
        $idName = ucfirst($this->idProperty->getName());
        return $this->__call("deleteBy$idName", array($id));
    }
404391
public function deleteAction($id)
    {
        $em = $this->getDoctrine()->getManager();
        $em->remove($this->getImage($id));
        $em->flush();

        return new Response();
    }
1258667
public function destroy($id)
    {
        // get role by id
        $role = Role::find($id);

        if (!$role) {
            return response()->json(null, 404);
        }

        // delete role
        $deleteRole = $role->delete();

        if (!$deleteRole) {
            return response()->json(null, 500); // @codeCoverageIgnore
        }

        return response()->json(null, 204);
    }
1259047
public function actionDelete($id)
    {
        $model = $this->findModel($id);
        Yii::$app->getAuthManager()->remove($model->item);
        Helper::invalidate();

        return $this->redirect(['index']);
    }
691227
public function delete()
    {

        // Remove the Role from users, permissions
        // and affiliations that it had
        $this->groups()->detach();
        $this->permissions()->detach();
        $this->affiliations()->detach();

        return parent::delete();
    }
1026359
public function delete($id)
    {
        try
        {
            $perm = $this->model->findOrFail($id);
            $oldData = $perm;
            $perm->delete();
            $this->event->fire('permissions.delete', array($oldData));

            return true;
        }
        catch ( ModelNotFoundException $e)
        {
            return false;
        }
    }
587677
public function actionDelete($id = null)
    {
        $model = User::find()->where(['id' => $id])->limit(1)->one();
        if (empty($model)) {
            $this->error(Yii::t('podium/flash', 'Sorry! We can not find Member with this ID.'));
            return $this->redirect(['admin/members']);
        }
        if ($model->id == User::loggedId()) {
            $this->error(Yii::t('podium/flash', 'Sorry! You can not delete your own account.'));
            return $this->redirect(['admin/members']);
        }
        if ($model->delete()) {
            PodiumCache::clearAfter('userDelete');
            Activity::deleteUser($model->id);
            Log::info('User deleted', $model->id, __METHOD__);
            $this->success(Yii::t('podium/flash', 'User has been deleted.'));
        } else {
            Log::error('Error while deleting user', $model->id, __METHOD__);
            $this->error(Yii::t('podium/flash', 'Sorry! There was some error while deleting the user.'));
        }
        return $this->redirect(['admin/members']);
    }