@param Request $request
@param string  $groupId

@Config\Route("/remove-group/{groupId}", name="open_orchestra_api_user_remove_group")
@Config\Method({"PUT", "GET"})

@return FacadeInterface
@throws UserNotFoundHttpException
346303
public function removeGroupAction(Request $request, $groupId)
    {
        $format = $request->get('_format', 'json');

        $facade = $this->get('jms_serializer')->deserialize(
            $request->getContent(),
            $this->getParameter('open_orchestra_user_admin.facade.user.class'),
            $format
        );
        $user = $this->get('open_orchestra_api.transformer_manager')->reverseTransform('user', $facade);
        if (!$user instanceof UserInterface) {
            throw new UserNotFoundHttpException();
        }
        $this->denyAccessUnlessGranted(ContributionActionInterface::EDIT, $user);

        $this->get('open_orchestra_user.repository.user')->removeGroup($user->getId(), $groupId);

        return array();
    }
1339294
public function formAction(Request $request, $groupId)
    {
        $group = $this->get('open_orchestra_user.repository.group')->find($groupId);
        $this->denyAccessUnlessGranted(ContributionActionInterface::EDIT, $group);

        $form = $this->createForm('oo_group', $group, array(
            'action' => $this->generateUrl('open_orchestra_group_form', array(
                'groupId' => $groupId,
            )),
            'enable_delete_button' => $this->get('open_orchestra_backoffice.business_rules_manager')->isGranted(ContributionActionInterface::DELETE, $group),
            'delete_button' => $this->isGranted(ContributionActionInterface::DELETE, $group)
        ));

        $form->handleRequest($request);
        $message = $this->get('translator')->trans('open_orchestra_group.form.group.edit.success');
        if ($this->handleForm($form, $message)) {
            $this->dispatchEvent(GroupEvents::GROUP_UPDATE, new GroupEvent($group));
        }

        return $this->renderAdminForm($form);
    }
1182285
public function update(TaxGroupRequest $request, TaxGroup $taxGroup)
    {
        $taxGroup->update($request->all());

        return redirect()->route('admin.tax-group.index');
    }
757694
public function removeSite($groupId, $siteId)
    {
        $currentGroupId = (int)$this
            ->database
            ->query(
                "SELECT group_id FROM {ucms_site} WHERE id = :site",
                [':site' => $siteId]
            )
            ->fetchField()
        ;

        if ($currentGroupId !== (int)$groupId) {
            throw new GroupMoveDisallowedException(sprintf("%s site is not in group %s", $siteId, $groupId));
        }

        $this
            ->database
            ->query(
                "UPDATE {ucms_site} SET group_id = NULL WHERE id = :site",
                [':site' => $siteId]
            )
        ;

        // @todo dispatch event

        $this->touch($groupId);
    }
527680
public function apply(Request $request, ParamConverter $configuration)
    {
        $id = (int)$request->get(self::PARAMETER_OBJECT_STATE_GROUP_ID);
        $objectStateGroup = $this->objectStateService->loadObjectStateGroup($id);

        if (!$objectStateGroup) {
            throw new NotFoundHttpException("Object State Group $id not found!");
        }

        $request->attributes->set($configuration->getName(), $objectStateGroup);

        return true;
    }
1271530
public function edit($groupId = null)
    {
        $this->requireAdmin();

        if (!is_null($groupId)) {
            $group = $this->groupStore->getById($groupId);
        } else {
            $group = new ProjectGroup();
        }

        if ($this->request->getMethod() == 'POST') {
            $group->setTitle($this->getParam('title'));
            $this->groupStore->save($group);

            $response = new b8\Http\Response\RedirectResponse();
            $response->setHeader('Location', PHPCI_URL.'group');
            return $response;
        }

        $form = new Form();
        $form->setMethod('POST');
        $form->setAction(PHPCI_URL . 'group/edit' . (!is_null($groupId) ? '/' . $groupId : ''));

        $title = new Form\Element\Text('title');
        $title->setContainerClass('form-group');
        $title->setClass('form-control');
        $title->setLabel('Group Title');
        $title->setValue($group->getTitle());

        $submit = new Form\Element\Submit();
        $submit->setValue('Save Group');

        $form->addField($title);
        $form->addField($submit);

        $this->view->form = $form;
    }
295899
public function deleteGroup($groupId)
    {
        $objectStates = $this->loadObjectStates($groupId);
        foreach ($objectStates as $objectState) {
            $this->objectStateGateway->deleteObjectStateLinks($objectState->id);
            $this->objectStateGateway->deleteObjectState($objectState->id);
        }

        $this->objectStateGateway->deleteObjectStateGroup($groupId);
    }
