src/Contao/View/Contao2BackendView/ActionHandler/MultipleHandler/EditAllHandler.php
private function buildFieldSets(Action $action, \ArrayObject $renderInformation, EnvironmentInterface $environment)
    {
        $formInputs = $environment->getInputProvider()->getValue('FORM_INPUTS');
        $collection = $this->getCollectionFromSession($action, $environment);

        $fieldSets = [];
        $errors    = [];
        while ($collection->count() > 0) {
            $model   = $collection->shift();
            $modelId = ModelId::fromModel($model);

            $editPropertyValuesBag = $this->getPropertyValueBagFromModel($action, $model, $environment);
            if ($formInputs) {
                $this->handleEditCollection($action, $editPropertyValuesBag, $model, $renderInformation, $environment);
            }

            $fields = $this->renderEditFields(
                $action,
                new ContaoWidgetManager($environment, $model),
                $model,
                $editPropertyValuesBag,
                $environment
            );

            if (\count($fields) < 1) {
                continue;
            }

            $fieldSets[] = [
                'label'   => $modelId->getSerialized(),
                'model'   => $model,
                'legend'  => \str_replace('::', '____', $modelId->getSerialized()),
                'class'   => 'tl_box',
                'palette' => \implode('', $fields)
            ];
        }

        $renderInformation->offsetSet('fieldsets', $this->handleLegendCollapsed($fieldSets));
        $renderInformation->offsetSet('error', $errors);
    }
private function buildFieldSets(Action $action, \ArrayObject $renderInformation, EnvironmentInterface $environment)
    {
        $formInputs = $environment->getInputProvider()->getValue('FORM_INPUTS');
        $collection = $this->getCollectionFromSession($action, $environment);

        $fieldSets = [];
        $errors    = [];
        while ($collection->count() > 0) {
            $model   = $collection->shift();
            $modelId = ModelId::fromModel($model);

            $editPropertyValuesBag = $this->getPropertyValueBagFromModel($action, $model, $environment);
            if ($formInputs) {
                $this->handleEditCollection($action, $editPropertyValuesBag, $model, $renderInformation, $environment);
            }

            $fields = $this->renderEditFields(
                $action,
                new ContaoWidgetManager($environment, $model),
                $model,
                $editPropertyValuesBag,
                $environment
            );

            if (\count($fields) < 1) {
                continue;
            }

            $fieldSets[] = [
                'label'   => $modelId->getSerialized(),
                'model'   => $model,
                'legend'  => \str_replace('::', '____', $modelId->getSerialized()),
                'class'   => 'tl_box',
                'palette' => \implode('', $fields)
            ];
        }

        $renderInformation->offsetSet('fieldsets', $this->handleLegendCollapsed($fieldSets));
        $renderInformation->offsetSet('error', $errors);
    }
private function buildFieldSets ( Action $ action , \ ArrayObject $ renderInformation , EnvironmentInterface $ environment ) { $ formInputs = $ environment -> getInputProvider ( ) -> getValue ( 'FORM_INPUTS' ) ; $ collection = $ this -> getCollectionFromSession ( $ action , $ environment ) ; $ fieldSets = [ ] ; $ errors = [ ] ; while ( $ collection -> count ( ) > 0 ) { $ model = $ collection -> shift ( ) ; $ modelId = ModelId :: fromModel ( $ model ) ; $ editPropertyValuesBag = $ this -> getPropertyValueBagFromModel ( $ action , $ model , $ environment ) ; if ( $ formInputs ) { $ this -> handleEditCollection ( $ action , $ editPropertyValuesBag , $ model , $ renderInformation , $ environment ) ; } $ fields = $ this -> renderEditFields ( $ action , new ContaoWidgetManager ( $ environment , $ model ) , $ model , $ editPropertyValuesBag , $ environment ) ; if ( \ count ( $ fields ) < 1 ) { continue ; } $ fieldSets [ ] = [ 'label' => $ modelId -> getSerialized ( ) , 'model' => $ model , 'legend' => \ str_replace ( '::' , '____' , $ modelId -> getSerialized ( ) ) , 'class' => 'tl_box' , 'palette' => \ implode ( '' , $ fields ) ] ; } $ renderInformation -> offsetSet ( 'fieldsets' , $ this -> handleLegendCollapsed ( $ fieldSets ) ) ; $ renderInformation -> offsetSet ( 'error' , $ errors ) ; }
Build the field sets for each model.

Return error if their given.

@param Action               $action            The action.
@param \ArrayObject         $renderInformation The render information.
@param EnvironmentInterface $environment       The environment.

@return void
Build the field sets for each model .