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


PHP NodeDataRepository::remove方法代码示例

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


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

示例1: pruneSite

 /**
  * Remove given site all nodes for that site and all domains associated.
  *
  * @param Site $site
  * @return void
  */
 public function pruneSite(Site $site)
 {
     $siteNodePath = '/sites/' . $site->getNodeName();
     $this->nodeDataRepository->removeAllInPath($siteNodePath);
     $siteNodes = $this->nodeDataRepository->findByPath($siteNodePath);
     foreach ($siteNodes as $siteNode) {
         $this->nodeDataRepository->remove($siteNode);
     }
     $domainsForSite = $this->domainRepository->findBySite($site);
     foreach ($domainsForSite as $domain) {
         $this->domainRepository->remove($domain);
     }
     $this->siteRepository->remove($site);
     $this->emitSitePruned($site);
 }
开发者ID:hlubek,项目名称:neos-development-collection,代码行数:21,代码来源:SiteService.php

示例2: pruneSite

 /**
  * Remove given site all nodes for that site and all domains associated.
  *
  * @param Site $site
  * @return void
  */
 public function pruneSite(Site $site)
 {
     $siteNodePath = NodePaths::addNodePathSegment(static::SITES_ROOT_PATH, $site->getNodeName());
     $this->nodeDataRepository->removeAllInPath($siteNodePath);
     $siteNodes = $this->nodeDataRepository->findByPath($siteNodePath);
     foreach ($siteNodes as $siteNode) {
         $this->nodeDataRepository->remove($siteNode);
     }
     $domainsForSite = $this->domainRepository->findBySite($site);
     foreach ($domainsForSite as $domain) {
         $this->domainRepository->remove($domain);
     }
     $this->siteRepository->remove($site);
     $this->emitSitePruned($site);
 }
开发者ID:mgoldbeck,项目名称:neos-development-collection,代码行数:21,代码来源:SiteService.php

示例3: doDiscardNode

 /**
  * Method which does the actual work of discarding, includes a protection against endless recursions and
  * multiple discarding of the same node.
  *
  * @param NodeInterface $node The node to discard
  * @param array &$alreadyDiscardedNodeIdentifiers List of node identifiers which already have been discarded during one discardNode() run
  * @return void
  * @throws \TYPO3\TYPO3CR\Exception\WorkspaceException
  */
 protected function doDiscardNode(NodeInterface $node, array &$alreadyDiscardedNodeIdentifiers = [])
 {
     if ($node->getWorkspace()->getBaseWorkspace() === null) {
         throw new WorkspaceException('Nodes in a in a workspace without a base workspace cannot be discarded.', 1395841899);
     }
     if ($node->getPath() === '/') {
         return;
     }
     if (array_search($node->getIdentifier(), $alreadyDiscardedNodeIdentifiers) !== false) {
         return;
     }
     $alreadyDiscardedNodeIdentifiers[] = $node->getIdentifier();
     $possibleShadowNodeData = $this->nodeDataRepository->findOneByMovedTo($node->getNodeData());
     if ($possibleShadowNodeData instanceof NodeData) {
         if ($possibleShadowNodeData->getMovedTo() !== null) {
             $parentBasePath = $node->getPath();
             $affectedChildNodeDataInSameWorkspace = $this->nodeDataRepository->findByParentAndNodeType($parentBasePath, null, $node->getWorkspace(), null, false, true);
             foreach ($affectedChildNodeDataInSameWorkspace as $affectedChildNodeData) {
                 /** @var NodeData $affectedChildNodeData */
                 $affectedChildNode = $this->nodeFactory->createFromNodeData($affectedChildNodeData, $node->getContext());
                 $this->doDiscardNode($affectedChildNode, $alreadyDiscardedNodeIdentifiers);
             }
         }
         $this->nodeDataRepository->remove($possibleShadowNodeData);
     }
     $this->nodeDataRepository->remove($node);
     $this->emitNodeDiscarded($node);
 }
开发者ID:robertlemke,项目名称:neos-development-collection,代码行数:37,代码来源:PublishingService.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

示例5: findByParentAndNodeTypeRemovesRemovedNodeInRepositoryAndRespectsWorkspaceAndDimensions

 /**
  * @test
  */
 public function findByParentAndNodeTypeRemovesRemovedNodeInRepositoryAndRespectsWorkspaceAndDimensions()
 {
     $liveWorkspace = new Workspace('live');
     $nodeData = $this->getMockBuilder('TYPO3\\TYPO3CR\\Domain\\Model\\NodeData')->disableOriginalConstructor()->getMock();
     $nodeData->expects($this->any())->method('getIdentifier')->will($this->returnValue('abcd-efgh-ijkl-mnop'));
     $nodeData->expects($this->any())->method('getPath')->will($this->returnValue('/foo/bar'));
     $nodeData->expects($this->any())->method('getDepth')->will($this->returnValue(2));
     $this->nodeDataRepository->remove($nodeData);
     $dimensions = array('persona' => array('everybody'), 'language' => array('de_DE', 'mul_ZZ'));
     $nodeData->expects($this->atLeastOnce())->method('matchesWorkspaceAndDimensions')->with($liveWorkspace, $dimensions)->will($this->returnValue(TRUE));
     $this->nodeDataRepository->expects($this->any())->method('getNodeDataForParentAndNodeType')->will($this->returnValue(array('abcd-efgh-ijkl-mnop' => $nodeData)));
     $result = $this->nodeDataRepository->findByParentAndNodeType('/foo', NULL, $liveWorkspace, $dimensions);
     $this->assertCount(0, $result);
 }
