Example #1
0
 /**
  * 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()));
 }