src/Contao/View/Contao2BackendView/ActionHandler/MultipleHandler/PasteAllHandler.php
protected function getFlatCollection(EnvironmentInterface $environment)
    {
        $inputProvider = $environment->getInputProvider();

        $previousItem = null;
        $collection   = [];
        foreach ($this->getClipboardItems($environment) as $clipboardItem) {
            if ('create' === $clipboardItem->getAction()) {
                continue;
            }
            $pasteAfter =
                $previousItem ? $previousItem->getModelId()->getSerialized() : $inputProvider->getParameter('after');

            $collection[$clipboardItem->getModelId()->getSerialized()] = [
                'item'       => $clipboardItem,
                'pasteAfter' => $pasteAfter,
                'pasteMode'  => 'after'
            ];

            $previousItem = $clipboardItem;
        }

        return $collection;
    }
protected function getFlatCollection(EnvironmentInterface $environment)
    {
        $inputProvider = $environment->getInputProvider();

        $previousItem = null;
        $collection   = [];
        foreach ($this->getClipboardItems($environment) as $clipboardItem) {
            if ('create' === $clipboardItem->getAction()) {
                continue;
            }
            $pasteAfter =
                $previousItem ? $previousItem->getModelId()->getSerialized() : $inputProvider->getParameter('after');

            $collection[$clipboardItem->getModelId()->getSerialized()] = [
                'item'       => $clipboardItem,
                'pasteAfter' => $pasteAfter,
                'pasteMode'  => 'after'
            ];

            $previousItem = $clipboardItem;
        }

        return $collection;
    }
protected function getFlatCollection ( EnvironmentInterface $ environment ) { $ inputProvider = $ environment -> getInputProvider ( ) ; $ previousItem = null ; $ collection = [ ] ; foreach ( $ this -> getClipboardItems ( $ environment ) as $ clipboardItem ) { if ( 'create' === $ clipboardItem -> getAction ( ) ) { continue ; } $ pasteAfter = $ previousItem ? $ previousItem -> getModelId ( ) -> getSerialized ( ) : $ inputProvider -> getParameter ( 'after' ) ; $ collection [ $ clipboardItem -> getModelId ( ) -> getSerialized ( ) ] = [ 'item' => $ clipboardItem , 'pasteAfter' => $ pasteAfter , 'pasteMode' => 'after' ] ; $ previousItem = $ clipboardItem ; } return $ collection ; }
Get the flat collection.

@param EnvironmentInterface $environment The environment.

@return array
Get the flat collection .