TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Extbase\Persistence\QueryInterface Interface Reference
Inheritance diagram for TYPO3\CMS\Extbase\Persistence\QueryInterface:
Tx_Extbase_Persistence_QueryInterface TYPO3\CMS\Extbase\Persistence\Generic\Query Tx_Extbase_Persistence_Query

Public Member Functions

 getSource ()
 
 execute ($returnRawQueryResult=FALSE)
 
 setOrderings (array $orderings)
 
 setLimit ($limit)
 
 setOffset ($offset)
 
 matching ($constraint)
 
 logicalAnd ($constraint1)
 
 logicalOr ($constraint1)
 
 logicalNot (\TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface $constraint)
 
 equals ($propertyName, $operand, $caseSensitive=TRUE)
 
 like ($propertyName, $operand, $caseSensitive=TRUE)
 
 contains ($propertyName, $operand)
 
 in ($propertyName, $operand)
 
 lessThan ($propertyName, $operand)
 
 lessThanOrEqual ($propertyName, $operand)
 
 greaterThan ($propertyName, $operand)
 
 greaterThanOrEqual ($propertyName, $operand)
 
 getType ()
 
 setQuerySettings (Generic\QuerySettingsInterface $querySettings)
 
 getQuerySettings ()
 
 count ()
 
 getOrderings ()
 
 getLimit ()
 
 getOffset ()
 
 getConstraint ()
 
 isEmpty ($propertyName)
 
 setSource (Generic\Qom\SourceInterface $source)
 
 getStatement ()
 

Public Attributes

const OPERATOR_EQUAL_TO = 1
 
const OPERATOR_EQUAL_TO_NULL = 101
 
const OPERATOR_NOT_EQUAL_TO = 2
 
const OPERATOR_NOT_EQUAL_TO_NULL = 202
 
const OPERATOR_LESS_THAN = 3
 
const OPERATOR_LESS_THAN_OR_EQUAL_TO = 4
 
const OPERATOR_GREATER_THAN = 5
 
const OPERATOR_GREATER_THAN_OR_EQUAL_TO = 6
 
const OPERATOR_LIKE = 7
 
const OPERATOR_CONTAINS = 8
 
const OPERATOR_IN = 9
 
const OPERATOR_IS_NULL = 10
 
const OPERATOR_IS_EMPTY = 11
 
const ORDER_ASCENDING = 'ASC'
 
const ORDER_DESCENDING = 'DESC'
 

Detailed Description

This file is part of the TYPO3 CMS project.

It is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, either version 2 of the License, or any later version.

For the full copyright and license information, please read the LICENSE.txt file that was distributed with this source code.

The TYPO3 project - inspiring people to share! A persistence query interface

Definition at line 21 of file QueryInterface.php.

Member Function Documentation

◆ contains()

TYPO3\CMS\Extbase\Persistence\QueryInterface::contains (   $propertyName,
  $operand 
)

Returns a "contains" criterion used for matching objects against a query. It matches if the multivalued property contains the given operand.

If NULL is given as $operand, there will never be a match!

Parameters
string$propertyNameThe name of the multivalued property to compare against
mixed$operandThe value to compare with
Returns
object
Exceptions

Implemented in TYPO3\CMS\Extbase\Persistence\Generic\Query.

◆ count()

TYPO3\CMS\Extbase\Persistence\QueryInterface::count ( )

Returns the query result count.

Returns
integer The query result count

Implemented in TYPO3\CMS\Extbase\Persistence\Generic\Query.

◆ equals()

TYPO3\CMS\Extbase\Persistence\QueryInterface::equals (   $propertyName,
  $operand,
  $caseSensitive = TRUE 
)

Returns an equals criterion used for matching objects against a query.

It matches if the $operand equals the value of the property named $propertyName. If $operand is NULL a strict check for NULL is done. For strings the comparison can be done with or without case-sensitivity.

