本文整理汇总了PHP中TYPO3\TYPO3CR\Domain\Model\NodeInterface::getDimensions方法的典型用法代码示例。如果您正苦于以下问题:PHP NodeInterface::getDimensions方法的具体用法?PHP NodeInterface::getDimensions怎么用?PHP NodeInterface::getDimensions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\TYPO3CR\Domain\Model\NodeInterface
的用法示例。
在下文中一共展示了NodeInterface::getDimensions方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: findNodeDataInTargetWorkspace
/**
* Returns the NodeData instance with the given identifier from the target workspace.
* If no NodeData instance is found, NULL is returned.
*
* @param NodeInterface $node
* @param Workspace $targetWorkspace
* @return NodeData
*/
protected function findNodeDataInTargetWorkspace(NodeInterface $node, Workspace $targetWorkspace)
{
$nodeData = $this->nodeDataRepository->findOneByIdentifier($node->getIdentifier(), $targetWorkspace, $node->getDimensions());
return $nodeData === null || $nodeData->getWorkspace() === $targetWorkspace ? $nodeData : null;
}
示例2: createRecursiveCopy
/**
* Create a recursive copy of this node below $referenceNode with $nodeName.
*
* $detachedCopy only has an influence if we are copying from one dimension to the other, possibly creating a new
* node variant:
*
* - If $detachedCopy is TRUE, the whole (recursive) copy is done without connecting original and copied node,
* so NOT CREATING a new node variant.
* - If $detachedCopy is FALSE, and the node does not yet have a variant in the target dimension, we are CREATING
* a new node variant.
*
* As a caller of this method, $detachedCopy should be TRUE if $this->getNodeType()->isAggregate() is TRUE, and FALSE
* otherwise.
*
* @param NodeInterface $referenceNode
* @param boolean $detachedCopy
* @param string $nodeName
* @return NodeInterface
*/
protected function createRecursiveCopy(NodeInterface $referenceNode, $nodeName, $detachedCopy)
{
$identifier = null;
$referenceNodeDimensions = $referenceNode->getDimensions();
$referenceNodeDimensionsHash = Utility::sortDimensionValueArrayAndReturnDimensionsHash($referenceNodeDimensions);
$thisDimensions = $this->getDimensions();
$thisNodeDimensionsHash = Utility::sortDimensionValueArrayAndReturnDimensionsHash($thisDimensions);
if ($detachedCopy === false && $referenceNodeDimensionsHash !== $thisNodeDimensionsHash && $referenceNode->getContext()->getNodeByIdentifier($this->getIdentifier()) === null) {
// If the target dimensions are different than this one, and there is no node shadowing this one in the target dimension yet, we use the same
// node identifier, effectively creating a new node variant.
$identifier = $this->getIdentifier();
}
$copiedNode = $referenceNode->createSingleNode($nodeName, null, $identifier);
$copiedNode->similarize($this, true);
/** @var $childNode Node */
foreach ($this->getChildNodes() as $childNode) {
// Prevent recursive copy when copying into itself
if ($childNode->getIdentifier() !== $copiedNode->getIdentifier()) {
$childNode->copyIntoInternal($copiedNode, $childNode->getName(), $detachedCopy);
}
}
return $copiedNode;
}