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


PHP NodeInterface::getNodes方法代码示例

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


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

示例1: getNodes

 /**
  * @see \PHPCR\NodeInterface::getNodes
  */
 public function getNodes($filter = null)
 {
     $nodes = $this->node->getNodes($filter);
     foreach ($nodes as $name => $node) {
         $nodes[$name] = new Node($node);
     }
     return $nodes;
 }
开发者ID:marmelab,项目名称:phpcr-api,代码行数:11,代码来源:Node.php

示例2: initialize

 /**
  * {@inheritdoc}
  */
 protected function initialize()
 {
     if (true === $this->initialized) {
         return;
     }
     $this->documents = $this->parentNode->getNodes();
     $this->initialized = true;
 }
开发者ID:hason,项目名称:sulu-document-manager,代码行数:11,代码来源:ChildrenCollection.php

示例3: upgradeNode

 /**
  * Removes non translated properties.
  *
  * @param NodeInterface $node
  */
 private function upgradeNode(NodeInterface $node)
 {
     foreach ($node->getProperties('i18n:-*') as $property) {
         $property->remove();
     }
     foreach ($node->getNodes() as $childNode) {
         $this->upgradeNode($childNode);
     }
 }
开发者ID:sulu,项目名称:sulu,代码行数:14,代码来源:Version201512090753.php

示例4: traverse

 private function traverse(NodeInterface $node)
 {
     $i = 10;
     foreach ($node->getNodes() as $childNode) {
         $childNode->setProperty(NodeOrderSubscriber::SULU_ORDER, $i);
         $this->context->getOutput()->writeln(sprintf('<info>[+]</info> Setting order "<comment>%s</comment>" on <comment>%s</comment>', $i, $childNode->getPath()));
         $this->traverse($childNode);
         $i += 10;
     }
 }
开发者ID:Silwereth,项目名称:sulu,代码行数:10,代码来源:NodeOrderBuilder.php

示例5: getLocalesFor

 /**
  * {@inheritdoc}
  */
 public function getLocalesFor($document, NodeInterface $node, ClassMetadata $metadata)
 {
     $translations = $node->getNodes(Translation::LOCALE_NAMESPACE . ':*');
     $locales = array();
     foreach ($translations as $name => $node) {
         if ($p = strpos($name, ':')) {
             $locales[] = substr($name, $p + 1);
         }
     }
     return $locales;
 }
开发者ID:nicam,项目名称:phpcr-odm,代码行数:14,代码来源:ChildTranslationStrategy.php

示例6: initProperties

 /**
  * This method populates the test case properties both at test setUp
  * and after renewing the session.
  *
  * The default schema is to have a root node /test_<something> with one
  * child node per test with the node name being the test name.
  */
 protected function initProperties()
 {
     $this->session = $this->sharedFixture['session'];
     $this->node = null;
     $this->rootNode = $this->session->getRootNode();
     $children = $this->rootNode->getNodes('tests_*');
     $child = $children->current();
     if ($child && $child->hasNode($this->getName())) {
         $this->node = $child->getNode($this->getName());
     }
 }
开发者ID:laurentiuc,项目名称:phpcr-api-tests,代码行数:18,代码来源:BaseCase.php

示例7: traverse

 private function traverse(NodeInterface $node, $readProperties = false)
 {
     if ($readProperties) {
         foreach ($node->getProperties() as $property) {
             try {
                 $property->getValue();
             } catch (\PHPCR\RepositoryException $e) {
             }
         }
     }
     foreach ($node->getNodes() as $child) {
         $this->traverse($child, $readProperties);
     }
 }
开发者ID:phpcr,项目名称:phpcr-benchmarks,代码行数:14,代码来源:TraversalBench.php

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

示例9: testGetNodesTypeFilterList

 public function testGetNodesTypeFilterList()
 {
     $this->node = $this->rootNode->getNode('tests_general_base');
     $iterator = $this->node->getNodes('id*', array('nt:file', 'nt:folder'));
     $nodes = array();
     foreach ($iterator as $n) {
         $this->assertInstanceOf('PHPCR\\NodeInterface', $n);
         /* @var $n \PHPCR\NodeInterface */
         array_push($nodes, $n->getName());
     }
     $this->assertNotContains('index.txt', $nodes);
     $this->assertContains('idExample', $nodes);
     $this->assertNotContains('test:namespacedNode', $nodes);
     $this->assertNotContains('emptyExample', $nodes);
     $this->assertNotContains('multiValueProperty', $nodes);
     $this->assertNotContains('numberPropertyNode', $nodes);
     $this->assertNotContains('NumberPropertyNodeToCompare1', $nodes);
     $this->assertNotContains('NumberPropertyNodeToCompare2', $nodes);
 }
开发者ID:laurentiuc,项目名称:phpcr-api-tests,代码行数:19,代码来源:NodeReadMethodsTest.php