Parameters
string$propertyNameThe name of the property to compare against
mixed$operandThe value to compare with
boolean$caseSensitiveWhether the equality test should be done case-sensitive for strings
Returns

Implemented in TYPO3\CMS\Extbase\Persistence\Generic\Query.

◆ execute()

TYPO3\CMS\Extbase\Persistence\QueryInterface::execute (   $returnRawQueryResult = FALSE)

Executes the query and returns the result.

Parameters
$returnRawQueryResultboolean avoids the object mapping by the persistence
Returns
|array The query result object or an array if $returnRawQueryResult is TRUE

Implemented in TYPO3\CMS\Extbase\Persistence\Generic\Query.

◆ getConstraint()

◆ getLimit()

TYPO3\CMS\Extbase\Persistence\QueryInterface::getLimit ( )

Returns the maximum size of the result set to limit.

Returns
integer

Implemented in TYPO3\CMS\Extbase\Persistence\Generic\Query.

Referenced by TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser\parseQuery().

◆ getOffset()

TYPO3\CMS\Extbase\Persistence\QueryInterface::getOffset ( )

Returns the start offset of the result set.

Returns
integer

Implemented in TYPO3\CMS\Extbase\Persistence\Generic\Query.

Referenced by TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser\parseQuery().

◆ getOrderings()

TYPO3\CMS\Extbase\Persistence\QueryInterface::getOrderings ( )

Gets the property names to order the result by, like this: array( 'foo' => ::ORDER_ASCENDING, 'bar' => ::ORDER_DESCENDING )

Returns
array

Implemented in TYPO3\CMS\Extbase\Persistence\Generic\Query.

Referenced by TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser\parseQuery(), and TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser\preparseQuery().

◆ getQuerySettings()

TYPO3\CMS\Extbase\Persistence\QueryInterface::getQuerySettings ( )

◆ getSource()

TYPO3\CMS\Extbase\Persistence\QueryInterface::getSource ( )

Gets the node-tuple source for this query.

Returns
the node-tuple source; non-NULL
Deprecated:
since Extbase 6.0, will be removed in Extbase 7.0. It is deprecated only in the interface to be more in sync with Flow in future and will stay in Generic Persistence.

Implemented in TYPO3\CMS\Extbase\Persistence\Generic\Query.

Referenced by TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend\getObjectDataByQuery(), TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser\parseQuery(), and TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser\preparseQuery().

◆ getStatement()

TYPO3\CMS\Extbase\Persistence\QueryInterface::getStatement ( )

◆ getType()

TYPO3\CMS\Extbase\Persistence\QueryInterface::getType ( )

Returns the type this query cares for.

Returns
string

Implemented in TYPO3\CMS\Extbase\Persistence\Generic\Query.

◆ greaterThan()

TYPO3\CMS\Extbase\Persistence\QueryInterface::greaterThan (   $propertyName,
  $operand 
)

Returns a greater than criterion used for matching objects against a query

Parameters
string$propertyNameThe name of the property to compare against
mixed$operandThe value to compare with
Returns
object
Exceptions

Implemented in TYPO3\CMS\Extbase\Persistence\Generic\Query.

◆ greaterThanOrEqual()

TYPO3\CMS\Extbase\Persistence\QueryInterface::greaterThanOrEqual (   $propertyName,
  $operand 
)

Returns a greater than or equal criterion used for matching objects against a query

Parameters
string$propertyNameThe name of the property to compare against
mixed$operandThe value to compare with
Returns
object
Exceptions

Implemented in TYPO3\CMS\Extbase\Persistence\Generic\Query.

◆ in()

TYPO3\CMS\Extbase\Persistence\QueryInterface::in (   $propertyName,
  $operand 
)

Returns an "in" criterion used for matching objects against a query. It matches if the property's value is contained in the multivalued operand.

Parameters
string$propertyNameThe name of the property to compare against
mixed$operandThe value to compare with, multivalued
Returns
object
Exceptions

Implemented in TYPO3\CMS\Extbase\Persistence\Generic\Query.

