* @package phpcr
* @subpackage query
*/
interface QueryManager
{
/**
* Creates a new query by specifying the query statement itself and the
* language in which the query is stated. If the query statement is
* syntactically invalid, given the language specified, an
* InvalidQueryException is thrown. language must specify a query language
* from among those returned by QueryManager.getSupportedQueryLanguages(); if it is not
* then an InvalidQueryException is thrown.
*
* @throws InvalidQueryException if statement is invalid or language is unsupported.
* @throws RepositoryException if another error occurs
* @return A Query
object.
*/
public function createQuery( $statement, $language );
/**
* Retrieves an existing persistent query. If node
* is not a valid persisted query (that is, a node of type
* nt:query
), an InvalidQueryException
* is thrown.
*
QueryManager.createQuery
* to create a Query
object and then calling Query.save
to
* persist the query to a location in the workspace.
*
* @param node a persisted query (that is, a node of type nt:query
).
* @throws InvalidQueryException If node
is not a valid persisted query
* (that is, a node of type nt:query
).
* @throws RepositoryException if another error occurs
* @return a Query
object.
*/
public function getQuery( Node $node );
/**
* Returns an array of integers identifying the supported query languages.
* See QueryLanguage.
*
* @return An string array.
* @throws RepositoryException if an error occurs.
*/
public function getSupportedQueryLanguages();
}
?>