public function updateUserGroup($groupPath, Request $request)
    {
        $userGroupLocation = $this->locationService->loadLocation(
            $this->extractLocationIdFromPath($groupPath)
        );

        $userGroup = $this->userService->loadUserGroup(
            $userGroupLocation->contentId
        );

        $updateStruct = $this->inputDispatcher->parse(
            new Message(
                array(
                    'Content-Type' => $request->headers->get('Content-Type'),
                    // @todo Needs refactoring! Temporary solution so parser has access to URL
                    'Url' => $request->getPathInfo(),
                ),
                $request->getContent()
            )
        );

        if ($updateStruct->sectionId !== null) {
            $section = $this->sectionService->loadSection($updateStruct->sectionId);
            $this->sectionService->assignSection(
                $userGroup->getVersionInfo()->getContentInfo(),
                $section
            );
        }

        $updatedGroup = $this->userService->updateUserGroup($userGroup, $updateStruct->userGroupUpdateStruct);
        $contentType = $this->contentTypeService->loadContentType(
            $updatedGroup->getVersionInfo()->getContentInfo()->contentTypeId
        );

        return new Values\RestUserGroup(
            $updatedGroup,
            $contentType,
            $updatedGroup->getVersionInfo()->getContentInfo(),
            $userGroupLocation,
            $this->contentService->loadRelations($updatedGroup->getVersionInfo())
        );
    }
public function updateUserGroup($groupPath, Request $request)
    {
        $userGroupLocation = $this->locationService->loadLocation(
            $this->extractLocationIdFromPath($groupPath)
        );

        $userGroup = $this->userService->loadUserGroup(
            $userGroupLocation->contentId
        );

        $updateStruct = $this->inputDispatcher->parse(
            new Message(
                array(
                    'Content-Type' => $request->headers->get('Content-Type'),
                    // @todo Needs refactoring! Temporary solution so parser has access to URL
                    'Url' => $request->getPathInfo(),
                ),
                $request->getContent()
            )
        );

        if ($updateStruct->sectionId !== null) {
            $section = $this->sectionService->loadSection($updateStruct->sectionId);
            $this->sectionService->assignSection(
                $userGroup->getVersionInfo()->getContentInfo(),
                $section
            );
        }

        $updatedGroup = $this->userService->updateUserGroup($userGroup, $updateStruct->userGroupUpdateStruct);
        $contentType = $this->contentTypeService->loadContentType(
            $updatedGroup->getVersionInfo()->getContentInfo()->contentTypeId
        );

        return new Values\RestUserGroup(
            $updatedGroup,
            $contentType,
            $updatedGroup->getVersionInfo()->getContentInfo(),
            $userGroupLocation,
            $this->contentService->loadRelations($updatedGroup->getVersionInfo())
        );
    }
public function updateUserGroup ( $ groupPath , Request $ request ) { $ userGroupLocation = $ this -> locationService -> loadLocation ( $ this -> extractLocationIdFromPath ( $ groupPath ) ) ; $ userGroup = $ this -> userService -> loadUserGroup ( $ userGroupLocation -> contentId ) ; $ updateStruct = $ this -> inputDispatcher -> parse ( new Message ( array ( 'Content-Type' => $ request -> headers -> get ( 'Content-Type' ) , // @todo Needs refactoring! Temporary solution so parser has access to URL 'Url' => $ request -> getPathInfo ( ) , ) , $ request -> getContent ( ) ) ) ; if ( $ updateStruct -> sectionId !== null ) { $ section = $ this -> sectionService -> loadSection ( $ updateStruct -> sectionId ) ; $ this -> sectionService -> assignSection ( $ userGroup -> getVersionInfo ( ) -> getContentInfo ( ) , $ section ) ; } $ updatedGroup = $ this -> userService -> updateUserGroup ( $ userGroup , $ updateStruct -> userGroupUpdateStruct ) ; $ contentType = $ this -> contentTypeService -> loadContentType ( $ updatedGroup -> getVersionInfo ( ) -> getContentInfo ( ) -> contentTypeId ) ; return new Values \ RestUserGroup ( $ updatedGroup , $ contentType , $ updatedGroup -> getVersionInfo ( ) -> getContentInfo ( ) , $ userGroupLocation , $ this -> contentService -> loadRelations ( $ updatedGroup -> getVersionInfo ( ) ) ) ; }
Updates a user group.

@param $groupPath

@return \eZ\Publish\Core\REST\Server\Values\RestUserGroup
Updates a user group .