src/View/ActionHandler/AbstractPropertyOverrideEditAllHandler.php
private function markPropertyInvalidErrorsByModel(
        PropertyValueBagInterface $propertyValueBag,
        ModelInterface $model,
        \ArrayObject $renderInformation,
        EnvironmentInterface $environment
    ) {
        $editInformation  = $GLOBALS['container']['dc-general.edit-information'];
        $errorInformation = $editInformation->getModelError($model);
        if (null === $errorInformation) {
            return;
        }

        foreach (\array_keys($errorInformation) as $errorPropertyName) {
            \array_map(
                function ($error) use (
                    $errorPropertyName,
                    $model,
                    $propertyValueBag,
                    $renderInformation,
                    $editInformation,
                    $environment
                ) {
                    $modelError = (array) $renderInformation->offsetGet('modelError');

                    $inputField = \sprintf(
                        'ctrl_%s_%s',
                        \str_replace('::', '____', ModelId::fromModel($model)->getSerialized()),
                        $errorPropertyName
                    );

                    $modelError[ModelId::fromModel($model)->getSerialized()][$errorPropertyName][] = \sprintf(
                        '<a href="%s#%s">No saved model[%s]. %s</a>',
                        Environment::get('request'),
                        $inputField,
                        $model->getId(),
                        $error
                    );

                    $renderInformation->offsetSet('modelError', $modelError);

                    $modelEditError = $editInformation->getModelError($model);
                    if ($modelEditError && isset($modelEditError[$errorPropertyName])) {
                        $propertyValueBag->setPropertyValue(
                            $errorPropertyName,
                            $environment->getInputProvider()->getValue($errorPropertyName)
                        );

                        $propertyValueBag->markPropertyValueAsInvalid(
                            $errorPropertyName,
                            $modelEditError[$errorPropertyName]
                        );
                    }
                },
                $errorInformation[$errorPropertyName]
            );
        }
    }
private function markPropertyInvalidErrorsByModel(
        PropertyValueBagInterface $propertyValueBag,
        ModelInterface $model,
        \ArrayObject $renderInformation,
        EnvironmentInterface $environment
    ) {
        $editInformation  = $GLOBALS['container']['dc-general.edit-information'];
        $errorInformation = $editInformation->getModelError($model);
        if (null === $errorInformation) {
            return;
        }

        foreach (\array_keys($errorInformation) as $errorPropertyName) {
            \array_map(
                function ($error) use (
                    $errorPropertyName,
                    $model,
                    $propertyValueBag,
                    $renderInformation,
                    $editInformation,
                    $environment
                ) {
                    $modelError = (array) $renderInformation->offsetGet('modelError');

                    $inputField = \sprintf(
                        'ctrl_%s_%s',
                        \str_replace('::', '____', ModelId::fromModel($model)->getSerialized()),
                        $errorPropertyName
                    );

                    $modelError[ModelId::fromModel($model)->getSerialized()][$errorPropertyName][] = \sprintf(
                        '<a href="%s#%s">No saved model[%s]. %s</a>',
                        Environment::get('request'),
                        $inputField,
                        $model->getId(),
                        $error
                    );

                    $renderInformation->offsetSet('modelError', $modelError);

                    $modelEditError = $editInformation->getModelError($model);
                    if ($modelEditError && isset($modelEditError[$errorPropertyName])) {
                        $propertyValueBag->setPropertyValue(
                            $errorPropertyName,
                            $environment->getInputProvider()->getValue($errorPropertyName)
                        );

                        $propertyValueBag->markPropertyValueAsInvalid(
                            $errorPropertyName,
                            $modelEditError[$errorPropertyName]
                        );
                    }
                },
                $errorInformation[$errorPropertyName]
            );
        }
    }
private function markPropertyInvalidErrorsByModel ( PropertyValueBagInterface $ propertyValueBag , ModelInterface $ model , \ ArrayObject $ renderInformation , EnvironmentInterface $ environment ) { $ editInformation = $ GLOBALS [ 'container' ] [ 'dc-general.edit-information' ] ; $ errorInformation = $ editInformation -> getModelError ( $ model ) ; if ( null === $ errorInformation ) { return ; } foreach ( \ array_keys ( $ errorInformation ) as $ errorPropertyName ) { \ array_map ( function ( $ error ) use ( $ errorPropertyName , $ model , $ propertyValueBag , $ renderInformation , $ editInformation , $ environment ) { $ modelError = ( array ) $ renderInformation -> offsetGet ( 'modelError' ) ; $ inputField = \ sprintf ( 'ctrl_%s_%s' , \ str_replace ( '::' , '____' , ModelId :: fromModel ( $ model ) -> getSerialized ( ) ) , $ errorPropertyName ) ; $ modelError [ ModelId :: fromModel ( $ model ) -> getSerialized ( ) ] [ $ errorPropertyName ] [ ] = \ sprintf ( '<a href="%s#%s">No saved model[%s]. %s</a>' , Environment :: get ( 'request' ) , $ inputField , $ model -> getId ( ) , $ error ) ; $ renderInformation -> offsetSet ( 'modelError' , $ modelError ) ; $ modelEditError = $ editInformation -> getModelError ( $ model ) ; if ( $ modelEditError && isset ( $ modelEditError [ $ errorPropertyName ] ) ) { $ propertyValueBag -> setPropertyValue ( $ errorPropertyName , $ environment -> getInputProvider ( ) -> getValue ( $ errorPropertyName ) ) ; $ propertyValueBag -> markPropertyValueAsInvalid ( $ errorPropertyName , $ modelEditError [ $ errorPropertyName ] ) ; } } , $ errorInformation [ $ errorPropertyName ] ) ; } }
Mark property in invalid errors by model.

@param PropertyValueBagInterface $propertyValueBag  The property values.
@param ModelInterface            $model             The Model.
@param \ArrayObject              $renderInformation The render information.
@param EnvironmentInterface      $environment       The environment.

@return void

@SuppressWarnings(PHPMD.Superglobals)
Mark property in invalid errors by model .