◆ isEmpty()

TYPO3\CMS\Extbase\Persistence\QueryInterface::isEmpty (   $propertyName)

Returns an "isEmpty" criterion used for matching objects against a query. It matches if the multivalued property contains no values or is NULL.

Parameters
string$propertyNameThe name of the multivalued property to compare against
Returns
boolean
Exceptions

Implemented in TYPO3\CMS\Extbase\Persistence\Generic\Query.

◆ lessThan()

TYPO3\CMS\Extbase\Persistence\QueryInterface::lessThan (   $propertyName,
  $operand 
)

Returns a less than criterion used for matching objects against a query

Parameters
string$propertyNameThe name of the property to compare against
mixed$operandThe value to compare with
Returns
object
Exceptions

Implemented in TYPO3\CMS\Extbase\Persistence\Generic\Query.

◆ lessThanOrEqual()

TYPO3\CMS\Extbase\Persistence\QueryInterface::lessThanOrEqual (   $propertyName,
  $operand 
)

Returns a less or equal than criterion used for matching objects against a query

Parameters
string$propertyNameThe name of the property to compare against
mixed$operandThe value to compare with
Returns
object
Exceptions

Implemented in TYPO3\CMS\Extbase\Persistence\Generic\Query.

◆ like()

TYPO3\CMS\Extbase\Persistence\QueryInterface::like (   $propertyName,
  $operand,
  $caseSensitive = TRUE 
)

Returns a like criterion used for matching objects against a query. Matches if the property named $propertyName is like the $operand, using standard SQL wildcards.

Parameters
string$propertyNameThe name of the property to compare against
string$operandThe value to compare with
boolean$caseSensitiveWhether the matching should be done case-sensitive
Returns
object
Exceptions

Implemented in TYPO3\CMS\Extbase\Persistence\Generic\Query.

◆ logicalAnd()

TYPO3\CMS\Extbase\Persistence\QueryInterface::logicalAnd (   $constraint1)

Performs a logical conjunction of the two given constraints. The method takes one or more constraints and concatenates them with a boolean AND. It also accepts a single array of constraints to be concatenated.

Parameters
mixed$constraint1The first of multiple constraints or an array of constraints.
Returns
object

Implemented in TYPO3\CMS\Extbase\Persistence\Generic\Query.

◆ logicalNot()

TYPO3\CMS\Extbase\Persistence\QueryInterface::logicalNot ( \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface  $constraint)

Performs a logical negation of the given constraint

Parameters
\TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface$constraintConstraint to negate
Returns

Implemented in TYPO3\CMS\Extbase\Persistence\Generic\Query.

◆ logicalOr()

TYPO3\CMS\Extbase\Persistence\QueryInterface::logicalOr (   $constraint1)

Performs a logical disjunction of the two given constraints. The method takes one or more constraints and concatenates them with a boolean OR. It also accepts a single array of constraints to be concatenated.

Parameters
mixed$constraint1The first of multiple constraints or an array of constraints.
Returns
object

Implemented in TYPO3\CMS\Extbase\Persistence\Generic\Query.

◆ matching()

TYPO3\CMS\Extbase\Persistence\QueryInterface::matching (   $constraint)

The constraint used to limit the result set. Returns $this to allow for chaining (fluid interface).

Parameters
object$constraintSome constraint, depending on the backend
Returns

Implemented in TYPO3\CMS\Extbase\Persistence\Generic\Query.

◆ setLimit()

TYPO3\CMS\Extbase\Persistence\QueryInterface::setLimit (   $limit)

Sets the maximum size of the result set to limit. Returns $this to allow for chaining (fluid interface).

Parameters
integer$limit
Returns

Implemented in TYPO3\CMS\Extbase\Persistence\Generic\Query.

◆ setOffset()

TYPO3\CMS\Extbase\Persistence\QueryInterface::setOffset (   $offset)

Sets the start offset of the result set to offset. Returns $this to allow for chaining (fluid interface).

Parameters
integer$offset
Returns