示例10: setNodeWorkflowStageToTestForCopy

 /**
  * Sets the workflowstage and the published date for the given node and all of its children to test resp. null. This
  * is done for every language in which the given properties exist.
  *
  * @param NodeInterface $node
  */
 private function setNodeWorkflowStageToTestForCopy(NodeInterface $node)
 {
     $workflowStageNameFilter = $this->propertyEncoder->localizedSystemName(self::WORKFLOW_STAGE_FIELD, '*');
     foreach ($node->getProperties($workflowStageNameFilter) as $property) {
         /** @var PropertyInterface $property */
         $property->setValue(WorkflowStage::TEST);
     }
     $publishedNameFilter = $this->propertyEncoder->localizedSystemName(self::PUBLISHED_FIELD, '*');
     foreach ($node->getProperties($publishedNameFilter) as $property) {
         /** @var PropertyInterface $property */
         $property->setValue(null);
     }
     foreach ($node->getNodes() as $node) {
         /** @var NodeInterface $node */
         $this->setNodeWorkflowStageToTestForCopy($node);
     }
 }
开发者ID:sulu,项目名称:sulu,代码行数:23,代码来源:WorkflowStageSubscriber.php

示例11: filterChildNodeNamesByType

 /**
  * This method will either let the transport filter if that is possible or
  * forward to getNodes and return the names of the nodes found there.,
  *
  * @param NodeInterface $node
  * @param string|array  $nameFilter
  * @param string|array  $typeFilter
  *
  * @return ArrayIterator
  */
 public function filterChildNodeNamesByType(NodeInterface $node, $nameFilter, $typeFilter)
 {
     if ($this->transport instanceof NodeTypeFilterInterface) {
         return $this->transport->filterChildNodeNamesByType($node->getPath(), $node->getNodeNames($nameFilter), $typeFilter);
     }
     // fallback: get the actual nodes and let that filter. this is expensive.
     return new ArrayIterator(array_keys($node->getNodes($nameFilter, $typeFilter)->getArrayCopy()));
 }
开发者ID:nikophil,项目名称:cmf-tests,代码行数:18,代码来源:ObjectManager.php

示例12: resolveAfterSiblingName

 /**
  * If the node should be ordered after the target then we need to order the
  * node before the sibling after the target sibling. If the node should be the
  * last sibling, then the target sibling should be NULL.
  *
  * @param NodeInterface $parentNode
  * @param string $siblingName
  *
  * @return string
  */
 private function resolveAfterSiblingName(NodeInterface $parentNode, $siblingName)
 {
     $targetName = null;
     $found = false;
     foreach (array_keys($parentNode->getNodes()) as $name) {
         if ($name === $siblingName) {
             $found = true;
             continue;
         } elseif ($found) {
             $targetName = $name;
             break;
         }
     }
     return $targetName;
 }
开发者ID:hason,项目名称:sulu-document-manager,代码行数:25,代码来源:ReorderSubscriber.php

示例13: cleanup

 /**
  * Cleanup specific node and his children.
  *
  * @param NodeInterface $node
  * @param string        $rootPath
  * @param bool          $dryRun
  */
 private function cleanup(OutputInterface $output, NodeInterface $node, $rootPath, $dryRun)
 {
     foreach ($node->getNodes() as $childNode) {
         $this->cleanup($output, $childNode, $rootPath, $dryRun);
     }
     $path = ltrim(str_replace($rootPath, '', $node->getPath()), '/');
     if (!$node->getPropertyValueWithDefault('sulu:history', false)) {
         $output->writeln('<info>Processing aborted: </info>/' . $path . ' <comment>(no history url)</comment>');
         return;
     }
     if ($dryRun === false) {
         $node->remove();
     }
     $output->writeln('<info>Processing: </info>/' . $path);
 }
开发者ID:sulu,项目名称:sulu,代码行数:22,代码来源:CleanupHistoryCommand.php

示例14: getNodes

 /**
  * {@inheritdoc}
  */
 public function getNodes($nameFilter = null, $typeFilter = null)
 {
     return $this->node->getNodes($nameFilter, $typeFilter);
 }
开发者ID:sulu,项目名称:sulu,代码行数:7,代码来源:SuluNode.php

示例15: upgradeByParent

 private function upgradeByParent(NodeInterface $parentNode, Webspace $webspace, Localization $localization, OutputInterface $output)
 {
     foreach ($parentNode->getNodes() as $childNode) {
         $this->upgradeNode($childNode, $webspace, $localization, $output, substr_count($childNode->getPath(), '/'));
         $this->upgradeByParent($childNode, $webspace, $localization, $output);
     }
 }
开发者ID:sulu,项目名称:sulu,代码行数:7,代码来源:MaintainResourceLocatorCommand.php


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