Page du formulaire de suppression d'un groupe

@param integer $id Identifiant du groupe
@return \Symfony\Component\HttpFoundation\Response
972441
public function deleteAction ($id)
    {
        if (false === $this->get('security.context')->isGranted('ROLE_SUPER_ADMIN')) {
            throw new AccessDeniedException();
        }
        
        // Récupération de l'objet Group
        $manager = $this->container->get('fos_user.group_manager');
        $group = $manager->findGroupBy(array('id' => $id));
        
        // Création du formulaire
        $form = $this->createFormBuilder()->getForm();
        
        // Validation du formulaire
        $request = $this->getRequest();
        if ($request->getMethod() == 'POST') {
            $form->bind($request);
            if ($form->isValid()) {
                
                $manager->deleteGroup($group);
                
                $this->get('session')->getFlashBag()->set('success', "Le groupe <strong>".$group->getName()."</strong> a été supprimé avec succès");
            }
        }
        
        return $this->redirect($this->generateUrl('olix_security_manager_group_list'));
    }
1209168
public function destroy($id)
    {
    	$group = Permission_group::findOrFail($id);
		$group->delete();
		
		return redirect(url("permission/group"))->with('dp_announce', trans('deeppermission.alert.group.deleted'));
    }
1030052
public function actionRemove(int $id)
    {

        RelatedProduct::deleteAll(['id' => $id]);

        return $this->redirect(\Yii::$app->request->referrer);
    }
630709
public function setSubdomainId( $id )
    {
        $this->subdomainId  = empty( $id ) ? null : (int) $id;
        $this->_uriCache    = null;
        return $this;
    }
889990
public function view($id)
    {
        $component = $this->processor->view($id);

        return response($component['component']->__toString(), 200);
    }
1295209
public function delete_group($id){
		$client = new \GuzzleHttp\Client();

		$response = $client->delete($this->api_endpoint.'issuer/groups/' . $id, array('headers' =>  array('Authorization' => 'Token token="'.$this->getAPIKey().'"')));

		$result = json_decode($response->getBody());

		return $result;
	}
1375015
public function destroy($id)
    {
        if ( $this->permissions->delete($id) )
        {
            return Redirect::route('cpanel.permissions.index')
                ->with('success', Lang::get('cpanel::permissions.delete_success'));
        }
        else
        {
            return Redirect::route('cpanel.permissions.index')
                ->with('error', Lang::get('cpanel::permissions.model_not_found'));
        }
    }
538189
public function destroy($id)
    {
        try {
            $this->content->destroy($id);
        } catch (Exception $e) {
            return $this->handleException($e, trans('soda::errors.delete', ['object' => trans('soda::terminology.content')]));
        }

        return redirect()->back()->with('info', trans('soda::messages.deleted', ['object' => trans('soda::terminology.content')]));
    }
970983
public function deleteDestroy($id) {
    // Delete children if any exist
    Term::whereParent($id)->delete();

    // Delete Term
    Term::destroy($id);

    return Response::make('OK', 200);
  }
867098
protected function handleDomain(&$id) {
		if ($this->idDelimiter === null) {
			return $this->domain;
		}
		
		$delimiterPos = strpos($id, $this->idDelimiter);
		
		if ($delimiterPos === false) {
			return $this->domain;
		}
		
		$domain = substr($id, 0, $delimiterPos);
		$id     = substr($id, $delimiterPos + 1);
		
		return $domain;
	}
1320093
public function destroy($id)
    {
        try {
            $wasSuccessful = $this->repository->delete($id);
            return Response::apiResponse([
                'data' => $wasSuccessful
            ]);
        } catch (\Exception $e) {
            return Response::apiResponse([
                'httpCode' => 400,
                'message' => $e->getMessage()
            ]);
        }
    }
1057217
public function removeMessage(int $id): PodiumResponse
    {
        return $this->getPodium()->message->remove($id, $this->ensureMembership());
    }
906080
public function deleteAction($id)
    {
        $lockManager = $this->get('phlexible_element.element_lock_manager');
        $lock = $lockManager->find($id);

        $lockManager->deleteLock($lock);

        return new ResultResponse(true, 'Lock released.');
    }
687818
public function deleteGroup($groupId)
    {
        return $this->auth(function () use ($groupId) {
            return $this->http->postJson(
                $this->baseUrl . 'cgi-bin/groups/delete?access_token=' . $this->accessToken,
                json_encode(
                    [
                        'group' => [
                            'id' => $groupId,
                        ],
                    ],
                    JSON_UNESCAPED_UNICODE
                )
            );
        });
    }
1034627
function destroy( $id )
	{
		$this->id_format($id);
		$params = array();
		$params['id'] = $id;
		return $this->oauth->post( 'statuses/destroy',  $params );
	}
41388
public function editAction ($id)
    {
        if (false === $this->get('security.context')->isGranted('ROLE_SUPER_ADMIN')) {
            throw new AccessDeniedException();
        }
        
        $manager = $this->container->get('fos_user.group_manager');
        $group = $manager->findGroupBy(array('id' => $id));
        
        // Création du formulaire
        $form = $this->createForm(
            new GroupFormType($manager->getClass(), $this->container->getParameter('security.role_hierarchy.roles')),
            $group
        );
        
        // Récupération des utilisateurs appartenant à ce groupe (@ignore par FOS) et affecte dans le formulaire
        $repository = $this->getDoctrine()->getRepository('OlixSecurityBundle:User');
        $usersInGroup = $repository->findByGroup($group);
        $form->get('users')->setData($usersInGroup);
        
        // Validation du formulaire
        $request = $this->getRequest();
        if ($request->getMethod() == 'POST') {
            $form->bind($request);
            if ($form->isValid()) {
                
                $manager->updateGroup($group);
                
                $manager = $this->container->get('fos_user.user_manager');
                // Enlève tous les utilisateurs courants actuel du groupe
                foreach ($usersInGroup as $user) {
                    $user->removeGroup($group);
                    $manager->updateUser($user);
                }
                // Rajoute les utilisateurs selectionnés dans le groupe
                foreach ($form->get('users')->getData() as $user) {
                    $user->addGroup($group);
                    $manager->updateUser($user);
                }
                
                $this->get('session')->getFlashBag()->set('success', "Le groupe <strong>".$group->getName()."</strong> a été modifié avec succès");
                return $this->redirect($this->generateUrl('olix_security_manager_group_list'));
            }
            $form->addError(new FormError('Tous les champs ne sont pas complètement remplis'));
        }
        
        // Affichage du formulaire
        return $this->container->get('olix.admin')->render('OlixSecurityBundle:GroupManager:edit.html.twig', 'olix_security_groups', array(
            'group'  => $group,
            'form'   => $form->createView(),
        ));
    }
1373605
public function remove($id)
    {
        try {
            Storage::delete($id);
            $response = $this->responseService->apiResponse('success', 'success!');
        } catch (Exception $e) {
            $response = $this->responseService->apiResponse('error', $e->getMessage());
        }

        return $response;
    }