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


PHP NodeInterface::getPropertyValue方法代码示例

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


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

示例1: read

 /**
  * {@inheritdoc}
  */
 public function read(NodeInterface $node, PropertyInterface $property, $webspaceKey, $languageCode, $segmentKey = null)
 {
     if ($node->hasProperty($property->getName())) {
         $value = $node->getPropertyValue($property->getName());
         $property->setValue($value);
     }
 }
开发者ID:Silwereth,项目名称:sulu,代码行数:10,代码来源:ResourceLocator.php

示例2: read

 /**
  * {@inheritdoc}
  */
 public function read(NodeInterface $node, PropertyInterface $property, $webspaceKey, $languageCode, $segmentKey)
 {
     $values = [];
     if ($node->hasProperty($property->getName())) {
         $values = $node->getPropertyValue($property->getName());
     }
     $this->setData($values, $property);
 }
开发者ID:Silwereth,项目名称:sulu,代码行数:11,代码来源:ContactSelectionContentType.php

示例3: read

 /**
  * {@inheritdoc}
  */
 public function read(NodeInterface $node, PropertyInterface $property, $webspaceKey, $languageCode, $segmentKey)
 {
     $value = $this->defaultValue;
     if ($node->hasProperty($property->getName())) {
         $value = $node->getPropertyValue($property->getName());
     }
     $property->setValue($this->decodeValue($value));
     return $value;
 }
开发者ID:sulu,项目名称:sulu,代码行数:12,代码来源:SimpleContentType.php

示例4: read

 /**
  * {@inheritdoc}
  */
 public function read(NodeInterface $node, PropertyInterface $property, $webspaceKey, $languageCode, $segmentKey)
 {
     $values = [];
     if ($node->hasProperty($property->getName())) {
         $values = $node->getPropertyValue($property->getName());
     }
     $refs = isset($values) ? $values : [];
     $property->setValue($refs);
 }
开发者ID:sulu,项目名称:sulu,代码行数:12,代码来源:ContactSelectionContentType.php

示例5: testReadPropertyNotExists

 public function testReadPropertyNotExists()
 {
     $type = new ContactSelectionContentType($this->template, $this->contactManager->reveal(), $this->accountManager->reveal(), $this->serializer->reveal(), new CustomerIdConverter(), new IndexComparator());
     $this->property->getName()->willReturn('test');
     $this->node->hasProperty('test')->willReturn(false);
     $this->node->getPropertyValue(Argument::any(), Argument::any())->shouldNotBeCalled();
     $this->property->setValue([])->shouldBeCalled();
     $type->read($this->node->reveal(), $this->property->reveal(), $this->webspaceKey, $this->locale, $this->segmentKey);
 }
开发者ID:Silwereth,项目名称:sulu,代码行数:9,代码来源:ContactSelectionContentTypeTest.php

示例6: read

 /**
  * {@inheritdoc}
  */
 public function read(NodeInterface $node, PropertyInterface $property, $webspaceKey, $languageCode, $segmentKey)
 {
     $value = '';
     if ($node->hasProperty($property->getName())) {
         /** @var \DateTime $propertyValue */
         $propertyValue = $node->getPropertyValue($property->getName());
         $value = $propertyValue->format('Y-m-d');
     }
     $property->setValue($value);
     return $value;
 }
开发者ID:ollietb,项目名称:sulu,代码行数:14,代码来源:Date.php

示例7: read

 /**
  * {@inheritdoc}
  */
 public function read(NodeInterface $node, PropertyInterface $property, $webspaceKey, $languageCode, $segmentKey)
 {
     $value = $this->defaultValue;
     if ($node->hasProperty($property->getName())) {
         $value = $node->getPropertyValue($property->getName());
     }
     // the RedirectType subscriber sets the internal link as a reference
     if ($value instanceof NodeInterface) {
         $value = $value->getIdentifier();
     }
     $property->setValue($value);
     return $value;
 }
开发者ID:Silwereth,项目名称:sulu,代码行数:16,代码来源:SingleInternalLink.php

示例8: resolveMetadataForNode

 /**
  * {@inheritdoc}
  */
 public function resolveMetadataForNode(NodeInterface $node)
 {
     if (false === $node->hasProperty('jcr:mixinTypes')) {
         return;
     }
     $mixinTypes = (array) $node->getPropertyValue('jcr:mixinTypes');
     foreach ($mixinTypes as $mixinType) {
         if (true == $this->metadataFactory->hasMetadataForPhpcrType($mixinType)) {
             return $this->metadataFactory->getMetadataForPhpcrType($mixinType);
         }
     }
     return;
 }
开发者ID:hason,项目名称:sulu-document-manager,代码行数:16,代码来源:MixinStrategy.php

示例9: loadTranslation

 /**
  * {@inheritdoc}
  */
 public function loadTranslation($document, NodeInterface $node, ClassMetadata $metadata, $locale)
 {
     if ($node->hasProperty($this->prefix . ':' . $locale . self::NULLFIELDS)) {
         $nullFields = $node->getPropertyValue($this->prefix . ':' . $locale . self::NULLFIELDS);
         $nullFields = array_flip($nullFields);
     } else {
         $nullFields = array();
     }
     foreach ($metadata->translatableFields as $field) {
         $propName = $this->getTranslatedPropertyName($locale, $field);
         if (isset($nullFields[$field])) {
             $value = null;
         } elseif ($node->hasProperty($propName)) {
             $value = $node->getPropertyValue($propName);
         } else {
             // Could not find the translation in the given language
             return false;
         }
         $metadata->reflFields[$field]->setValue($document, $value);
     }
     return true;
 }
