src/Contao/View/Contao2BackendView/ActionHandler/MultipleHandler/EditAllHandler.php
private function getVisibleModel(
        Action $action,
        ModelInterface $editModel,
        DataProviderInterface $dataProvider,
        EnvironmentInterface $environment
    ) {
        $selectProperties = (array) $this->getPropertiesFromSession($action, $environment);

        $visibleModel = $dataProvider->getEmptyModel();
        $visibleModel->setId($editModel->getId());

        $widgetManager    = new ContaoWidgetManager($environment, $editModel);
        $propertyValueBag = new PropertyValueBag();

        foreach (\array_keys($selectProperties) as $visiblePropertyName) {
            $visiblePropertyValue = $editModel->getProperty($visiblePropertyName);

            $propertyValueBag->setPropertyValue($visiblePropertyName, $visiblePropertyValue);

            $visibleModel->setProperty(
                $visiblePropertyName,
                $widgetManager->encodeValue(
                    $visiblePropertyName,
                    $widgetManager->decodeValue($visiblePropertyName, $visiblePropertyValue),
                    $propertyValueBag
                )
            );
        }

        return $visibleModel;
    }
private function getVisibleModel(
        Action $action,
        ModelInterface $editModel,
        DataProviderInterface $dataProvider,
        EnvironmentInterface $environment
    ) {
        $selectProperties = (array) $this->getPropertiesFromSession($action, $environment);

        $visibleModel = $dataProvider->getEmptyModel();
        $visibleModel->setId($editModel->getId());

        $widgetManager    = new ContaoWidgetManager($environment, $editModel);
        $propertyValueBag = new PropertyValueBag();

        foreach (\array_keys($selectProperties) as $visiblePropertyName) {
            $visiblePropertyValue = $editModel->getProperty($visiblePropertyName);

            $propertyValueBag->setPropertyValue($visiblePropertyName, $visiblePropertyValue);

            $visibleModel->setProperty(
                $visiblePropertyName,
                $widgetManager->encodeValue(
                    $visiblePropertyName,
                    $widgetManager->decodeValue($visiblePropertyName, $visiblePropertyValue),
                    $propertyValueBag
                )
            );
        }

        return $visibleModel;
    }
private function getVisibleModel ( Action $ action , ModelInterface $ editModel , DataProviderInterface $ dataProvider , EnvironmentInterface $ environment ) { $ selectProperties = ( array ) $ this -> getPropertiesFromSession ( $ action , $ environment ) ; $ visibleModel = $ dataProvider -> getEmptyModel ( ) ; $ visibleModel -> setId ( $ editModel -> getId ( ) ) ; $ widgetManager = new ContaoWidgetManager ( $ environment , $ editModel ) ; $ propertyValueBag = new PropertyValueBag ( ) ; foreach ( \ array_keys ( $ selectProperties ) as $ visiblePropertyName ) { $ visiblePropertyValue = $ editModel -> getProperty ( $ visiblePropertyName ) ; $ propertyValueBag -> setPropertyValue ( $ visiblePropertyName , $ visiblePropertyValue ) ; $ visibleModel -> setProperty ( $ visiblePropertyName , $ widgetManager -> encodeValue ( $ visiblePropertyName , $ widgetManager -> decodeValue ( $ visiblePropertyName , $ visiblePropertyValue ) , $ propertyValueBag ) ) ; } return $ visibleModel ; }
Get the visible model.

@param Action                $action       The action.
@param ModelInterface        $editModel    The edit model.
@param DataProviderInterface $dataProvider The data provider.
@param EnvironmentInterface  $environment  The environment.

@return ModelInterface
Get the visible model .