src/Controller/DefaultController.php
private function doActions(
        array $actions,
        ModelIdInterface $after = null,
        ModelIdInterface $into = null,
        ModelIdInterface $parentModelId = null,
        array &$items = []
    ) {
        if ($parentModelId) {
            $parentModel = $this->modelCollector->getModel($parentModelId);
        } else {
            $parentModel = null;
        }

        // Holds models, that need deep-copy
        $deepCopyList = [];

        // Apply create and copy actions
        foreach ($actions as &$action) {
            $this->applyAction($action, $deepCopyList, $parentModel);
        }
        unset($action);

        // When pasting after another model, apply same grouping information
        $this->ensureSameGrouping($actions, $after);

        // Now apply sorting and persist all models
        $models = $this->sortAndPersistModels($actions, $after, $into, $parentModelId, $items);

        // At least, go ahead with the deep copy
        $this->doDeepCopy($deepCopyList);

        return $models;
    }
private function doActions(
        array $actions,
        ModelIdInterface $after = null,
        ModelIdInterface $into = null,
        ModelIdInterface $parentModelId = null,
        array &$items = []
    ) {
        if ($parentModelId) {
            $parentModel = $this->modelCollector->getModel($parentModelId);
        } else {
            $parentModel = null;
        }

        // Holds models, that need deep-copy
        $deepCopyList = [];

        // Apply create and copy actions
        foreach ($actions as &$action) {
            $this->applyAction($action, $deepCopyList, $parentModel);
        }
        unset($action);

        // When pasting after another model, apply same grouping information
        $this->ensureSameGrouping($actions, $after);

        // Now apply sorting and persist all models
        $models = $this->sortAndPersistModels($actions, $after, $into, $parentModelId, $items);

        // At least, go ahead with the deep copy
        $this->doDeepCopy($deepCopyList);

        return $models;
    }
private function doActions ( array $ actions , ModelIdInterface $ after = null , ModelIdInterface $ into = null , ModelIdInterface $ parentModelId = null , array & $ items = [ ] ) { if ( $ parentModelId ) { $ parentModel = $ this -> modelCollector -> getModel ( $ parentModelId ) ; } else { $ parentModel = null ; } // Holds models, that need deep-copy $ deepCopyList = [ ] ; // Apply create and copy actions foreach ( $ actions as & $ action ) { $ this -> applyAction ( $ action , $ deepCopyList , $ parentModel ) ; } unset ( $ action ) ; // When pasting after another model, apply same grouping information $ this -> ensureSameGrouping ( $ actions , $ after ) ; // Now apply sorting and persist all models $ models = $ this -> sortAndPersistModels ( $ actions , $ after , $ into , $ parentModelId , $ items ) ; // At least, go ahead with the deep copy $ this -> doDeepCopy ( $ deepCopyList ) ; return $ models ; }
Effectively do the actions.

@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 CollectionInterface
Effectively do the actions .