src/Contao/View/Contao2BackendView/ActionHandler/SelectHandler.php
private function getSelectCollection(EnvironmentInterface $environment)
    {
        $sessionStorage = $environment->getSessionStorage();
        $dataDefinition = $environment->getDataDefinition();
        $dataProvider   = $environment->getDataProvider();
        $session        =
            $sessionStorage->get($dataDefinition->getName() . '.' . $this->getSubmitAction($environment, true));

        $modelIds = [];
        foreach ($session['models'] as $modelId) {
            $modelIds[] = ModelId::fromSerialized($modelId)->getId();
        }

        $idProperty = \method_exists($dataProvider, 'getIdProperty') ? $dataProvider->getIdProperty() : 'id';
        return $dataProvider->fetchAll(
            $dataProvider->getEmptyConfig()->setFilter(
                [
                    [
                        'operation' => 'IN',
                        'property'  => $idProperty,
                        'values'    => $modelIds
                    ]
                ]
            )
        );
    }
private function getSelectCollection(EnvironmentInterface $environment)
    {
        $sessionStorage = $environment->getSessionStorage();
        $dataDefinition = $environment->getDataDefinition();
        $dataProvider   = $environment->getDataProvider();
        $session        =
            $sessionStorage->get($dataDefinition->getName() . '.' . $this->getSubmitAction($environment, true));

        $modelIds = [];
        foreach ($session['models'] as $modelId) {
            $modelIds[] = ModelId::fromSerialized($modelId)->getId();
        }

        $idProperty = \method_exists($dataProvider, 'getIdProperty') ? $dataProvider->getIdProperty() : 'id';
        return $dataProvider->fetchAll(
            $dataProvider->getEmptyConfig()->setFilter(
                [
                    [
                        'operation' => 'IN',
                        'property'  => $idProperty,
                        'values'    => $modelIds
                    ]
                ]
            )
        );
    }
private function getSelectCollection ( EnvironmentInterface $ environment ) { $ sessionStorage = $ environment -> getSessionStorage ( ) ; $ dataDefinition = $ environment -> getDataDefinition ( ) ; $ dataProvider = $ environment -> getDataProvider ( ) ; $ session = $ sessionStorage -> get ( $ dataDefinition -> getName ( ) . '.' . $ this -> getSubmitAction ( $ environment , true ) ) ; $ modelIds = [ ] ; foreach ( $ session [ 'models' ] as $ modelId ) { $ modelIds [ ] = ModelId :: fromSerialized ( $ modelId ) -> getId ( ) ; } $ idProperty = \ method_exists ( $ dataProvider , 'getIdProperty' ) ? $ dataProvider -> getIdProperty ( ) : 'id' ; return $ dataProvider -> fetchAll ( $ dataProvider -> getEmptyConfig ( ) -> setFilter ( [ [ 'operation' => 'IN' , 'property' => $ idProperty , 'values' => $ modelIds ] ] ) ) ; }
Get all select models in a collection.

@param EnvironmentInterface $environment The environment.

@return CollectionInterface
Get all select models in a collection .