Neos\ContentRepository\Domain\Model\NodeTemplate::getIdentifier PHP Method

getIdentifier() public method

Returns the UUID set in this NodeTemplate.
public getIdentifier ( ) : string
return string
    public function getIdentifier()
    {
        return $this->identifier;
    }

Usage Example

 /**
  * Creates and persists a node from the given $nodeTemplate as child node
  *
  * @param NodeTemplate $nodeTemplate
  * @param string $nodeName name of the new node. If not specified the name of the nodeTemplate will be used.
  * @param Workspace $workspace
  * @param array $dimensions
  * @return NodeData the freshly generated node
  */
 public function createNodeDataFromTemplate(NodeTemplate $nodeTemplate, $nodeName = null, Workspace $workspace = null, array $dimensions = null)
 {
     $newNodeName = $nodeName !== null ? $nodeName : $nodeTemplate->getName();
     $possibleNodeName = $this->nodeService->generateUniqueNodeName($this->getPath(), $newNodeName);
     $newNodeData = $this->createNodeData($possibleNodeName, $nodeTemplate->getNodeType(), $nodeTemplate->getIdentifier(), $workspace, $dimensions);
     $newNodeData->similarize($nodeTemplate);
     return $newNodeData;
 }