phpcr/src/PHPCR/Query/RowInterface.php
Copyright 2008-2011 Karsten Dambekalns karsten@typo3.org
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
\PHPCR\Query\RowInterface
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.
- Parent(s)
- \Traversable
- Api
Methods
getNode(string $selectorName = null) : \PHPCR\NodeInterface
Returns the Node corresponding to this Row and the specified selector, if given.
Name | Type | Description |
---|---|---|
$selectorName | string | The selector identifying a node within the current result row. |
Type | Description |
---|---|
\PHPCR\NodeInterface | a Node |
Exception | Description |
---|---|
\PHPCR\RepositoryException | If selectorName is not the alias of a selector in this query or if another error occurs. |
- Api
getPath(string $selectorName = null) : string
Get the path of a node identified by a selector.
Equivalent to $row->getNode($selectorName)->getPath(). However, some implementations may be able gain efficiency by not resolving the actual Node.
Name | Type | Description |
---|---|---|
$selectorName | string | The selector identifying a node within the current result row. |
Type | Description |
---|---|
string | The path representing the node identified by the given selector. |
Exception | Description |
---|---|
\PHPCR\RepositoryException | if selectorName is not the alias of a selector in this query or if another error occurs. |
- Api
getScore(string $selectorName = null) : float
Returns the full text search score for this row associated with the specified selector.
This corresponds to the score of a particular node.
- If no selectorName is given, the default selector is used.
- If no FullTextSearchScore AQM object is associated with the selector selectorName, this method will still return a value. However, in that case the returned value may not be meaningful or may simply reflect the minimum possible relevance level (for example, in some systems this might be a score of 0).
Note, in JCR-SQL2 a FullTextSearchScore AQM object is represented by a SCORE() function. In JCR-JQOM it is represented by a PHP object of type \PHPCR\Query\QOM\FullTextSearchScoreInterface.
Name | Type | Description |
---|---|---|
$selectorName | string | The selector identifying a node within the current result row. |
Type | Description |
---|---|
float | The full text search score for this row. |
Exception | Description |
---|---|
\PHPCR\RepositoryException | if selectorName is not the alias of a selector in this query or (in case of no given selectorName) if this query has more than one selector (and therefore, this Row corresponds to more than one Node) or if another error occurs. |
- Api
getValue(string $columnName) : mixed
Returns the value of the indicated column in this Row.
Name | Type | Description |
---|---|---|
$columnName | string | name of query result table column |
Type | Description |
---|---|
mixed | The value of the given column of the current result row. |
Exception | Description |
---|---|
\PHPCR\ItemNotFoundException | if columnName s not among the column names of the query result table. |
\PHPCR\RepositoryException | if another error occurs. |
- Api
getValues() : array
Returns an array of all the values in the same order as the column names returned by QueryResultInterface::getColumnNames().
Type | Description |
---|---|
array | Hashmap of column name to value of each column of the current result row. |
Exception | Description |
---|---|
\PHPCR\RepositoryException | if an error occurs |
- Api