phpcr/src/PHPCR/Query/QueryManagerInterface.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\QueryManagerInterface
Provides methods for the creation and retrieval of search queries.
- Api
Methods
createQuery(string $statement, string $language) : \PHPCR\Query\QueryInterface
Creates a new query by specifying the query statement itself and the language in which the query is stated.
The $language must be a string from among those returned by QueryManagerInterface::getSupportedQueryLanguages().
Name | Type | Description |
---|---|---|
$statement | string | The query statement to be executed. |
$language | string | The language of the query to be created. |
Type | Description |
---|---|
\PHPCR\Query\QueryInterface | a Query object |
Exception | Description |
---|---|
\PHPCR\Query\InvalidQueryException | if the query statement is syntactically invalid or the specified language is not supported |
\PHPCR\RepositoryException | if another error occurs |
- Api
getQOMFactory() : \PHPCR\Query\QOM\QueryObjectModelFactoryInterface
Returns a QueryObjectModelFactory with which a JCR-JQOM query can be built programmatically.
Type | Description |
---|---|
\PHPCR\Query\QOM\QueryObjectModelFactoryInterface | a QueryObjectModelFactory object |
- Api
getQuery(\PHPCR\NodeInterface $node) : \PHPCR\Query\QueryInterface
Retrieves an existing persistent query.
Persistent queries are created by first using QueryManagerInterface::createQuery() to create a Query object and then calling QueryInterface::save() to persist the query to a location in the workspace.
Name | Type | Description |
---|---|---|
$node | \PHPCR\NodeInterface | a persisted query (that is, a node of type nt:query). |
Type | Description |
---|---|
\PHPCR\Query\QueryInterface | a Query object. |
Exception | Description |
---|---|
\PHPCR\Query\InvalidQueryException | If node is not a valid persisted query (that is, a node of type nt:query). |
\PHPCR\RepositoryException | if another error occurs |
- Api
getSupportedQueryLanguages() : array
Returns an array of strings representing all query languages supported by this repository.
This set must include at least the strings represented by the constants QueryInterface::JCR_SQL2 and QueryInterface::JCR_JQOM. An implementation may also support other languages including the deprecated languages of JCR 1.0: QueryInterface::XPATH and QueryInterface::SQL.
Type | Description |
---|---|
array | A list of supported languages by the query. |
Exception | Description |
---|---|
\PHPCR\RepositoryException | if an error occurs. |
- Api