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


PHP NodeInterface::hasProperty方法代码示例

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


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

示例1: matches

 /**
  * Returns TRUE if the given node has the property and the value is not empty.
  *
  * @param \TYPO3\TYPO3CR\Domain\Model\NodeInterface $node
  * @return boolean
  */
 public function matches(\TYPO3\TYPO3CR\Domain\Model\NodeInterface $node)
 {
     if ($node->hasProperty($this->propertyName)) {
         $propertyValue = $node->getProperty($this->propertyName);
         return !empty($propertyValue);
     }
     return FALSE;
 }
开发者ID:radmiraal,项目名称:TYPO3.TYPO3CR,代码行数:14,代码来源:PropertyNotEmpty.php

示例2: evaluate

 /**
  * {@inheritdoc}
  *
  * @param FlowQuery $flowQuery the FlowQuery object
  * @param array $arguments the arguments for this operation
  * @return mixed|null if the operation is final, the return value
  */
 public function evaluate(FlowQuery $flowQuery, array $arguments)
 {
     $imagePropertyName = $arguments[0];
     if ($this->contextNode->hasProperty($imagePropertyName)) {
         $image = $this->contextNode->getProperty($imagePropertyName);
         if ($image instanceof ImageVariant) {
             $image = $image->getOriginalAsset();
         }
         if ($image instanceof Image) {
             $identifier = $image->getIdentifier();
             $nodeData = $this->metaDataRepository->findOneByAssetIdentifier($identifier, $this->contextNode->getContext()->getWorkspace());
             if ($nodeData instanceof NodeData) {
                 return $this->nodeFactory->createFromNodeData($nodeData, $this->contextNode->getContext());
             }
         }
     }
     return null;
 }
开发者ID:neos,项目名称:metadata-contentrepositoryadapter,代码行数:25,代码来源:MetaDataOperation.php

示例3: extractComments

 /**
  * Extract comments and deserialize them
  *
  * @param NodeInterface|NodeData $nodeOrNodeData
  * @return array
  */
 protected function extractComments($nodeOrNodeData)
 {
     if ($nodeOrNodeData->hasProperty('comments')) {
         $comments = $nodeOrNodeData->getProperty('comments');
         if (is_string($comments) && strlen($comments) > 0) {
             return json_decode($comments, TRUE);
         }
     }
     return array();
 }
开发者ID:sandstorm,项目名称:contentcomments,代码行数:16,代码来源:WorkspaceAspect.php

示例4: setUniqueUriPathSegment

 /**
  * Sets the best possible uriPathSegment for the given Node.
  * Will use an already set uriPathSegment or alternatively the node name as base,
  * then checks if the uriPathSegment already exists on the same level and appends a counter until a unique path segment was found.
  *
  * @param NodeInterface $node
  * @return void
  */
 public static function setUniqueUriPathSegment(NodeInterface $node)
 {
     if ($node->getNodeType()->isOfType('TYPO3.Neos:Document')) {
         $q = new FlowQuery(array($node));
         $q = $q->context(array('invisibleContentShown' => true, 'removedContentShown' => true, 'inaccessibleContentShown' => true));
         $possibleUriPathSegment = $initialUriPathSegment = !$node->hasProperty('uriPathSegment') ? $node->getName() : $node->getProperty('uriPathSegment');
         $i = 1;
         while ($q->siblings('[instanceof TYPO3.Neos:Document][uriPathSegment="' . $possibleUriPathSegment . '"]')->count() > 0) {
             $possibleUriPathSegment = $initialUriPathSegment . '-' . $i++;
         }
         $node->setProperty('uriPathSegment', $possibleUriPathSegment);
     }
 }
开发者ID:hlubek,项目名称:neos-development-collection,代码行数:21,代码来源:NodeUriPathSegmentGenerator.php

示例5: getRequestPathByNode

 /**
  * Renders a request path based on the "uriPathSegment" properties of the nodes leading to the given node.
  *
  * @param NodeInterface $siteNode Top level node, corresponds to the top level of the request path
  * @param NodeInterface $node The node where the generated path should lead to
  * @return string A relative request path
  * @throws Exception\MissingNodePropertyException if the given node doesn't have a "uriPathSegment" property set
  */
 protected function getRequestPathByNode(NodeInterface $siteNode, NodeInterface $node)
 {
     if ($siteNode === $node) {
         return '';
     }
     $requestPathSegments = array();
     while ($siteNode !== $node && $node instanceof NodeInterface) {
         if (!$node->hasProperty('uriPathSegment')) {
             throw new Exception\MissingNodePropertyException(sprintf('Missing "uriPathSegment" property for node "%s". Nodes can be migrated with the "flow node:repair" command.', $node->getPath()), 1415020326);
         }
         $pathSegment = $node->getProperty('uriPathSegment');
         $requestPathSegments[] = $pathSegment;
         $node = $node->getParent();
     }
     return implode('/', array_reverse($requestPathSegments));
 }
开发者ID:radmiraal,项目名称:neos-development-collection,代码行数:24,代码来源:FrontendNodeRoutePartHandler.php

示例6: isTransformable

 /**
  * If the given node has no property this transformation should work on, this
  * returns TRUE.
  *
  * @param \TYPO3\TYPO3CR\Domain\Model\NodeInterface $node
  * @return boolean
  */
 public function isTransformable(\TYPO3\TYPO3CR\Domain\Model\NodeInterface $node)
 {
     return !$node->hasProperty($this->newPropertyName);
 }
开发者ID:radmiraal,项目名称:TYPO3.TYPO3CR,代码行数:11,代码来源:AddNewProperty.php


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