phpcr/src/PHPCR/Query/QueryInterface.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\QueryInterface

    Package: Default
    A Query object.

    PHPCR Note: Instead of the dropped ValueInterface, bindValue uses native php variables

    Children
    \PHPCR\Query\QOM\QueryObjectModelInterface
    Api
     

    Constants

    >VConstant  JCR_JQOM = 'JCR-JQOM'
    A string constant representing the JCR-JQOM query language.
    Api
     
    >VConstant  JCR_SQL2 = 'JCR-SQL2'
    A string constant representing the JCR-SQL2 query language.
    Api
     
    >VConstant  XPATH = 'xpath'
    A string constant representing the (deprecated in JSR-283) XPATH query language.
    Api
     
    >VConstant  SQL = 'sql'
    A string constant representing the (deprecated in JSR-283) SQL query language.
    Api
     

    Methods

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

    Binds the given value to the variable named $varName.

    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

    Executes this query and returns a QueryResult object.

    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

    Returns the names of the bind variables in this query.

    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
     
    methodpublicgetLanguage() : string

    Returns the language set for this query.

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

    Returns
    TypeDescription
    stringThe query language.
    Details
    Api
     
    methodpublicgetStatement() : string

    Returns the statement defined for this query.

    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

    Fetches the path of the node representing this query.

    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

    Sets the maximum size of the result set to limit.

    Parameters
    NameTypeDescription
    $limitinteger

    The amount of result items to be fetched.

    Details
    Api
     
    methodpublicsetOffset(integer $offset) : void

    Sets the start offset of the result set to offset.

    Parameters
    NameTypeDescription
    $offsetinteger

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

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

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

    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.