getNodesByPath() public méthode

Note paths that cannot be found will be ignored and missing from the result. Uses the factory to create Node objects.
See also: Session::getNodes()
public getNodesByPath ( array $absPaths, string $class = 'Node', array | null $typeFilter = null ) : Node[]
$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
Résultat Node[] Iterator that contains all found NodeInterface instances keyed by their path
Exemple #1
0
 /**
  * {@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);
 }
Exemple #2
0
 /**
  * {@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);
 }
Exemple #3
0
 /**
  * {@inheritDoc}
  *
  * @api
  */
 public function getNodes($absPaths)
 {
     return $this->objectManager->getNodesByPath($absPaths);
 }