Implemented in TYPO3\CMS\Extbase\Persistence\Generic\Query.

◆ setOrderings()

TYPO3\CMS\Extbase\Persistence\QueryInterface::setOrderings ( array  $orderings)

Sets the property names to order the result by. Expected like this: array( 'foo' => ::ORDER_ASCENDING, 'bar' => ::ORDER_DESCENDING )

Parameters
array$orderingsThe property names to order by
Returns

Implemented in TYPO3\CMS\Extbase\Persistence\Generic\Query.

◆ setQuerySettings()

TYPO3\CMS\Extbase\Persistence\QueryInterface::setQuerySettings ( Generic\QuerySettingsInterface  $querySettings)

Sets the Query Settings. These Query settings must match the settings expected by the specific Storage Backend.

Parameters
\TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface$querySettingsThe Query Settings
Returns
void
Todo:
decide whether this can be deprecated somewhen This method is not part of TYPO3Flow API

◆ setSource()

TYPO3\CMS\Extbase\Persistence\QueryInterface::setSource ( Generic\Qom\SourceInterface  $source)

Sets the source to fetch the result from

Parameters
\TYPO3\CMS\Extbase\Persistence\Generic\Qom\SourceInterface$source

Member Data Documentation

◆ OPERATOR_CONTAINS

const TYPO3\CMS\Extbase\Persistence\QueryInterface::OPERATOR_CONTAINS = 8

The 'contains' comparison operator for collections.

Definition at line 91 of file QueryInterface.php.

Referenced by TYPO3\CMS\Extbase\Persistence\Generic\Query\contains(), and TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser\parseComparison().

◆ OPERATOR_EQUAL_TO

const TYPO3\CMS\Extbase\Persistence\QueryInterface::OPERATOR_EQUAL_TO = 1

◆ OPERATOR_EQUAL_TO_NULL

const TYPO3\CMS\Extbase\Persistence\QueryInterface::OPERATOR_EQUAL_TO_NULL = 101

◆ OPERATOR_GREATER_THAN

const TYPO3\CMS\Extbase\Persistence\QueryInterface::OPERATOR_GREATER_THAN = 5

◆ OPERATOR_GREATER_THAN_OR_EQUAL_TO

const TYPO3\CMS\Extbase\Persistence\QueryInterface::OPERATOR_GREATER_THAN_OR_EQUAL_TO = 6

◆ OPERATOR_IN

◆ OPERATOR_IS_EMPTY

const TYPO3\CMS\Extbase\Persistence\QueryInterface::OPERATOR_IS_EMPTY = 11

The 'is empty' comparison operator for collections.

Definition at line 112 of file QueryInterface.php.

◆ OPERATOR_IS_NULL

const TYPO3\CMS\Extbase\Persistence\QueryInterface::OPERATOR_IS_NULL = 10

The 'is NULL' comparison operator.

Definition at line 105 of file QueryInterface.php.

◆ OPERATOR_LESS_THAN

const TYPO3\CMS\Extbase\Persistence\QueryInterface::OPERATOR_LESS_THAN = 3

◆ OPERATOR_LESS_THAN_OR_EQUAL_TO

const TYPO3\CMS\Extbase\Persistence\QueryInterface::OPERATOR_LESS_THAN_OR_EQUAL_TO = 4

◆ OPERATOR_LIKE

const TYPO3\CMS\Extbase\Persistence\QueryInterface::OPERATOR_LIKE = 7

◆ OPERATOR_NOT_EQUAL_TO

const TYPO3\CMS\Extbase\Persistence\QueryInterface::OPERATOR_NOT_EQUAL_TO = 2

◆ OPERATOR_NOT_EQUAL_TO_NULL

const TYPO3\CMS\Extbase\Persistence\QueryInterface::OPERATOR_NOT_EQUAL_TO_NULL = 202

◆ ORDER_ASCENDING

◆ ORDER_DESCENDING

const TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_DESCENDING = 'DESC'