Note paths that cannot be found will be ignored and missing from the
result.
Uses the factory to create Node objects.
public getNodesByPath ( array $absPaths, string $class = 'Node', array | null $typeFilter = null ) : |
||
$absPaths | array | Array containing the absolute paths of the nodes to fetch. |
$class | string | The class of node to get. TODO: Is it sane to fetch data separately for Version and normal Node? |
$typeFilter | array | null | Node type list to skip some nodes |
return | Iterator that contains all found NodeInterface instances keyed by their path |
/** * {@inheritDoc} * * @api */ public function getNodes($absPaths) { if (!is_array($absPaths) && !$absPaths instanceof \Traversable) { $hint = is_object($absPaths) ? get_class($absPaths) : gettype($absPaths); throw new InvalidArgumentException("Not a valid array or Traversable: {$hint}"); } return $this->objectManager->getNodesByPath($absPaths); }
/** * {@inheritDoc} * * @api */ public function getNodes($prefetch = false) { if ($prefetch !== true) { return $this->factory->get('Query\\NodeIterator', array($this->objectmanager, $this->rows)); } $paths = array(); foreach ($this->getRows() as $row) { $paths[] = $row->getPath(); } return $this->objectmanager->getNodesByPath($paths); }
/** * {@inheritDoc} * * @api */ public function getNodes($absPaths) { return $this->objectManager->getNodesByPath($absPaths); }