public function createUserGroup($name, $parentGroup = null)
    {
        if (!$parentGroup) {
            $parentGroup = $this->userService->loadUserGroup(self::USERGROUP_ROOT_CONTENT_ID);
        }

        $userGroupCreateStruct = $this->userService->newUserGroupCreateStruct('eng-GB');
        $userGroupCreateStruct->setField('name', $name);

        return $this->userService->createUserGroup($userGroupCreateStruct, $parentGroup);
    }
public function createUserGroup($name, $parentGroup = null)
    {
        if (!$parentGroup) {
            $parentGroup = $this->userService->loadUserGroup(self::USERGROUP_ROOT_CONTENT_ID);
        }

        $userGroupCreateStruct = $this->userService->newUserGroupCreateStruct('eng-GB');
        $userGroupCreateStruct->setField('name', $name);

        return $this->userService->createUserGroup($userGroupCreateStruct, $parentGroup);
    }
public function createUserGroup ( $ name , $ parentGroup = null ) { if ( ! $ parentGroup ) { $ parentGroup = $ this -> userService -> loadUserGroup ( self :: USERGROUP_ROOT_CONTENT_ID ) ; } $ userGroupCreateStruct = $ this -> userService -> newUserGroupCreateStruct ( 'eng-GB' ) ; $ userGroupCreateStruct -> setField ( 'name' , $ name ) ; return $ this -> userService -> createUserGroup ( $ userGroupCreateStruct , $ parentGroup ) ; }
Create new User Group inside existing parent User Group.

@param string $name  User Group name
@param \eZ\Publish\API\Repository\Values\User\UserGroup $parentGroup  (optional) parent user group, defaults to UserGroup "/Users"

@return \eZ\Publish\API\Repository\Values\User\UserGroup
Create new User Group inside existing parent User Group .