src/Contao/View/Contao2BackendView/ActionHandler/MultipleHandler/PasteAllHandler.php
private function process(EnvironmentInterface $environment)
    {
        $collection = $this->getCollection($environment);

        // If one item in the clipboard we don´t paste all here.
        if (\count($collection) < 1) {
            return;
        }

        $inputProvider = $environment->getInputProvider();
        $clipboard     = $environment->getClipboard();

        $inputProvider->setParameter('pasteAll', true);

        $this->addDispatchDuplicateModel($environment);

        foreach ($collection as $collectionItem) {
            $this->setParameterForPaste($collectionItem, $environment);

            $this->callAction($environment, 'paste');

            $clipboardItem = $collectionItem['item'];
            $clipboard->removeById($clipboardItem->getModelId());
        }
        $clipboard->saveTo($environment);

        $inputProvider->unsetParameter('pasteAll');

        ViewHelpers::redirectHome($environment);
    }
private function process(EnvironmentInterface $environment)
    {
        $collection = $this->getCollection($environment);

        // If one item in the clipboard we don´t paste all here.
        if (\count($collection) < 1) {
            return;
        }

        $inputProvider = $environment->getInputProvider();
        $clipboard     = $environment->getClipboard();

        $inputProvider->setParameter('pasteAll', true);

        $this->addDispatchDuplicateModel($environment);

        foreach ($collection as $collectionItem) {
            $this->setParameterForPaste($collectionItem, $environment);

            $this->callAction($environment, 'paste');

            $clipboardItem = $collectionItem['item'];
            $clipboard->removeById($clipboardItem->getModelId());
        }
        $clipboard->saveTo($environment);

        $inputProvider->unsetParameter('pasteAll');

        ViewHelpers::redirectHome($environment);
    }
private function process ( EnvironmentInterface $ environment ) { $ collection = $ this -> getCollection ( $ environment ) ; // If one item in the clipboard we don´t paste all here. if ( \ count ( $ collection ) < 1 ) { return ; } $ inputProvider = $ environment -> getInputProvider ( ) ; $ clipboard = $ environment -> getClipboard ( ) ; $ inputProvider -> setParameter ( 'pasteAll' , true ) ; $ this -> addDispatchDuplicateModel ( $ environment ) ; foreach ( $ collection as $ collectionItem ) { $ this -> setParameterForPaste ( $ collectionItem , $ environment ) ; $ this -> callAction ( $ environment , 'paste' ) ; $ clipboardItem = $ collectionItem [ 'item' ] ; $ clipboard -> removeById ( $ clipboardItem -> getModelId ( ) ) ; } $ clipboard -> saveTo ( $ environment ) ; $ inputProvider -> unsetParameter ( 'pasteAll' ) ; ViewHelpers :: redirectHome ( $ environment ) ; }
Process the paste all handler.

@param EnvironmentInterface $environment The environment.

@return void
Process the paste all handler .