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


PHP NodeData::getDimensionValues方法代码示例

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


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

示例1: execute

 /**
  * Add dimensions to the node.
  *
  * @param NodeData $node
  * @return void
  */
 public function execute(NodeData $node)
 {
     $dimensionValuesToBeAdded = $node->getDimensionValues();
     foreach ($this->dimensionValues as $dimensionName => $dimensionValues) {
         if (!isset($dimensionValuesToBeAdded[$dimensionName])) {
             if (is_array($dimensionValues)) {
                 $dimensionValuesToBeAdded[$dimensionName] = $dimensionValues;
             } else {
                 $dimensionValuesToBeAdded[$dimensionName] = array($dimensionValues);
             }
         }
     }
     if ($this->addDefaultDimensionValues === true) {
         $configuredDimensions = $this->contentDimensionRepository->findAll();
         foreach ($configuredDimensions as $configuredDimension) {
             if (!isset($dimensionValuesToBeAdded[$configuredDimension->getIdentifier()])) {
                 $dimensionValuesToBeAdded[$configuredDimension->getIdentifier()] = array($configuredDimension->getDefault());
             }
         }
     }
     $dimensionsToBeSet = array();
     foreach ($dimensionValuesToBeAdded as $dimensionName => $dimensionValues) {
         foreach ($dimensionValues as $dimensionValue) {
             $dimensionsToBeSet[] = new NodeDimension($node, $dimensionName, $dimensionValue);
         }
     }
     $node->setDimensions($dimensionsToBeSet);
 }
开发者ID:robertlemke,项目名称:neos-development-collection,代码行数:34,代码来源:AddDimensions.php

示例2: matches

 /**
  * Returns TRUE if the given node has the default dimension values.
  *
  * @param \TYPO3\TYPO3CR\Domain\Model\NodeData $node
  * @return boolean
  */
 public function matches(\TYPO3\TYPO3CR\Domain\Model\NodeData $node)
 {
     if ($this->filterForDefaultDimensionValues === true) {
         $configuredDimensions = $this->contentDimensionRepository->findAll();
         foreach ($configuredDimensions as $dimension) {
             $this->dimensionValues[$dimension->getIdentifier()] = array($dimension->getDefault());
         }
     }
     return $node->getDimensionValues() === $this->dimensionValues;
 }
开发者ID:hlubek,项目名称:neos-development-collection,代码行数:16,代码来源:DimensionValues.php

示例3: 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

示例4: getDimensions

 /**
  * Return the assigned content dimensions of the node.
  *
  * @return array
  */
 public function getDimensions()
 {
     return $this->nodeData->getDimensionValues();
 }
开发者ID:radmiraal,项目名称:TYPO3.TYPO3CR,代码行数:9,代码来源:Node.php

示例5: createNodeForVariant

 /**
  * Create a node for the given NodeData, given that it is a variant of the current node
  *
  * @param NodeData $nodeData
  * @return Node
  */
 protected function createNodeForVariant($nodeData)
 {
     $contextProperties = $this->context->getProperties();
     $contextProperties['dimensions'] = $nodeData->getDimensionValues();
     unset($contextProperties['targetDimensions']);
     $adjustedContext = $this->contextFactory->create($contextProperties);
     return $this->nodeFactory->createFromNodeData($nodeData, $adjustedContext);
 }
开发者ID:rderidder,项目名称:neos-development-collection,代码行数:14,代码来源:Node.php

示例6: adjustShadowNodeData

 /**
  * Adjust the given $shadowNodeData by removing it or moving it to the $targetWorkspace, as needed.
  *
  * @param NodeData $shadowNodeData
  * @param NodeData $publishedNodeData
  * @param Workspace $targetWorkspace
  * @param NodeData $targetNodeData
  * @return void
  */
 protected function adjustShadowNodeData(NodeData $shadowNodeData, NodeData $publishedNodeData, Workspace $targetWorkspace, NodeData $targetNodeData)
 {
     $nodeOnSamePathInTargetWorkspace = $this->nodeDataRepository->findOneByPath($shadowNodeData->getPath(), $targetWorkspace, $publishedNodeData->getDimensionValues());
     if ($nodeOnSamePathInTargetWorkspace !== null && $nodeOnSamePathInTargetWorkspace->getWorkspace() === $targetWorkspace) {
         $this->nodeDataRepository->remove($shadowNodeData);
         return;
     }
     $shadowNodeData->setMovedTo($targetNodeData);
     $shadowNodeData->setWorkspace($targetWorkspace);
     $targetWorkspaceBase = $targetWorkspace->getBaseWorkspace();
     $nodeInTargetWorkspaceBase = $this->nodeDataRepository->findOneByIdentifier($publishedNodeData->getIdentifier(), $targetWorkspaceBase, $publishedNodeData->getDimensionValues());
     if ($nodeInTargetWorkspaceBase !== null && $nodeInTargetWorkspaceBase->getPath() !== $shadowNodeData->getPath()) {
         $this->adjustShadowNodePath($shadowNodeData, $nodeInTargetWorkspaceBase->getPath(), $targetWorkspace, $publishedNodeData->getDimensionValues());
     }
 }
开发者ID:hhoechtl,项目名称:neos-development-collection,代码行数:24,代码来源:Workspace.php

示例7: setDimensionsRemovesDimensionValuesNotGiven

 /**
  * @test
  */
 public function setDimensionsRemovesDimensionValuesNotGiven()
 {
     $nodeData = new NodeData('/foo/bar', $this->mockWorkspace, null, array('c' => array('c1', 'c2'), 'a' => array('a1')));
     $dimensionsToSet = array(new NodeDimension($nodeData, 'c', 'c1'), new NodeDimension($nodeData, 'b', 'b1'), new NodeDimension($nodeData, 'f', 'f1'));
     $expectedDimensionValues = array('b' => array('b1'), 'c' => array('c1'), 'f' => array('f1'));
     $nodeData->setDimensions($dimensionsToSet);
     $setDimensionValues = $nodeData->getDimensionValues();
     $this->assertSame($expectedDimensionValues, $setDimensionValues);
 }
开发者ID:hhoechtl,项目名称:neos-development-collection,代码行数:12,代码来源:NodeDataTest.php

示例8: 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::getDimensionValues方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。