Jackalope\ObjectManager::getNodesByPath PHP Метод

getNodesByPath() публичный Метод

Note paths that cannot be found will be ignored and missing from the result. Uses the factory to create Node objects.
См. также: 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
Результат Node[] Iterator that contains all found NodeInterface instances keyed by their path
    public function getNodesByPath($absPaths, $class = 'Node', $typeFilter = null)
    {
        $nodesPathIterator = new NodePathIterator($this, $absPaths, $class, $typeFilter);
        return $nodesPathIterator;
    }

Usage Example

Пример #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);
 }
All Usage Examples Of Jackalope\ObjectManager::getNodesByPath