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


PHP NodeInterface::dimensionsAreMatchingTargetDimensionValues方法代码示例

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


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

示例1: addCssClasses

 /**
  * Add required CSS classes to the attributes.
  *
  * @param array $attributes
  * @param NodeInterface $node
  * @param array $initialClasses
  * @return array
  */
 protected function addCssClasses(array $attributes, NodeInterface $node, array $initialClasses = [])
 {
     $classNames = $initialClasses;
     // FIXME: The `dimensionsAreMatchingTargetDimensionValues` method should become part of the NodeInterface if it is used here .
     if ($node instanceof Node && !$node->dimensionsAreMatchingTargetDimensionValues()) {
         $classNames[] = 'neos-contentelement-shine-through';
     }
     if ($classNames !== []) {
         $attributes['class'] = implode(' ', $classNames);
     }
     return $attributes;
 }
开发者ID:robertlemke,项目名称:neos-development-collection,代码行数:20,代码来源:ContentElementWrappingService.php

示例2: adoptNode

 /**
  * Adopts a node from a (possibly) different context to this context
  *
  * Checks if a node variant matching the exact dimensions already exists for this context and
  * return it if found. Otherwise a new node variant for this context is created.
  *
  * In case the node already exists in the context but does not match the target dimensions a
  * new, more specific node is created and returned.
  *
  * @param NodeInterface $node The node with a different context. If the context of the given node is the same as this context the operation will have no effect.
  * @param boolean $recursive If TRUE also adopt all descendant nodes which are non-aggregate
  * @return NodeInterface A new or existing node that matches this context
  */
 public function adoptNode(NodeInterface $node, $recursive = false)
 {
     if ($node->getContext() === $this && $node->dimensionsAreMatchingTargetDimensionValues()) {
         return $node;
     }
     $this->emitBeforeAdoptNode($node, $this, $recursive);
     $existingNode = $this->getNodeByIdentifier($node->getIdentifier());
     if ($existingNode !== null) {
         if ($existingNode->dimensionsAreMatchingTargetDimensionValues()) {
             $adoptedNode = $existingNode;
         } else {
             $adoptedNode = $existingNode->createVariantForContext($this);
         }
     } else {
         $adoptedNode = $node->createVariantForContext($this);
     }
     $this->firstLevelNodeCache->setByIdentifier($adoptedNode->getIdentifier(), $adoptedNode);
     if ($recursive) {
         $childNodes = $node->getChildNodes();
         /** @var NodeInterface $childNode */
         foreach ($childNodes as $childNode) {
             if (!$childNode->getNodeType()->isAggregate()) {
                 $this->adoptNode($childNode, true);
             }
         }
     }
     $this->emitAfterAdoptNode($node, $this, $recursive);
     return $adoptedNode;
 }
开发者ID:mgoldbeck,项目名称:neos-development-collection,代码行数:42,代码来源:Context.php


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