eZ\Publish\Core\REST\Server\Controller\User::createUserGroup PHP Method

createUserGroup() public method

Create a new user group under the given parent To create a top level group use /user/groups/1/5/subgroups.
public createUserGroup ( $groupPath, Request $request ) : CreatedUserGroup
$groupPath
$request Symfony\Component\HttpFoundation\Request
return eZ\Publish\Core\REST\Server\Values\CreatedUserGroup
    public function createUserGroup($groupPath, Request $request)
    {
        $userGroupLocation = $this->locationService->loadLocation($this->extractLocationIdFromPath($groupPath));
        $createdUserGroup = $this->userService->createUserGroup($this->inputDispatcher->parse(new Message(array('Content-Type' => $request->headers->get('Content-Type')), $request->getContent())), $this->userService->loadUserGroup($userGroupLocation->contentId));
        $createdContentInfo = $createdUserGroup->getVersionInfo()->getContentInfo();
        $createdLocation = $this->locationService->loadLocation($createdContentInfo->mainLocationId);
        $contentType = $this->contentTypeService->loadContentType($createdContentInfo->contentTypeId);
        return new Values\CreatedUserGroup(array('userGroup' => new Values\RestUserGroup($createdUserGroup, $contentType, $createdContentInfo, $createdLocation, $this->contentService->loadRelations($createdUserGroup->getVersionInfo()))));
    }