当前位置: 首页>>代码示例>>PHP>>正文


PHP NodeData::createSingleNodeData方法代码示例

本文整理汇总了PHP中TYPO3\TYPO3CR\Domain\Model\NodeData::createSingleNodeData方法的典型用法代码示例。如果您正苦于以下问题:PHP NodeData::createSingleNodeData方法的具体用法?PHP NodeData::createSingleNodeData怎么用?PHP NodeData::createSingleNodeData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TYPO3\TYPO3CR\Domain\Model\NodeData的用法示例。


在下文中一共展示了NodeData::createSingleNodeData方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: createSingleNode

 /**
  * Creates, adds and returns a child node of this node, without setting default
  * properties or creating subnodes. Only used internally.
  *
  * For internal use only!
  * TODO: New SiteImportService uses createNode() and DQL. When we drop the LegagcySiteImportService we can change this to protected.
  *
  * @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(!)
  * @return Node
  * @throws NodeConstraintException
  */
 public function createSingleNode($name, NodeType $nodeType = null, $identifier = null)
 {
     if ($nodeType !== null && !$this->willChildNodeBeAutoCreated($name) && !$this->isNodeTypeAllowedAsChildNode($nodeType)) {
         throw new NodeConstraintException('Cannot create new node "' . $name . '" of Type "' . $nodeType->getName() . '" in ' . $this->__toString(), 1400782413);
     }
     $dimensions = $this->context->getTargetDimensionValues();
     $nodeData = $this->nodeData->createSingleNodeData($name, $nodeType, $identifier, $this->context->getWorkspace(), $dimensions);
     $node = $this->nodeFactory->createFromNodeData($nodeData, $this->context);
     $this->context->getFirstLevelNodeCache()->flush();
     $this->emitNodeAdded($node);
     return $node;
 }
开发者ID:rderidder,项目名称:neos-development-collection,代码行数:25,代码来源:Node.php

示例2: createSingleNode

 /**
  * Creates, adds and returns a child node of this node, without setting default
  * properties or creating subnodes. Only used internally.
  *
  * For internal use only!
  * TODO: Check if we can change the import service to avoid making this public.
  *
  * @param string $name Name of the new node
  * @param \TYPO3\TYPO3CR\Domain\Model\NodeType $nodeType Node type of the new node (optional)
  * @param string $identifier The identifier of the node, unique within the workspace, optional(!)
  * @param array $dimensions Content dimension values to set on the node (Array of dimension names to array of values)
  * @return \TYPO3\TYPO3CR\Domain\Model\Node
  */
 public function createSingleNode($name, NodeType $nodeType = NULL, $identifier = NULL, array $dimensions = NULL)
 {
     if ($dimensions === NULL || $dimensions === array()) {
         $targetDimensions = $this->context->getTargetDimensions();
         $dimensions = array_map(function ($value) {
             return array($value);
         }, $targetDimensions);
     }
     $nodeData = $this->nodeData->createSingleNodeData($name, $nodeType, $identifier, $this->context->getWorkspace(), $dimensions);
     $node = $this->nodeFactory->createFromNodeData($nodeData, $this->context);
     $this->context->getFirstLevelNodeCache()->flush();
     $this->emitNodeAdded($node);
     return $node;
 }
开发者ID:radmiraal,项目名称:TYPO3.TYPO3CR,代码行数:27,代码来源:Node.php


注:本文中的TYPO3\TYPO3CR\Domain\Model\NodeData::createSingleNodeData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。