phpcr/src/PHPCR/Query/QOM/QueryObjectModelInterface.php

Show: PublicProtectedPrivateinherited
    Table of Contents
    This file is part of the PHPCR API and was originally ported from the Java JCR API to PHP by Karsten Dambekalns for the FLOW3 project.

    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.

    License
    Apache Software License 2.0  
    Link
    http://phpcr.github.com/  

    \PHPCR\Query\QOM\QueryObjectModelInterface

    Package: Default
    A query in the JCR/PHPCR query object model.

    The JCR query object model describes the queries that can be evaluated by a JCR repository independent of any particular query language, such as SQL.

    A query consists of:

    • a source. When the query is evaluated, the source evaluates its selectors and the joins between them to produce a (possibly empty) set of node-tuples. This is a set of 1-tuples if the query has one selector (and therefore no joins), a set of 2-tuples if the query has two selectors (and therefore one join), a set of 3-tuples if the query has three selectors (two joins), and so forth.
    • an optional constraint. When the query is evaluated, the constraint filters the set of node-tuples.
    • a list of zero or more orderings. The orderings specify the order in which the node-tuples appear in the query results. The relative order of two node-tuples is determined by evaluating the specified orderings, in list order, untilencountering an ordering for which one node-tuple precedes the other. If no orderings are specified, or if for none of the specified orderings does one node-tuple precede the other, then the relative order of the node-tuples is implementation determined (and may be arbitrary).
    • a list of zero or more columns to include in the tabular view of the query results. If no columns are specified, the columns available in the tabular view are implementation determined, but minimally include, for each selector, a column for each single-valued non-residual property of the selector's node type.

    The query object model representation of a query is created by factory methods in the QueryObjectModelFactory.

    Parent(s)
    \PHPCR\Query\QueryInterface
    Api
     

    Constants

    >VConstant  JCR_JQOM = 'JCR-JQOM'
    inherited
    A string constant representing the JCR-JQOM query language.
    Inherited from: \PHPCR\Query\QueryInterface::JCR_JQOM
    Api
     
    Inherited_from
    \PHPCR\Query\QueryInterface::JCR_JQOM  
    >VConstant  JCR_SQL2 = 'JCR-SQL2'
    inherited
    A string constant representing the JCR-SQL2 query language.
    Inherited from: \PHPCR\Query\QueryInterface::JCR_SQL2
    Api
     
    Inherited_from
    \PHPCR\Query\QueryInterface::JCR_SQL2  
    >VConstant  XPATH = 'xpath'
    inherited
    A string constant representing the (deprecated in JSR-283) XPATH query language.
    Inherited from: \PHPCR\Query\QueryInterface::XPATH
    Api
     
    Inherited_from
    \PHPCR\Query\QueryInterface::XPATH  
    >VConstant  SQL = 'sql'
    inherited
    A string constant representing the (deprecated in JSR-283) SQL query language.
    Inherited from: \PHPCR\Query\QueryInterface::SQL
    Api
     
    Inherited_from
    \PHPCR\Query\QueryInterface::SQL  

    Methods

    methodpublicbindValue(string $varName, mixed $value) : void
    inherited

    Binds the given value to the variable named $varName.

    Inherited from: \PHPCR\Query\QueryInterface::bindValue()
    Parameters
    NameTypeDescription
    $varNamestring

    name of variable in query

    $valuemixed

    value to bind

    Throws
    ExceptionDescription
    \InvalidArgumentExceptionif $varName is not a valid variable in this query.
    \PHPCR\RepositoryExceptionif an error occurs.
    Details
    Api
     
    methodpublicexecute() : \PHPCR\Query\QueryResultInterface
    inherited

    Executes this query and returns a QueryResult object.

    Inherited from: \PHPCR\Query\QueryInterface::execute()
    Returns
    TypeDescription
    \PHPCR\Query\QueryResultInterfacea QueryResult object
    Throws
    ExceptionDescription
    \PHPCR\Query\InvalidQueryExceptionif the query contains an unbound variable.
    \PHPCR\RepositoryExceptionif an error occurs
    Details
    Api
     
    methodpublicgetBindVariableNames() : array
    inherited

    Returns the names of the bind variables in this query.

    Inherited from: \PHPCR\Query\QueryInterface::getBindVariableNames()

    If this query does not contains any bind variables then an empty array is returned.

    Returns
    TypeDescription
    arraythe names of the bind variables in this query.
    Throws
    ExceptionDescription
    \PHPCR\RepositoryExceptionif an error occurs.
    Details
    Api
     
    methodpublicgetColumns() : array

    Gets the columns for this query.

    Returns
    TypeDescription
    arraya list of zero or more ColumnInterface; non-null
    Details
    Api
     
    methodpublicgetConstraint() : \PHPCR\Query\QOM\ConstraintInterface

    Gets the constraint for this query.

    Returns
    TypeDescription
    \PHPCR\Query\QOM\ConstraintInterfacethe constraint, or null if none
    Details
    Api
     
    methodpublicgetLanguage() : string
    inherited

    Returns the language set for this query.

    Inherited from: \PHPCR\Query\QueryInterface::getLanguage()

    This will be one of the query language constants returned by QueryManagerInterface::getSupportedQueryLanguages().

    Returns
    TypeDescription
    stringThe query language.
    Details
    Api
     
    methodpublicgetOrderings() : array

    Gets the orderings for this query.

    Returns
    TypeDescription
    arraya list of zero or more OrderingInterface; non-null
    Details
    Api
     
    methodpublicgetSource() : \PHPCR\Query\QOM\SourceInterface

    Gets the node-tuple source for this query.

    Returns
    TypeDescription
    \PHPCR\Query\QOM\SourceInterfacethe node-tuple source; non-null
    Details
    Api
     
    methodpublicgetStatement() : string
    inherited

    Returns the statement defined for this query.

    Inherited from: \PHPCR\Query\QueryInterface::getStatement()

    If the language of this query is string-based (like JCR-SQL2), this method will return the statement that was used to create this query.

    If the language of this query is JCR-JQOM, this method will return the JCR-SQL2 equivalent of the JCR-JQOM object tree.

    This is the standard serialization of JCR-JQOM and is also the string stored in the jcr:statement property if the query is persisted. See storeAsNode($absPath).

    Returns
    TypeDescription
    stringThe query statement.
    Details
    Api
     
    methodpublicgetStoredQueryPath() : string
    inherited

    Fetches the path of the node representing this query.

    Inherited from: \PHPCR\Query\QueryInterface::getStoredQueryPath()

    If this is a Query object that has been stored using QueryInterface::storeAsNode() (regardless of whether it has been saved yet) or retrieved using QueryManagerInterface::getQuery()), then this method returns the path of the nt:query node that stores the query.

    Returns
    TypeDescription
    stringPath of the node representing this query.
    Throws
    ExceptionDescription
    \PHPCR\ItemNotFoundExceptionif this query is not a stored query.
    \PHPCR\RepositoryExceptionif another error occurs.
    Details
    Api
     
    methodpublicsetLimit(integer $limit) : void
    inherited

    Sets the maximum size of the result set to limit.

    Inherited from: \PHPCR\Query\QueryInterface::setLimit()
    Parameters
    NameTypeDescription
    $limitinteger

    The amount of result items to be fetched.

    Details
    Api
     
    methodpublicsetOffset(integer $offset) : void
    inherited

    Sets the start offset of the result set to offset.

    Inherited from: \PHPCR\Query\QueryInterface::setOffset()
    Parameters
    NameTypeDescription
    $offsetinteger

    The start point of the result set from when the item shall be fetched.

    Details
    Api
     
    methodpublicstoreAsNode(string $absPath) : \PHPCR\NodeInterface
    inherited

    Creates a node of type nt:query holding this query at $absPath and returns that node.

    Inherited from: \PHPCR\Query\QueryInterface::storeAsNode()

    This is a session-write method and therefore requires a SessionInterface::save() to dispatch the change.

    The $absPath provided must not have an index on its final element. If ordering is supported by the node type of the parent node then the new node is appended to the end of the child node list.

    Parameters
    NameTypeDescription
    $absPathstring

    absolute path the query should be stored at

    Returns
    TypeDescription
    \PHPCR\NodeInterfacethe newly created node.
    Throws
    ExceptionDescription
    \PHPCR\ItemExistsExceptionif an item at the specified path already exists, same-name siblings are not allowed and this implementation performs this validation immediately.
    \PHPCR\PathNotFoundExceptionif the specified path implies intermediary Nodes that do not exist or the last element of relPath has an index, and this implementation performs this validation immediately.
    \PHPCR\NodeType\ConstraintViolationExceptionif a node type or implementation-specific constraint is violated or if an attempt is made to add a node as the child of a property and this implementation performs this validation immediately.
    \PHPCR\Version\VersionExceptionif the node to which the new child is being added is read-only due to a checked-in node and this implementation performs this validation immediately.
    \PHPCR\Lock\LockExceptionif a lock prevents the addition of the node and this implementation performs this validation immediately instead of waiting until save.
    \PHPCR\UnsupportedRepositoryOperationExceptionin a level 1 implementation.
    \PHPCR\RepositoryExceptionif another error occurs or if the absPath provided has an index on its final element.
    Details
    Api
     
    Documentation was generated by phpDocumentor 2.0.0a12.