Neos.ContentRepository/Classes/Domain/Model/NodeData.php
public function createSingleNodeData($name, NodeType $nodeType = null, $identifier = null, Workspace $workspace = null, array $dimensions = null)
    {
        if (!is_string($name) || preg_match(NodeInterface::MATCH_PATTERN_NAME, $name) !== 1) {
            throw new \InvalidArgumentException('Invalid node name "' . $name . '" (a node name must only contain lowercase characters, numbers and the "-" sign).', 1292428697);
        }

        $nodeWorkspace = $workspace ?: $this->workspace;
        $newPath = NodePaths::addNodePathSegment($this->path, $name);
        if ($this->nodeDataRepository->findOneByPath($newPath, $nodeWorkspace, $dimensions, null) !== null) {
            throw new NodeExistsException(sprintf('Node with path "' . $newPath . '" already exists in workspace %s and given dimensions %s.', $nodeWorkspace->getName(), var_export($dimensions, true)), 1292503471);
        }

        $newNodeData = new NodeData($newPath, $nodeWorkspace, $identifier, $dimensions);
        if ($nodeType !== null) {
            $newNodeData->setNodeType($nodeType);
        }
        $this->nodeDataRepository->setNewIndex($newNodeData, NodeDataRepository::POSITION_LAST);

        return $newNodeData;
    }
public function createSingleNodeData($name, NodeType $nodeType = null, $identifier = null, Workspace $workspace = null, array $dimensions = null)
    {
        if (!is_string($name) || preg_match(NodeInterface::MATCH_PATTERN_NAME, $name) !== 1) {
            throw new \InvalidArgumentException('Invalid node name "' . $name . '" (a node name must only contain lowercase characters, numbers and the "-" sign).', 1292428697);
        }

        $nodeWorkspace = $workspace ?: $this->workspace;
        $newPath = NodePaths::addNodePathSegment($this->path, $name);
        if ($this->nodeDataRepository->findOneByPath($newPath, $nodeWorkspace, $dimensions, null) !== null) {
            throw new NodeExistsException(sprintf('Node with path "' . $newPath . '" already exists in workspace %s and given dimensions %s.', $nodeWorkspace->getName(), var_export($dimensions, true)), 1292503471);
        }

        $newNodeData = new NodeData($newPath, $nodeWorkspace, $identifier, $dimensions);
        if ($nodeType !== null) {
            $newNodeData->setNodeType($nodeType);
        }
        $this->nodeDataRepository->setNewIndex($newNodeData, NodeDataRepository::POSITION_LAST);

        return $newNodeData;
    }
public function createSingleNodeData ( $ name , NodeType $ nodeType = null , $ identifier = null , Workspace $ workspace = null , array $ dimensions = null ) { if ( ! is_string ( $ name ) || preg_match ( NodeInterface :: MATCH_PATTERN_NAME , $ name ) !== 1 ) { throw new \ InvalidArgumentException ( 'Invalid node name "' . $ name . '" (a node name must only contain lowercase characters, numbers and the "-" sign).' , 1292428697 ) ; } $ nodeWorkspace = $ workspace ? : $ this -> workspace ; $ newPath = NodePaths :: addNodePathSegment ( $ this -> path , $ name ) ; if ( $ this -> nodeDataRepository -> findOneByPath ( $ newPath , $ nodeWorkspace , $ dimensions , null ) !== null ) { throw new NodeExistsException ( sprintf ( 'Node with path "' . $ newPath . '" already exists in workspace %s and given dimensions %s.' , $ nodeWorkspace -> getName ( ) , var_export ( $ dimensions , true ) ) , 1292503471 ) ; } $ newNodeData = new NodeData ( $ newPath , $ nodeWorkspace , $ identifier , $ dimensions ) ; if ( $ nodeType !== null ) { $ newNodeData -> setNodeType ( $ nodeType ) ; } $ this -> nodeDataRepository -> setNewIndex ( $ newNodeData , NodeDataRepository :: POSITION_LAST ) ; return $ newNodeData ; }
Creates, adds and returns a child node of this node, without setting default
properties or creating subnodes.

@param string $name Name of the new node
@param NodeType $nodeType Node type of the new node (optional)
@param string $identifier The identifier of the node, unique within the workspace, optional(!)
@param Workspace $workspace
@param array $dimensions An array of dimension name to dimension values
@throws NodeExistsException if a node with this path already exists.
@throws \InvalidArgumentException if the node name is not accepted.
@return NodeData
Creates adds and returns a child node of this node without setting default properties or creating subnodes .