Neos.Neos/Classes/Controller/Service/NodesController.php
public function createAction($mode, $identifier, $workspaceName = 'live', array $dimensions = [], array $sourceDimensions = [])
    {
        if ($mode === 'adoptFromAnotherDimension' || $mode === 'adoptFromAnotherDimensionAndCopyContent') {
            $originalContentContext = $this->createContentContext($workspaceName, $sourceDimensions);
            $node = $originalContentContext->getNodeByIdentifier($identifier);

            if ($node === null) {
                $this->throwStatus(404, 'Original node was not found.');
            }

            $contentContext = $this->createContentContext($workspaceName, $dimensions);

            $this->adoptNodeAndParents($node, $contentContext, $mode === 'adoptFromAnotherDimensionAndCopyContent');

            $this->redirect('show', null, null, [
                'identifier' => $identifier,
                'workspaceName' => $workspaceName,
                'dimensions' => $dimensions
            ]);
        } else {
            $this->throwStatus(400, sprintf('The create mode "%s" is not supported.', $mode));
        }
    }
public function createAction($mode, $identifier, $workspaceName = 'live', array $dimensions = [], array $sourceDimensions = [])
    {
        if ($mode === 'adoptFromAnotherDimension' || $mode === 'adoptFromAnotherDimensionAndCopyContent') {
            $originalContentContext = $this->createContentContext($workspaceName, $sourceDimensions);
            $node = $originalContentContext->getNodeByIdentifier($identifier);

            if ($node === null) {
                $this->throwStatus(404, 'Original node was not found.');
            }

            $contentContext = $this->createContentContext($workspaceName, $dimensions);

            $this->adoptNodeAndParents($node, $contentContext, $mode === 'adoptFromAnotherDimensionAndCopyContent');

            $this->redirect('show', null, null, [
                'identifier' => $identifier,
                'workspaceName' => $workspaceName,
                'dimensions' => $dimensions
            ]);
        } else {
            $this->throwStatus(400, sprintf('The create mode "%s" is not supported.', $mode));
        }
    }
public function createAction ( $ mode , $ identifier , $ workspaceName = 'live' , array $ dimensions = [ ] , array $ sourceDimensions = [ ] ) { if ( $ mode === 'adoptFromAnotherDimension' || $ mode === 'adoptFromAnotherDimensionAndCopyContent' ) { $ originalContentContext = $ this -> createContentContext ( $ workspaceName , $ sourceDimensions ) ; $ node = $ originalContentContext -> getNodeByIdentifier ( $ identifier ) ; if ( $ node === null ) { $ this -> throwStatus ( 404 , 'Original node was not found.' ) ; } $ contentContext = $ this -> createContentContext ( $ workspaceName , $ dimensions ) ; $ this -> adoptNodeAndParents ( $ node , $ contentContext , $ mode === 'adoptFromAnotherDimensionAndCopyContent' ) ; $ this -> redirect ( 'show' , null , null , [ 'identifier' => $ identifier , 'workspaceName' => $ workspaceName , 'dimensions' => $ dimensions ] ) ; } else { $ this -> throwStatus ( 400 , sprintf ( 'The create mode "%s" is not supported.' , $ mode ) ) ; } }
Create a new node from an existing one

The "mode" property defines the basic mode of operation. Currently supported modes:

'adoptFromAnotherDimension': Adopts the single node from another dimension
- $identifier, $workspaceName and $sourceDimensions specify the source node
- $identifier, $workspaceName and $dimensions specify the target node

@param string $mode
@param string $identifier Specifies the identifier of the node to be created; if source
@param string $workspaceName Name of the workspace where to create the node in
@param array $dimensions Optional list of dimensions and their values in which the node should be created
@param array $sourceDimensions
@return string
Create a new node from an existing one