src/Sulu/Bundle/SecurityBundle/UserManager/UserManager.php
private function updateUserRole(UserRole $userRole, $userRoleData)
    {
        $role = $this->roleRepository->findRoleById($userRoleData['role']['id']);

        if (!$role) {
            throw new EntityNotFoundException($this->roleRepository->getClassName(), $userRole['role']['id']);
        }

        $userRole->setRole($role);
        if (array_key_exists('locales', $userRoleData)) {
            $userRole->setLocale(json_encode($userRoleData['locales']));
        } else {
            $userRole->setLocale($userRoleData['locale']);
        }

        return true;
    }
private function updateUserRole(UserRole $userRole, $userRoleData)
    {
        $role = $this->roleRepository->findRoleById($userRoleData['role']['id']);

        if (!$role) {
            throw new EntityNotFoundException($this->roleRepository->getClassName(), $userRole['role']['id']);
        }

        $userRole->setRole($role);
        if (array_key_exists('locales', $userRoleData)) {
            $userRole->setLocale(json_encode($userRoleData['locales']));
        } else {
            $userRole->setLocale($userRoleData['locale']);
        }

        return true;
    }
private function updateUserRole ( UserRole $ userRole , $ userRoleData ) { $ role = $ this -> roleRepository -> findRoleById ( $ userRoleData [ 'role' ] [ 'id' ] ) ; if ( ! $ role ) { throw new EntityNotFoundException ( $ this -> roleRepository -> getClassName ( ) , $ userRole [ 'role' ] [ 'id' ] ) ; } $ userRole -> setRole ( $ role ) ; if ( array_key_exists ( 'locales' , $ userRoleData ) ) { $ userRole -> setLocale ( json_encode ( $ userRoleData [ 'locales' ] ) ) ; } else { $ userRole -> setLocale ( $ userRoleData [ 'locale' ] ) ; } return true ; }
Updates an existing UserRole with the given data.

@param UserRole $userRole
@param $userRoleData

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

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