The \Traversable interface enables the implementation to be addressed with foreach. Rows have to implement either \RecursiveIterator or \Iterator. The iterator is similar to getValues() with keys being the column names and the values the corresponding entry in that column for this row.
Inheritance: implements Iterator, implements PHPCR\Query\RowInterface
示例#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;
 }
示例#2
0
 /**
  * Return data for one field.
  */
 private function getFieldData($field, Row $row, NodeInterface $node, $document, $templateKey, $webspaceKey, $locale)
 {
     if (isset($field['column'])) {
         // normal data from node property
         return $row->getValue($field['column']);
     } elseif (isset($field['extension'])) {
         // data from extension
         return $this->getExtensionData($node, $field['extension'], $field['property'], $webspaceKey, $locale);
     } elseif (isset($field['property']) && (!isset($field['templateKey']) || $field['templateKey'] === $templateKey)) {
         // not extension data but property of node
         return $this->getPropertyData($document, $field['property']);
     }
     return;
 }