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


PHP NodeData::getWorkspace方法代码示例

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


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

示例1: setWorkspacesAllowsForSettingTheWorkspaceForInternalPurposes

 /**
  * @test
  */
 public function setWorkspacesAllowsForSettingTheWorkspaceForInternalPurposes()
 {
     $newWorkspace = $this->getMock('TYPO3\\TYPO3CR\\Domain\\Model\\Workspace', array(), array(), '', FALSE);
     $this->assertSame($this->mockWorkspace, $this->nodeData->getWorkspace());
     $this->nodeData->setWorkspace($newWorkspace);
     $this->assertSame($newWorkspace, $this->nodeData->getWorkspace());
 }
开发者ID:radmiraal,项目名称:TYPO3.TYPO3CR,代码行数:10,代码来源:NodeDataTest.php

示例2: isNodeDataMatchingContext

 /**
  * The NodeData matches the context if the workspace matches exactly.
  * Needs to be adjusted for further context dimensions.
  *
  * @return boolean
  */
 protected function isNodeDataMatchingContext()
 {
     if ($this->nodeDataIsMatchingContext === NULL) {
         $workspacesMatch = $this->nodeData->getWorkspace() !== NULL && $this->context->getWorkspace() !== NULL && $this->nodeData->getWorkspace()->getName() === $this->context->getWorkspace()->getName();
         $this->nodeDataIsMatchingContext = $workspacesMatch && $this->dimensionsAreMatchingTargetDimensionValues();
     }
     return $this->nodeDataIsMatchingContext;
 }
开发者ID:radmiraal,项目名称:TYPO3.TYPO3CR,代码行数:14,代码来源:Node.php

示例3: setWorkspacesAllowsForSettingTheWorkspaceForInternalPurposes

 /**
  * @test
  */
 public function setWorkspacesAllowsForSettingTheWorkspaceForInternalPurposes()
 {
     /** @var Workspace|\PHPUnit_Framework_MockObject_MockObject $newWorkspace */
     $newWorkspace = $this->getMockBuilder('TYPO3\\TYPO3CR\\Domain\\Model\\Workspace')->disableOriginalConstructor()->getMock();
     $this->assertSame($this->mockWorkspace, $this->nodeData->getWorkspace());
     $this->nodeData->setWorkspace($newWorkspace);
     $this->assertSame($newWorkspace, $this->nodeData->getWorkspace());
 }
开发者ID:hhoechtl,项目名称:neos-development-collection,代码行数:11,代码来源:NodeDataTest.php

示例4: setWorkspacesAllowsForSettingTheWorkspaceForInternalPurposes

 /**
  * @test
  */
 public function setWorkspacesAllowsForSettingTheWorkspaceForInternalPurposes()
 {
     /** @var Workspace|\PHPUnit_Framework_MockObject_MockObject $newWorkspace */
     $newWorkspace = $this->getMock('TYPO3\\TYPO3CR\\Domain\\Model\\Workspace', array(), array(), '', false);
     $this->assertSame($this->mockWorkspace, $this->nodeData->getWorkspace());
     $this->nodeData->setWorkspace($newWorkspace);
     $this->assertSame($newWorkspace, $this->nodeData->getWorkspace());
 }
开发者ID:sbruggmann,项目名称:neos-development-collection,代码行数:11,代码来源:NodeDataTest.php

示例5: createContextMatchingNodeData

 /**
  * Generates a Context that exactly fits the given NodeData Workspace, Dimensions & Site.
  *
  * @param NodeData $nodeData
  * @return ContentContext
  */
 protected function createContextMatchingNodeData(NodeData $nodeData)
 {
     $nodePath = NodePaths::getRelativePathBetween(SiteService::SITES_ROOT_PATH, $nodeData->getPath());
     list($siteNodeName) = explode('/', $nodePath);
     $site = $this->siteRepository->findOneByNodeName($siteNodeName);
     $contextProperties = ['workspaceName' => $nodeData->getWorkspace()->getName(), 'invisibleContentShown' => true, 'inaccessibleContentShown' => true, 'removedContentShown' => true, 'dimensions' => $nodeData->getDimensionValues(), 'currentSite' => $site];
     if ($domain = $site->getFirstActiveDomain()) {
         $contextProperties['currentDomain'] = $domain;
     }
     return $this->_contextFactory->create($contextProperties);
 }
开发者ID:robertlemke,项目名称:neos-development-collection,代码行数:17,代码来源:CreateContentContextTrait.php

示例6: execute

 /**
  * Change the property on the given node.
  *
  * @param NodeData $node
  * @return NodeData
  */
 public function execute(NodeData $node)
 {
     $reference = (string) $node->getProperty('plugin');
     $workspace = $node->getWorkspace();
     do {
         if ($this->reverse === false && preg_match(NodeInterface::MATCH_PATTERN_PATH, $reference)) {
             $pluginNode = $this->nodeDataRepository->findOneByPath($reference, $node->getWorkspace());
         } else {
             $pluginNode = $this->nodeDataRepository->findOneByIdentifier($reference, $node->getWorkspace());
         }
         if (isset($pluginNode)) {
             break;
         }
         $workspace = $workspace->getBaseWorkspace();
     } while ($workspace && $workspace->getName() !== 'live');
     if (isset($pluginNode)) {
         $node->setProperty('plugin', $this->reverse === false ? $pluginNode->getIdentifier() : $pluginNode->getPath());
     }
     return $node;
 }
开发者ID:mgoldbeck,项目名称:neos-development-collection,代码行数:26,代码来源:PluginViewTransformation.php

示例7: matches

 /**
  * Returns TRUE if the given node is in the workspace this filter expects.
  *
  * @param \TYPO3\TYPO3CR\Domain\Model\NodeData $node
  * @return boolean
  */
 public function matches(\TYPO3\TYPO3CR\Domain\Model\NodeData $node)
 {
     return $node->getWorkspace() !== NULL && $node->getWorkspace()->getName() === $this->workspaceName;
 }
开发者ID:radmiraal,项目名称:neos-development-collection,代码行数:10,代码来源:Workspace.php

示例8: matches

 /**
  * Returns TRUE if the given node is in the workspace this filter expects.
  *
  * @param NodeData $node
  * @return boolean
  */
 public function matches(NodeData $node)
 {
     return $node->getWorkspace() !== null && $node->getWorkspace()->getName() === $this->workspaceName;
 }
开发者ID:robertlemke,项目名称:neos-development-collection,代码行数:10,代码来源:Workspace.php

示例9: createContextMatchingNodeData

 /**
  * Generates a Context that exactly fits the given NodeData Workspace and Dimensions.
  *
  * TODO: We could get more specific about removed and invisible content by adding some more logic here that generates fitting values.
  *
  * @param NodeData $nodeData
  * @return Context
  */
 public function createContextMatchingNodeData(NodeData $nodeData)
 {
     return $this->contextFactory->create(array('workspaceName' => $nodeData->getWorkspace()->getName(), 'invisibleContentShown' => true, 'inaccessibleContentShown' => true, 'removedContentShown' => true, 'dimensions' => $nodeData->getDimensionValues()));
 }
开发者ID:hlubek,项目名称:neos-development-collection,代码行数:12,代码来源:NodeFactory.php


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