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


PHP NodeData::similarize方法代码示例

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


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

示例1: similarizeClearsPropertiesBeforeAddingNewOnes

 /**
  * @test
  */
 public function similarizeClearsPropertiesBeforeAddingNewOnes()
 {
     /** @var $sourceNode NodeData */
     $sourceNode = $this->getAccessibleMock('TYPO3\\TYPO3CR\\Domain\\Model\\NodeData', array('addOrUpdate'), array('/foo/bar', $this->mockWorkspace));
     $this->inject($sourceNode, 'nodeTypeManager', $this->mockNodeTypeManager);
     $sourceNode->_set('nodeDataRepository', $this->createMock('TYPO3\\Flow\\Persistence\\RepositoryInterface'));
     $this->nodeData->setProperty('someProperty', 'somePropertyValue');
     $this->nodeData->setProperty('someOtherProperty', 'someOtherPropertyValue');
     $sourceNode->setProperty('newProperty', 'newPropertyValue');
     $sourceNode->setProperty('someProperty', 'someOverriddenPropertyValue');
     $this->nodeData->similarize($sourceNode);
     $expectedProperties = array('newProperty' => 'newPropertyValue', 'someProperty' => 'someOverriddenPropertyValue');
     $this->assertEquals($expectedProperties, $this->nodeData->getProperties());
 }
开发者ID:hhoechtl,项目名称:neos-development-collection,代码行数:17,代码来源:NodeDataTest.php

示例2: similarize

 /**
  * For internal use in createRecursiveCopy.
  *
  * @param NodeInterface $sourceNode
  * @return void
  */
 public function similarize(NodeInterface $sourceNode)
 {
     $this->nodeData->similarize($sourceNode->getNodeData());
 }
开发者ID:radmiraal,项目名称:TYPO3.TYPO3CR,代码行数:10,代码来源:Node.php

示例3: createShadow

 /**
  * Create a shadow NodeData at the given path with the same workspace and dimensions as this
  *
  * Note: The constructor will already add the new object to the repository
  *
  * @param string $path The (original) path for the node data
  * @return NodeData
  */
 public function createShadow($path)
 {
     $shadowNode = new NodeData($path, $this->workspace, $this->identifier, $this->dimensionValues);
     $shadowNode->similarize($this);
     $shadowNode->setAsShadowOf($this);
     return $shadowNode;
 }
开发者ID:mgoldbeck,项目名称:neos-development-collection,代码行数:15,代码来源:NodeData.php

示例4: createVariantForContext

 /**
  * Given a context a new node is returned that is like this node, but
  * lives in the new context.
  *
  * @param Context $context
  * @return NodeInterface
  */
 public function createVariantForContext($context)
 {
     $autoCreatedChildNodes = array();
     $nodeType = $this->getNodeType();
     foreach ($nodeType->getAutoCreatedChildNodes() as $childNodeName => $childNodeConfiguration) {
         $childNode = $this->getNode($childNodeName);
         if ($childNode !== null) {
             $autoCreatedChildNodes[$childNodeName] = $childNode;
         }
     }
     $nodeData = new NodeData($this->nodeData->getPath(), $context->getWorkspace(), $this->nodeData->getIdentifier(), $context->getTargetDimensionValues());
     $nodeData->similarize($this->nodeData);
     if ($this->context !== $context) {
         $node = $this->nodeFactory->createFromNodeData($nodeData, $context);
     } else {
         $this->setNodeData($nodeData);
         $node = $this;
     }
     $this->context->getFirstLevelNodeCache()->flush();
     $this->emitNodeAdded($node);
     /**
      * @var $autoCreatedChildNode NodeInterface
      */
     foreach ($autoCreatedChildNodes as $autoCreatedChildNode) {
         $autoCreatedChildNode->createVariantForContext($context);
     }
     return $node;
 }
开发者ID:rderidder,项目名称:neos-development-collection,代码行数:35,代码来源:Node.php


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