Returns the cached child nodes for the given path and node type filter.

@param string $path
@param string $nodeTypeFilter
@return boolean
963944
public function getChildNodesByPathAndNodeTypeFilter($path, $nodeTypeFilter)
    {
        if (isset($this->childNodesByPathAndNodeTypeFilter[$path][$nodeTypeFilter])) {
            return $this->childNodesByPathAndNodeTypeFilter[$path][$nodeTypeFilter];
        }

        return false;
    }
621314
protected List<NodeData> getDirectChildNodesData(NodeData parent, List<QPathEntryFilter> itemDataFilters)
      throws RepositoryException, IllegalStateException
   {
      checkIfOpened();
      if (itemDataFilters.isEmpty())
      {
         return new ArrayList<NodeData>();
      }

      List<NodeData> children = new ArrayList<NodeData>();
      for (Iterator<QPathEntryFilter> it = itemDataFilters.iterator(); it.hasNext(); )
      {
         QPathEntryFilter filter = it.next();
         if (filter.isExactName())
         {
            NodeData data = (NodeData)getItemData(parent, filter.getQPathEntry(), ItemType.NODE);
            if (data != null)
            {
               children.add(data);
            }
            it.remove();
         }
      }
      if (!itemDataFilters.isEmpty())
      {
         children.addAll(getChildNodesDataInternal(parent, itemDataFilters));
      }
      return children;
   }
39892
public function getNodes($path)
    {
        $domXPath = new \DOMXpath($this->domDocument);
        // TODO: Swap the lines below for version 5.1.
        //			$nodes = $domXPath->evaluate($path);
        $nodes = $domXPath->query($path);
        if ($nodes) {
            return ($nodes->length > 0) ? $nodes : null;
        } else {
            throw new Exception('Bad XPath expression: ' . $path);
        }
    }
234911
private function matchSuffixPath(NodeInterface $node, string $path, int $i): int
    {
        $match_result = -1;
        if (!$node instanceof RootNode) {
            $match_result = $this->walkEdge($path, $i, $node->getStart(), $node->getEnd());
            if ($match_result !== 0) {
                return $match_result;
            }
        }

        $i = $i + $node->getEdgeSize();
        $children = $node->getChildren();
        if (isset($children[$path[$i]])) {
            return $this->matchSuffixPath($children[$path[$i]], $path, $i);
        } else {
            return -1;
        }
    }
912756
private function createFilteredBinary($path, $filter, array $runtimeFilters = [])
    {
        $binary = $this->dataManager->find($filter, $path);

        try {
            return $this->filterManager->applyFilter($binary, $filter, [
                'filters' => $runtimeFilters,
            ]);
        } catch (NonExistingFilterException $e) {
            $message = sprintf('Could not locate filter "%s" for path "%s". Message was "%s"', $filter, $path, $e->getMessage());

            $this->logger->debug($message);

            throw $e;
        }
    }
715668
protected function nodeExists( $path )
    {
        if ( !isset( $this->cachedNodes[$path] ) )
        {
            $this->cachedNodes[$path] = $this->getNodeInfo( $path );
        }

        return $this->cachedNodes[$path]['nodeExists'];
    }
601777
public function filterByPath($path, $includeAllChildren = true)
    {
        if (!$includeAllChildren) {
            $this->query->andWhere('pp.cPath = :cPath');
            $this->query->setParameter('cPath', $path);
        } else {
            $this->query->andWhere(
                $this->query->expr()->like('pp.cPath', ':cPath')
            );
            $this->query->setParameter('cPath', $path . '/%');
        }
        $this->query->andWhere('pp.ppIsCanonical = 1');
    }
155040
public function getNodeType($nodeTypeName)
    {
        if ($this->cachedNodeTypes === []) {
            $this->loadNodeTypes();
        }
        if (isset($this->cachedNodeTypes[$nodeTypeName])) {
            return $this->cachedNodeTypes[$nodeTypeName];
        }

        if ($this->fallbackNodeTypeName === null) {
            throw new NodeTypeNotFoundException(sprintf('The node type "%s" is not available and no fallback NodeType is configured.', $nodeTypeName), 1316598370);
        }

        if (!$this->hasNodeType($this->fallbackNodeTypeName)) {
            throw new NodeTypeNotFoundException(sprintf('The node type "%s" is not available and the configured fallback NodeType "%s" is not available.', $nodeTypeName, $this->fallbackNodeTypeName), 1438166322);
        }
        return $this->getNodeType($this->fallbackNodeTypeName);
    }
931090
public function createNodeForTheTreeAction(Node $referenceNode, array $nodeData, $position, $nodeTypeFilter = '')
    {
        $newNode = $this->nodeOperations->create($referenceNode, $nodeData, $position);
        $this->view->assignNodeAndChildNodes($newNode, $nodeTypeFilter);
    }
