src/Controller/DefaultController.php
private function sortAndPersistModels(
        array $actions,
        ModelIdInterface $after = null,
        ModelIdInterface $into = null,
        ModelIdInterface $parentModelId = null,
        array &$items = []
    ) {
        /** @var DefaultCollection|ModelInterface[] $models */
        $models = $this->createModelCollectionFromActions($actions, $items);

        $this->triggerPrePasteModel($models);

        $this->processPasteAfter($models, $after);
        $this->processPasteInto($models, $into);
        $this->processPasteTopWithoutReference($models, $after, $into, $parentModelId);
        $this->processPasteTopAfterModel($models, $parentModelId);

        if ($models->count()) {
            throw new DcGeneralRuntimeException('Invalid parameters.');
        }

        return $models;
    }
private function sortAndPersistModels(
        array $actions,
        ModelIdInterface $after = null,
        ModelIdInterface $into = null,
        ModelIdInterface $parentModelId = null,
        array &$items = []
    ) {
        /** @var DefaultCollection|ModelInterface[] $models */
        $models = $this->createModelCollectionFromActions($actions, $items);

        $this->triggerPrePasteModel($models);

        $this->processPasteAfter($models, $after);
        $this->processPasteInto($models, $into);
        $this->processPasteTopWithoutReference($models, $after, $into, $parentModelId);
        $this->processPasteTopAfterModel($models, $parentModelId);

        if ($models->count()) {
            throw new DcGeneralRuntimeException('Invalid parameters.');
        }

        return $models;
    }
private function sortAndPersistModels ( array $ actions , ModelIdInterface $ after = null , ModelIdInterface $ into = null , ModelIdInterface $ parentModelId = null , array & $ items = [ ] ) { /** @var DefaultCollection|ModelInterface[] $models */ $ models = $ this -> createModelCollectionFromActions ( $ actions , $ items ) ; $ this -> triggerPrePasteModel ( $ models ) ; $ this -> processPasteAfter ( $ models , $ after ) ; $ this -> processPasteInto ( $ models , $ into ) ; $ this -> processPasteTopWithoutReference ( $ models , $ after , $ into , $ parentModelId ) ; $ this -> processPasteTopAfterModel ( $ models , $ parentModelId ) ; if ( $ models -> count ( ) ) { throw new DcGeneralRuntimeException ( 'Invalid parameters.' ) ; } return $ models ; }
Apply sorting and persist all models.

@param array            $actions       The actions collection.
@param ModelIdInterface $after         The previous model id.
@param ModelIdInterface $into          The hierarchical parent model id.
@param ModelIdInterface $parentModelId The parent model id.
@param array            $items         Write-back clipboard items.

@return DefaultCollection|ModelInterface[]

@throws DcGeneralRuntimeException When the parameters for the pasting destination are invalid.
Apply sorting and persist all models .