开发者ID:nicam,项目名称:phpcr-odm,代码行数:25,代码来源:AttributeTranslationStrategy.php

示例10: upgradeNode

 /**
  * Upgrade a single node.
  *
  * @param NodeInterface $node
  * @param string $propertyName
  * @param string $locale
  */
 private function upgradeNode(NodeInterface $node, $propertyName, $locale)
 {
     foreach ($node->getNodes() as $child) {
         $this->upgradeNode($child, $propertyName, $locale);
     }
     if (false === $node->getPropertyValueWithDefault($propertyName, false)) {
         return;
     }
     $shadowLocale = $node->getPropertyValue($this->getPropertyName(self::SHADOW_BASE_PROPERTY, $locale));
     $tags = $this->getTags($node, $shadowLocale);
     $categories = $this->getCategories($node, $shadowLocale);
     $navigationContext = $this->getNavigationContext($node, $shadowLocale);
     $node->setProperty(sprintf(self::TAGS_PROPERTY, $locale), $tags);
     $node->setProperty(sprintf(self::CATEGORIES_PROPERTY, $locale), $categories);
     $node->setProperty(sprintf(self::NAVIGATION_CONTEXT_PROPERTY, $locale), $navigationContext);
 }
开发者ID:sulu,项目名称:sulu,代码行数:23,代码来源:Version201507231648.php

示例11: updateResourceSegmentProperty

 /**
  * Updates the property for the resource segment on the given node.
  *
  * @param NodeInterface $node
  * @param string $resourceSegmentPropertyName
  * @param string $parentUuid
  * @param string $webspaceKey
  * @param string $locale
  */
 private function updateResourceSegmentProperty(NodeInterface $node, $resourceSegmentPropertyName, $parentUuid, $webspaceKey, $locale)
 {
     $resourceLocatorStrategy = $this->resourceLocatorStrategyPool->getStrategyByWebspaceKey($webspaceKey);
     $childPart = $resourceLocatorStrategy->getChildPart($node->getPropertyValue($resourceSegmentPropertyName));
     $node->setProperty($resourceSegmentPropertyName, $resourceLocatorStrategy->generate($childPart, $parentUuid, $webspaceKey, $locale));
 }
开发者ID:sulu,项目名称:sulu,代码行数:15,代码来源:ResourceSegmentSubscriber.php

示例12: mapUrl

 /**
  * @param SessionInterface $session
  * @param NodeInterface    $node
  *
  * @return bool|string FALSE if not mapped, string if url is mapped
  */
 protected function mapUrl(SessionInterface $session, NodeInterface $node)
 {
     $phpcrClass = $node->getPropertyValue('phpcr:class');
     if (!is_subclass_of($phpcrClass, 'Symfony\\Cmf\\Component\\Routing\\RouteReferrersReadInterface')) {
         return false;
     }
     try {
         $url = $this->router->generate(null, array('content_id' => $node->getIdentifier()));
     } catch (RouteNotFoundException $e) {
         return false;
     }
     return $url;
 }
开发者ID:symfony-cmf,项目名称:search-bundle,代码行数:19,代码来源:SearchController.php

示例13: checkNodeProperty

 /**
  * Check specified property exists, then compare property value to the supplied one using assertEquals.
  *
  * @param NodeInterface $node
  * @param string $property
  * @param mixed $value
  */
 protected function checkNodeProperty(NodeInterface $node, $property, $value)
 {
     $this->assertTrue($node->hasProperty($property));
     $this->assertEquals($value, $node->getPropertyValue($property));
 }
开发者ID:laurentiuc,项目名称:phpcr-api-tests,代码行数:12,代码来源:BaseCase.php

示例14: upgradeProperty

 /**
  * Upgrades the given property to the new date representation.
  *
  * @param PropertyMetadata $property
  * @param NodeInterface $node
  * @param bool $up
  */
 private function upgradeProperty(PropertyMetadata $property, NodeInterface $node, $locale, $up)
 {
     $name = sprintf('i18n:%s-%s', $locale, $property->getName());
     if (!$node->hasProperty($name)) {
         return;
     }
     $value = $node->getPropertyValue($name);
     if ($up) {
         $value = $this->upgradeDate($value);
     } else {
         $value = $this->downgradeDate($value);
     }
     $node->setProperty($name, $value);
 }
开发者ID:Silwereth,项目名称:sulu,代码行数:21,代码来源:Version201511240843.php

示例15: upgradeNode

 /**
  * Upgrades the node to new date representation.
  *
  * @param NodeInterface $node The node to be upgraded
  * @param string $locale The locale of the node to be upgraded
  * @param array $properties The properties which are or contain date fields$up
  */
 private function upgradeNode(NodeInterface $node, $locale, $properties, $up)
 {
     foreach ($properties as $property) {
         $propertyName = $this->propertyEncoder->localizedContentName($property, $locale);
         if ($node->hasProperty($propertyName)) {
             $value = $this->upgradeProperty($node->getPropertyValue($propertyName), $up);
             $node->setProperty($propertyName, $value);
         }
     }
 }
开发者ID:Silwereth,项目名称:sulu,代码行数:17,代码来源:Version201511171538.php


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