965130
public function cacheImage($basePath, $path, $filter)
    {
        $path = '/'.ltrim($path, '/');

        //TODO: find out why I need double urldecode to get a valid path
        $browserPath = urldecode(urldecode($this->cachePathResolver->getBrowserPath($path, $filter)));

        if (!empty($basePath) && 0 === strpos($browserPath, $basePath)) {
             $browserPath = substr($browserPath, strlen($basePath));
        }

         // if cache path cannot be determined, return 404
        if (null === $browserPath) {
            return null;
        }

        $realPath = $this->webRoot.$browserPath;
        
        $sourcePathRoot = $this->filterManager->getOption($filter, "source_root", $this->sourceRoot);
        $sourcePath = $sourcePathRoot.$path;

        // if the file has already been cached, just return path
        if (is_file($realPath)) {
            return $realPath;
        }

        if (!is_file($sourcePath)) {
            return null;
        }

        $dir = pathinfo($realPath, PATHINFO_DIRNAME);

        if (!is_dir($dir)) {
            try {
                if (false === $this->filesystem->mkdir($dir)) {
                    throw new \RuntimeException(sprintf(
                        'Could not create directory %s', $dir
                    ));
                }
            } catch (\Exception $e) {
                if (!is_dir($dir)) {
                    throw $e;
                }
            }
        }

        // TODO: get rid of hard-coded quality and format
        $this->filterManager->getFilter($filter)
            ->apply($this->imagine->open($sourcePath))
            ->save($realPath, array(
                'quality' => $this->filterManager->getOption($filter, "quality", 100),
                'format'  => $this->filterManager->getOption($filter, "format", null)
            ))
        ;
        
        try {
            if (!chmod($realPath, $this->permissions))
            {
                throw new \RuntimeException(sprintf(
                    'Could not set permissions %s on image saved in %s', $this->permissions, $realPath
                ));
            }
            
        } catch (Exception $e) {
            throw $e;
        }
        
        return $realPath;
    }
667189
public function getNodeByDisplayPath($path)
    {
        $root = $this->getRootTreeNodeObject();

        if ($path == '/' || !$path) {
            return $root;
        }

        $computedPath = '';
        $tree = $this;
        $walk = function ($node, $computedPath) use (&$walk, &$tree, &$path) {
            $node->populateDirectChildrenOnly();

            if ($node->getTreeNodeID() != $tree->getRootTreeNodeID()) {
                $name = $node->getTreeNodeName();
                $computedPath .= '/' . $name;
            }

            if (strcasecmp($computedPath, $path) == 0) {
                return $node;
            } else {
                $children = $node->getChildNodes();
                foreach ($children as $child) {
                    $node = $walk($child, $computedPath);
                    if ($node !== null) {
                        return $node;
                    }
                }
            }

            return;
        };
        $node = $walk($root, $computedPath);

        return $node;
    }
973452
public function getChildrenRecursively (ContextSpecificationInterface $filter = null)
	{
		$list = $this->getChildren($filter);

		foreach ($this->getChildren() as $child)
		{
			if ($child->hasChildren())
			{
				$list = array_merge ($list, $child->getChildrenRecursively($filter));
			}
		}

		return $list;
	}
564485
protected function exportSite(Site $site, $nodeTypeFilter)
    {
        /** @var ContentContext $contentContext */
        $contentContext = $this->contextFactory->create([
            'currentSite' => $site,
            'invisibleContentShown' => true,
            'inaccessibleContentShown' => true
        ]);

        $siteNode = $contentContext->getCurrentSiteNode();

        $this->xmlWriter->startElement('site');
        $this->xmlWriter->writeAttribute('name', $site->getName());
        $this->xmlWriter->writeAttribute('state', $site->getState());
        $this->xmlWriter->writeAttribute('siteResourcesPackageKey', $site->getSiteResourcesPackageKey());
        $this->xmlWriter->writeAttribute('siteNodeName', $siteNode->getName());

        $this->nodeExportService->export($siteNode->getPath(), $contentContext->getWorkspaceName(), $this->xmlWriter, false, false, $this->resourcesPath, $nodeTypeFilter);

        $this->xmlWriter->endElement();
    }
1017707
public function findChildren(array $filters = [], array $options = [])
    {
        $options = array_replace(
            [
                'returnFirstResult'     => false
            ],
            $options
        );

        if (empty($filters)) {
            $result = array_values($this->_nodes);
        } else if (count($filters) === 1
            && isset($filters['id'])
        ) {
            $result = $this->hasNode($filters['id']) ?
                [$this->getNode($filters['id'])] :
                [];
        } else {
            $result = [];

            /** @var NodeInterface $child */
            foreach ($this->getNodes() as $child) {
                foreach ($filters as $f => $v) {
                    $method = 'get'.ucfirst($f);

                    if (!method_exists($child, $method) || $child->$method() !== $v) {
                        continue 2;
                    }
                }

                $result[] = $child;
            }
        }

        return $options['returnFirstResult'] && $result ?
            $result[0] :
            $result;
    }
387090
NodeIterator<T> getNodeIterator(Filter<T> filter) {
        return new NodeIterator<T>(root, filter, true);
    }
1158404
public function getUrlOfFilteredImageWithRuntimeFilters($path, $filter, array $runtimeFilters = [], $resolver = null)
    {
        $runtimePath = $this->cacheManager->getRuntimePath($path, $runtimeFilters);
        if ($this->cacheManager->isStored($runtimePath, $filter, $resolver)) {
            return $this->cacheManager->resolve($runtimePath, $filter, $resolver);
        }

        $filteredBinary = $this->createFilteredBinary(
            $path,
            $filter,
            $runtimeFilters
        );

        $this->cacheManager->store(
            $filteredBinary,
            $runtimePath,
            $filter,
            $resolver
        );

        return $this->cacheManager->resolve($runtimePath, $filter, $resolver);
    }
1158108
protected function isCollection( $path )
    {
        if ( !isset( $this->cachedNodes[$path] ) )
        {
            $this->cachedNodes[$path] = $this->getNodeInfo( $path );
        }

        return $this->cachedNodes[$path]['isCollection'];
    }