开发者ID:radmiraal,项目名称:neos-development-collection,代码行数:17,代码来源:NodeDataRepositoryTest.php

示例6: discardNode

 /**
  * Discards the given node.
  *
  * @param NodeInterface $node
  * @return void
  * @throws \TYPO3\TYPO3CR\Exception\WorkspaceException
  * @api
  */
 public function discardNode(NodeInterface $node)
 {
     if ($node->getWorkspace()->getBaseWorkspace() === NULL) {
         throw new WorkspaceException('Nodes in a in a workspace without a base workspace cannot be discarded.', 1395841899);
     }
     $possibleShadowNodeData = $this->nodeDataRepository->findOneByMovedTo($node->getNodeData());
     if ($possibleShadowNodeData !== NULL) {
         $this->nodeDataRepository->remove($possibleShadowNodeData);
     }
     if ($node->getPath() !== '/') {
         $this->nodeDataRepository->remove($node);
         $this->emitNodeDiscarded($node);
     }
 }
开发者ID:radmiraal,项目名称:neos-development-collection,代码行数:22,代码来源:PublishingService.php

示例7: moveNodeVariantToTargetWorkspace

 /**
  * Move the given node instance to the target workspace
  *
  * If no target node variant (having the same dimension values) exists in the target workspace, the node that
  * is published will be used as a new node variant in the target workspace.
  *
  * @param NodeInterface $node The node to publish
  * @param Workspace $targetWorkspace The workspace to publish to
  * @return void
  */
 protected function moveNodeVariantToTargetWorkspace(NodeInterface $node, Workspace $targetWorkspace)
 {
     $nodeData = $node->getNodeData();
     $movedShadowNodeData = $this->nodeDataRepository->findOneByMovedTo($nodeData);
     if ($movedShadowNodeData instanceof NodeData && $movedShadowNodeData->isRemoved()) {
         $this->nodeDataRepository->remove($movedShadowNodeData);
     }
     if ($targetWorkspace->getBaseWorkspace() === null && $node->isRemoved()) {
         $this->nodeDataRepository->remove($nodeData);
     } else {
         $nodeData->setWorkspace($targetWorkspace);
         $nodeData->setLastPublicationDateTime($this->now);
         $this->nodeService->cleanUpProperties($node);
     }
     $node->setNodeDataIsMatchingContext(null);
 }
开发者ID:hlubek,项目名称:neos-development-collection,代码行数:26,代码来源:Workspace.php

示例8: adjustShadowNodePath

 /**
  * Adjusts the path of $shadowNodeData to $path, if needed/possible.
  *
  * If the $path is occupied in $targetWorkspace, the shadow is removed.
  *
  * @param NodeData $shadowNodeData
  * @param $path
  * @param Workspace $targetWorkspace
  * @param array $dimensionValues
  * @return void
  */
 protected function adjustShadowNodePath(NodeData $shadowNodeData, $path, Workspace $targetWorkspace, array $dimensionValues)
 {
     $nodeOnSamePathInTargetWorkspace = $this->nodeDataRepository->findOneByPath($path, $targetWorkspace, $dimensionValues);
     if ($nodeOnSamePathInTargetWorkspace === null || $nodeOnSamePathInTargetWorkspace->getWorkspace() !== $targetWorkspace) {
         $shadowNodeData->setPath($path, false);
         return;
     }
     // A node exists in that path, so no shadow node is needed/possible.
     $this->nodeDataRepository->remove($shadowNodeData);
 }
开发者ID:hhoechtl,项目名称:neos-development-collection,代码行数:21,代码来源:Workspace.php

示例9: remove

 /**
  * Removes this node and all its child nodes.
  *
  * @return void
  */
 public function remove()
 {
     /** @var $childNode NodeData */
     foreach ($this->getChildNodeData() as $childNode) {
         $childNode->remove();
     }
     if ($this->workspace->getBaseWorkspace() === NULL) {
         $this->nodeDataRepository->remove($this);
     } else {
         $this->removed = TRUE;
         $this->nodeDataRepository->update($this);
     }
 }
开发者ID:radmiraal,项目名称:TYPO3.TYPO3CR,代码行数:18,代码来源:NodeData.php


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