760647
public function newAction(Request $request)
    {
        $groupClass = $this->getParameter('open_orchestra_user.document.group.class');
        /** @var GroupInterface $group */
        $group = new $groupClass();
        $siteId = $this->get('open_orchestra_backoffice.context_backoffice_manager')->getSiteId();
        $group->setSite($this->get('open_orchestra_model.repository.site')->findOneBySiteId($siteId));

        $this->denyAccessUnlessGranted(ContributionActionInterface::CREATE, $group);

        $form = $this->createForm('oo_group', $group, array(
            'action'   => $this->generateUrl('open_orchestra_group_new'),
            'creation' => true,
            'method'   => 'POST'
        ));

        $form->handleRequest($request);

        if ($form->isValid()) {
            $documentManager = $this->get('object_manager');
            $documentManager->persist($group);
            $documentManager->flush();
            $message = $this->get('translator')->trans('open_orchestra_group.form.group.new.success');
            $this->get('session')->getFlashBag()->add('success', $message);

            $this->dispatchEvent(GroupEvents::GROUP_CREATE, new GroupEvent($group));
            $response = new Response(
                '',
                Response::HTTP_CREATED,
                array('Content-type' => 'text/plain; charset=utf-8', 'groupId' => $group->getId(), 'name' => $group->getName())
            );

            return $response;
        }

        return $this->renderAdminForm($form);
    }
77019
public function remove_user_from_group($user, $groupid) {
        global $DB;
        require_capability('moodle/course:managegroups', $this->context);
        $group = $this->get_group($groupid);
        if (!groups_remove_member_allowed($group, $user)) {
            return false;
        }
        if (!$group) {
            return false;
        }
        return groups_remove_member($group, $user);
    }
1059635
public function createGroupAsync(CreateGroupRequest $request, AsyncCallback $callback = null)
    {
        $response = new CreateGroupResponse();
        return $this->client->sendRequestAsync($request, $response, $callback);
    }
136043
public function deleteGroup($group_id)
    {
        $url = "https://api.weixin.qq.com/shakearound/device/group/delete?access_token=ACCESS_TOKEN";
        $this->registerApi($url, __FUNCTION__, func_get_args());
        return $this->httpPostForJson($url, ['group_id' => $group_id]);
    }
1029366
public function updateGroup($groupId, Api\GroupUpdate $group)
    {
        $json = Serialize::groupUpdate($group);
        $result = $this->_post($this->_groupUrl($groupId), $json);
        return Deserialize::groupResponse($result);
    }
1199812
public function leaveGroup($groupId)
	{
		$token = $this->oauth->getToken();

		// Set parameters.
		$parameters = array(
			'oauth_token' => $token['key'],
		);

		// Set the success response code.
		$this->oauth->setOption('success_code', 204);

		// Set the API base
		$base = '/v1/people/~/group-memberships/' . $groupId;

		// Build the request path.
		$path = $this->getOption('api.url') . $base;

		// Send the request.
		$response = $this->oauth->oauthRequest($path, 'DELETE', $parameters);

		return $response;
	}
509344
public function deleteObjectStateGroup($groupId)
    {
        try {
            return $this->innerGateway->deleteObjectStateGroup($groupId);
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }
414215
public function update(UserGroupRequest $request, UserGroup $userGroup)
    {
        $this->_syncIsDefault();

        $userGroup->update($request->all());

        return redirect()->route('admin.user-group.index');
    }
871599
function(groupName, callback) {
        var url = this.getResourceUrl({ path: '/groups/' + groupName, user: null });
        request.del(this.getSignedResourceUrl('DELETE', url), callback);

        return this;
    }
890017
public function deleteAction(Request $request, $groupName)
    {
        $acl = $this->get('bacon_acl.service.authorization');

        if (!$acl->authorize('groups', 'DELETE')) {
            throw $this->createAccessDeniedException();
        }

        $group = $this->findGroupBy('name', $groupName);
        $this->get('fos_user.group_manager')->deleteGroup($group);

        $response = new RedirectResponse($this->generateUrl('fos_user_group_list'));

        $this->get('session')->getFlashBag()->add('message', [
            'type' => 'success',
            'message' => 'The record has been remove successfully.',
        ]);

        /** @var $dispatcher \Symfony\Component\EventDispatcher\EventDispatcherInterface */
        $dispatcher = $this->get('event_dispatcher');
        $dispatcher->dispatch(FOSUserEvents::GROUP_DELETE_COMPLETED, new FilterGroupResponseEvent($group, $request, $response));

        return $response;
    }