src/Contao/View/Contao2BackendView/ActionHandler/MultipleHandler/OverrideAllHandler.php
protected function handleInvalidPropertyValueBag(
        PropertyValueBagInterface $propertyValueBag = null,
        ModelInterface $model = null,
        EnvironmentInterface $environment
    ) {
        // @codingStandardsIgnoreStart
        @\trigger_error('This function where remove in 3.0. ' . __CLASS__  . '::' . __FUNCTION__, E_USER_DEPRECATED);
        // @codingStandardsIgnoreEnd

        if ((null === $propertyValueBag)
            || (null === $model)
        ) {
            return;
        }

        $inputProvider = $environment->getInputProvider();

        foreach (\array_keys($propertyValueBag->getArrayCopy()) as $propertyName) {
            $allErrors    = $propertyValueBag->getPropertyValueErrors($propertyName);
            $mergedErrors = [];
            if (\count($allErrors) > 0) {
                foreach ($allErrors as $error) {
                    if (\in_array($error, $mergedErrors)) {
                        continue;
                    }

                    $mergedErrors[] = $error;
                }
            }

            $eventPropertyValueBag = new PropertyValueBag();
            $eventPropertyValueBag->setPropertyValue($propertyName, $inputProvider->getValue($propertyName, true));

            $event = new EncodePropertyValueFromWidgetEvent($environment, $model, $eventPropertyValueBag);
            $event->setProperty($propertyName)
                ->setValue($inputProvider->getValue($propertyName, true));
            $environment->getEventDispatcher()->dispatch(EncodePropertyValueFromWidgetEvent::NAME, $event);

            $propertyValueBag->setPropertyValue($propertyName, $event->getValue());

            if (\count($mergedErrors) > 0) {
                $propertyValueBag->markPropertyValueAsInvalid($propertyName, $mergedErrors);
            }
        }
    }
protected function handleInvalidPropertyValueBag(
        PropertyValueBagInterface $propertyValueBag = null,
        ModelInterface $model = null,
        EnvironmentInterface $environment
    ) {
        // @codingStandardsIgnoreStart
        @\trigger_error('This function where remove in 3.0. ' . __CLASS__  . '::' . __FUNCTION__, E_USER_DEPRECATED);
        // @codingStandardsIgnoreEnd

        if ((null === $propertyValueBag)
            || (null === $model)
        ) {
            return;
        }

        $inputProvider = $environment->getInputProvider();

        foreach (\array_keys($propertyValueBag->getArrayCopy()) as $propertyName) {
            $allErrors    = $propertyValueBag->getPropertyValueErrors($propertyName);
            $mergedErrors = [];
            if (\count($allErrors) > 0) {
                foreach ($allErrors as $error) {
                    if (\in_array($error, $mergedErrors)) {
                        continue;
                    }

                    $mergedErrors[] = $error;
                }
            }

            $eventPropertyValueBag = new PropertyValueBag();
            $eventPropertyValueBag->setPropertyValue($propertyName, $inputProvider->getValue($propertyName, true));

            $event = new EncodePropertyValueFromWidgetEvent($environment, $model, $eventPropertyValueBag);
            $event->setProperty($propertyName)
                ->setValue($inputProvider->getValue($propertyName, true));
            $environment->getEventDispatcher()->dispatch(EncodePropertyValueFromWidgetEvent::NAME, $event);

            $propertyValueBag->setPropertyValue($propertyName, $event->getValue());

            if (\count($mergedErrors) > 0) {
                $propertyValueBag->markPropertyValueAsInvalid($propertyName, $mergedErrors);
            }
        }
    }
protected function handleInvalidPropertyValueBag ( PropertyValueBagInterface $ propertyValueBag = null , ModelInterface $ model = null , EnvironmentInterface $ environment ) { // @codingStandardsIgnoreStart @ \ trigger_error ( 'This function where remove in 3.0. ' . __CLASS__ . '::' . __FUNCTION__ , E_USER_DEPRECATED ) ; // @codingStandardsIgnoreEnd if ( ( null === $ propertyValueBag ) || ( null === $ model ) ) { return ; } $ inputProvider = $ environment -> getInputProvider ( ) ; foreach ( \ array_keys ( $ propertyValueBag -> getArrayCopy ( ) ) as $ propertyName ) { $ allErrors = $ propertyValueBag -> getPropertyValueErrors ( $ propertyName ) ; $ mergedErrors = [ ] ; if ( \ count ( $ allErrors ) > 0 ) { foreach ( $ allErrors as $ error ) { if ( \ in_array ( $ error , $ mergedErrors ) ) { continue ; } $ mergedErrors [ ] = $ error ; } } $ eventPropertyValueBag = new PropertyValueBag ( ) ; $ eventPropertyValueBag -> setPropertyValue ( $ propertyName , $ inputProvider -> getValue ( $ propertyName , true ) ) ; $ event = new EncodePropertyValueFromWidgetEvent ( $ environment , $ model , $ eventPropertyValueBag ) ; $ event -> setProperty ( $ propertyName ) -> setValue ( $ inputProvider -> getValue ( $ propertyName , true ) ) ; $ environment -> getEventDispatcher ( ) -> dispatch ( EncodePropertyValueFromWidgetEvent :: NAME , $ event ) ; $ propertyValueBag -> setPropertyValue ( $ propertyName , $ event -> getValue ( ) ) ; if ( \ count ( $ mergedErrors ) > 0 ) { $ propertyValueBag -> markPropertyValueAsInvalid ( $ propertyName , $ mergedErrors ) ; } } }
Handle invalid property value bag.

@param PropertyValueBagInterface|null $propertyValueBag The property value bag.
@param ModelInterface|null            $model            The model.
@param EnvironmentInterface           $environment      The environment.

@return void

@deprecated Deprecated since 2.1 and where remove in 3.0.
Handle invalid property value bag .