getName() публичный Метод

If a name has been set using setName(), it is returned. If not, but the template has a (non-empty) title property, this property is used to generate a valid name. As a last resort a random name is returned (in the form "name-XXXXX").
public getName ( ) : string
Результат string
Пример #1
0
 /**
  * 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;
 }
 /**
  * @test
  */
 public function setNameWithValidNameUpdatesName()
 {
     $nodeTemplate = new NodeTemplate();
     $nodeTemplate->setName('valid-node-name');
     $this->assertEquals('valid-node-name', $nodeTemplate->getName());
 }