Jackalope\Query\Row::getPath PHP Method

getPath() public method

{@inheritDoc}
public getPath ( $selectorName = null )
    public function getPath($selectorName = null)
    {
        if (null === $selectorName) {
            $selectorName = $this->defaultSelectorName;
        }
        // do not use isset, the path might be null on outer joins
        if (!array_key_exists($selectorName, $this->path)) {
            throw new RepositoryException('Attempting to get the path for a non existent selector: ' . $selectorName);
        }
        return $this->path[$selectorName];
    }

Usage Example

Example #1
0
 /**
  * Resolve property has-children with given node.
  *
  * @param Row $row
  *
  * @return bool
  */
 private function resolveHasChildren(Row $row)
 {
     $queryBuilder = new QueryBuilder($this->qomFactory);
     $queryBuilder->select('node', 'jcr:uuid', 'uuid')->from($this->qomFactory->selector('node', 'nt:unstructured'))->where($this->qomFactory->childNode('node', $row->getPath()))->setMaxResults(1);
     $result = $queryBuilder->execute();
     return count(iterator_to_array($result->getRows())) > 0;
 }