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


PHP NodeInterface::setNodeData方法代码示例

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


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

示例1: replaceNodeData

 /**
  * Replace the node data of a node instance with a given target node data
  *
  * The node data of the node that is published will be removed and the existing node data inside the target
  * workspace is updated to the changes and will be injected into the node instance. If the node was marked as
  * removed, both node data are removed.
  *
  * @param NodeInterface $node The node instance with node data to be published
  * @param NodeData $targetNodeData The existing node data in the target workspace
  * @return void
  */
 protected function replaceNodeData(NodeInterface $node, NodeData $targetNodeData)
 {
     $sourceNodeData = $node->getNodeData();
     $nodeWasMoved = false;
     $movedShadowNodeData = $this->nodeDataRepository->findOneByMovedTo($sourceNodeData);
     if ($movedShadowNodeData instanceof NodeData) {
         $nodeWasMoved = true;
         if ($movedShadowNodeData->isRemoved()) {
             $this->nodeDataRepository->remove($movedShadowNodeData);
         }
     }
     if ($node->isRemoved() === true) {
         $this->nodeDataRepository->remove($targetNodeData);
     } else {
         $targetNodeData->similarize($node->getNodeData());
         if ($nodeWasMoved) {
             $targetNodeData->setPath($node->getPath(), false);
         }
         $targetNodeData->setLastPublicationDateTime($this->now);
         $node->setNodeData($targetNodeData);
         $this->nodeService->cleanUpProperties($node);
     }
     $this->nodeDataRepository->remove($sourceNodeData);
 }
开发者ID:hlubek,项目名称:neos-development-collection,代码行数:35,代码来源:Workspace.php

示例2: moveNodeToDestinationPath

 /**
  * Moves the given node to the destination path by modifying the underlaying NodeData object.
  *
  * @param NodeInterface $node
  * @param string $destinationPath
  * @return void
  */
 protected function moveNodeToDestinationPath(NodeInterface $node, $destinationPath)
 {
     $nodeData = $node->getNodeData();
     $possibleShadowedNodeData = $nodeData->move($destinationPath, $this->context->getWorkspace());
     $node->setNodeData($possibleShadowedNodeData);
 }
开发者ID:hhoechtl,项目名称:neos-development-collection,代码行数:13,代码来源:Node.php

示例3: replaceNodeData

 /**
  * Replace the node data of a node instance with a given target node data
  *
  * The node data of the node that is published will be removed and the existing node data inside the target
  * workspace is updated to the changes and will be injected into the node instance. If the node was marked as
  * removed, both node data are removed.
  *
  * @param NodeInterface $node The node instance with node data to be published
  * @param NodeData $targetNodeData The existing node data in the target workspace
  * @return void
  */
 protected function replaceNodeData(NodeInterface $node, NodeData $targetNodeData)
 {
     $sourceNodeData = $node->getNodeData();
     $nodeWasMoved = $this->handleShadowNodeData($sourceNodeData, $targetNodeData->getWorkspace(), $targetNodeData);
     // Technically this shouldn't be needed but due to doctrines behavior we need it.
     if ($sourceNodeData->isRemoved() && $targetNodeData->getWorkspace()->getBaseWorkspace() === null) {
         $this->nodeDataRepository->remove($targetNodeData);
         $this->nodeDataRepository->remove($sourceNodeData);
         return;
     }
     $targetNodeData->similarize($sourceNodeData);
     $targetNodeData->setLastPublicationDateTime($this->now);
     if ($nodeWasMoved) {
         // TODO: This seems wrong and introduces a publish order between nodes. We should always set the path.
         $targetNodeData->setPath($node->getPath(), false);
     }
     $node->setNodeData($targetNodeData);
     $this->nodeService->cleanUpProperties($node);
     $targetNodeData->setRemoved($sourceNodeData->isRemoved());
     $this->nodeDataRepository->remove($sourceNodeData);
 }
开发者ID:hhoechtl,项目名称:neos-development-collection,代码行数:32,代码来源:Workspace.php

示例4: replaceNodeData

 /**
  * Replace the node data of a node instance with a given target node data
  *
  * The node data of the node that is published will be removed and the existing node data inside the target
  * workspace is updated to the changes and will be injected into the node instance. If the node was marked as
  * removed, both node data are removed.
  *
  * @param NodeInterface $node The node instance with node data to be published
  * @param NodeData $targetNodeData The existing node data in the target workspace
  * @return void
  */
 protected function replaceNodeData(NodeInterface $node, NodeData $targetNodeData)
 {
     $sourceNodeData = $node->getNodeData();
     if ($node->isRemoved() === TRUE) {
         $this->nodeDataRepository->remove($targetNodeData);
     } else {
         $targetNodeData->similarize($node->getNodeData());
         $targetNodeData->setPath($node->getPath(), FALSE);
         $node->setNodeData($targetNodeData);
     }
     $this->nodeDataRepository->remove($sourceNodeData);
 }
开发者ID:radmiraal,项目名称:TYPO3.TYPO3CR,代码行数:23,代码来源:Workspace.php


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