src/Contao/View/Contao2BackendView/ActionHandler/MultipleHandler/PasteAllHandler.php
protected function setParameterForPaste(array $collectionItem, EnvironmentInterface $environment)
    {
        $inputProvider = $environment->getInputProvider();
        $clipboardItem = $collectionItem['item'];

        $inputProvider->unsetParameter('after');
        $inputProvider->unsetParameter('into');
        $inputProvider->unsetParameter('source');
        $inputProvider->setParameter('source', $clipboardItem->getModelId()->getSerialized());

        if (!$this->originalModel) {
            $inputProvider->setParameter($collectionItem['pasteMode'], $collectionItem['pasteAfter']);

            return;
        }

        $pasteAfterId = ModelId::fromSerialized($collectionItem['pasteAfter']);
        if ($pasteAfterId->getId() !== $this->originalModel->getID()) {
            $inputProvider->setParameter($collectionItem['pasteMode'], $collectionItem['pasteAfter']);

            return;
        }

        $copiedModelId = ModelId::fromModel($this->copiedModel);

        $inputProvider->setParameter($collectionItem['pasteMode'], $copiedModelId->getSerialized());
    }
protected function setParameterForPaste(array $collectionItem, EnvironmentInterface $environment)
    {
        $inputProvider = $environment->getInputProvider();
        $clipboardItem = $collectionItem['item'];

        $inputProvider->unsetParameter('after');
        $inputProvider->unsetParameter('into');
        $inputProvider->unsetParameter('source');
        $inputProvider->setParameter('source', $clipboardItem->getModelId()->getSerialized());

        if (!$this->originalModel) {
            $inputProvider->setParameter($collectionItem['pasteMode'], $collectionItem['pasteAfter']);

            return;
        }

        $pasteAfterId = ModelId::fromSerialized($collectionItem['pasteAfter']);
        if ($pasteAfterId->getId() !== $this->originalModel->getID()) {
            $inputProvider->setParameter($collectionItem['pasteMode'], $collectionItem['pasteAfter']);

            return;
        }

        $copiedModelId = ModelId::fromModel($this->copiedModel);

        $inputProvider->setParameter($collectionItem['pasteMode'], $copiedModelId->getSerialized());
    }
protected function setParameterForPaste ( array $ collectionItem , EnvironmentInterface $ environment ) { $ inputProvider = $ environment -> getInputProvider ( ) ; $ clipboardItem = $ collectionItem [ 'item' ] ; $ inputProvider -> unsetParameter ( 'after' ) ; $ inputProvider -> unsetParameter ( 'into' ) ; $ inputProvider -> unsetParameter ( 'source' ) ; $ inputProvider -> setParameter ( 'source' , $ clipboardItem -> getModelId ( ) -> getSerialized ( ) ) ; if ( ! $ this -> originalModel ) { $ inputProvider -> setParameter ( $ collectionItem [ 'pasteMode' ] , $ collectionItem [ 'pasteAfter' ] ) ; return ; } $ pasteAfterId = ModelId :: fromSerialized ( $ collectionItem [ 'pasteAfter' ] ) ; if ( $ pasteAfterId -> getId ( ) !== $ this -> originalModel -> getID ( ) ) { $ inputProvider -> setParameter ( $ collectionItem [ 'pasteMode' ] , $ collectionItem [ 'pasteAfter' ] ) ; return ; } $ copiedModelId = ModelId :: fromModel ( $ this -> copiedModel ) ; $ inputProvider -> setParameter ( $ collectionItem [ 'pasteMode' ] , $ copiedModelId -> getSerialized ( ) ) ; }
Set the parameter for paste.

@param array                $collectionItem The collection item.
@param EnvironmentInterface $environment    The environment.

@return void
Set the parameter for paste .