src/Sulu/Bundle/SecurityBundle/UserManager/UserManager.php
private function updateUserGroup(UserGroup $userGroup, $userGroupData)
    {
        $group = $this->groupRepository->findGroupById($userGroupData['group']['id']);

        if (!$group) {
            throw new EntityNotFoundException($this->groupRepository->getClassName(), $userGroup['group']['id']);
        }

        $userGroup->setGroup($group);
        if (array_key_exists('locales', $userGroupData)) {
            $userGroup->setLocale(json_encode($userGroupData['locales']));
        } else {
            $userGroup->setLocale($userGroupData['locale']);
        }

        return true;
    }
private function updateUserGroup(UserGroup $userGroup, $userGroupData)
    {
        $group = $this->groupRepository->findGroupById($userGroupData['group']['id']);

        if (!$group) {
            throw new EntityNotFoundException($this->groupRepository->getClassName(), $userGroup['group']['id']);
        }

        $userGroup->setGroup($group);
        if (array_key_exists('locales', $userGroupData)) {
            $userGroup->setLocale(json_encode($userGroupData['locales']));
        } else {
            $userGroup->setLocale($userGroupData['locale']);
        }

        return true;
    }
private function updateUserGroup ( UserGroup $ userGroup , $ userGroupData ) { $ group = $ this -> groupRepository -> findGroupById ( $ userGroupData [ 'group' ] [ 'id' ] ) ; if ( ! $ group ) { throw new EntityNotFoundException ( $ this -> groupRepository -> getClassName ( ) , $ userGroup [ 'group' ] [ 'id' ] ) ; } $ userGroup -> setGroup ( $ group ) ; if ( array_key_exists ( 'locales' , $ userGroupData ) ) { $ userGroup -> setLocale ( json_encode ( $ userGroupData [ 'locales' ] ) ) ; } else { $ userGroup -> setLocale ( $ userGroupData [ 'locale' ] ) ; } return true ; }
Updates an existing UserGroup with the given data.

@param \Sulu\Bundle\SecurityBundle\Entity\UserGroup $userGroup
@param $userGroupData

@throws \Sulu\Component\Rest\Exception\EntityNotFoundException

@return bool
Updates an existing UserGroup with the given data .