本文整理汇总了PHP中PHPCR\NodeInterface::getNodeNames方法的典型用法代码示例。如果您正苦于以下问题:PHP NodeInterface::getNodeNames方法的具体用法?PHP NodeInterface::getNodeNames怎么用?PHP NodeInterface::getNodeNames使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPCR\NodeInterface
的用法示例。
在下文中一共展示了NodeInterface::getNodeNames方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGetNodeNamesPattern
public function testGetNodeNamesPattern()
{
$iterator = $this->node->getNodeNames('id*');
$names = array();
foreach ($iterator as $n) {
array_push($names, $n);
}
$this->assertContains('idExample', $names);
$this->assertNotContains('index.txt', $names);
}
示例2: 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()));
}
示例3: getNodeNames
/**
* {@inheritdoc}
*/
public function getNodeNames($nameFilter = null, $typeFilter = null)
{
return $this->node->getNodeNames($nameFilter, $typeFilter);
}