TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
QueryInterface Interface Reference
Inheritance diagram for QueryInterface:
Query

Public Member Functions

 getSource ()
 
 execute ($returnRawQueryResult=false)
 
 setOrderings (array $orderings)
 
 setLimit ($limit)
 
 setOffset ($offset)
 
 matching ($constraint)
 
 logicalAnd ($constraint1)
 
 logicalOr ($constraint1)
 
 logicalNot (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

A persistence query interface

Definition at line 27 of file QueryInterface.php.

Member Function Documentation

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
ComparisonInterface
Exceptions
TYPO3 if used on a single-valued property

Implemented in Query.

count ( )

Returns the query result count.

Returns
int The query result count

Implemented in Query.

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
bool$caseSensitiveWhether the equality test should be done case-sensitive for strings
Returns

Implemented in Query.

execute (   $returnRawQueryResult = false)

Executes the query and returns the result.

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

Implemented in Query.

getConstraint ( )

Gets the constraint for this query.

Returns
ConstraintInterface|NULL the constraint, or null if none

Implemented in Query.

Referenced by Typo3DbQueryParser\convertQueryToDoctrineQueryBuilder(), and Typo3DbBackend\getObjectCountByQuery().

getLimit ( )

Returns the maximum size of the result set to limit.

Returns
int

Implemented in Query.

Referenced by Typo3DbBackend\getObjectCountByQuery(), and Typo3DbBackend\getObjectDataByQuery().

getOffset ( )

Returns the start offset of the result set.

Returns
int

Implemented in Query.

Referenced by Typo3DbBackend\getObjectCountByQuery(), and Typo3DbBackend\getObjectDataByQuery().

getOrderings ( )

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

Returns
array

Implemented in Query.

Referenced by Typo3DbQueryParser\convertQueryToDoctrineQueryBuilder().

getQuerySettings ( )

Returns the Query Settings.

Returns
$querySettings The Query Settings
Todo:
decide whether this can be deprecated eventually This method is not part of TYPO3Flow API

Implemented in Query.

Referenced by Typo3DbQueryParser\addTypo3Constraints(), and Typo3DbBackend\getObjectDataByQuery().

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 Query.

Referenced by Typo3DbQueryParser\convertQueryToDoctrineQueryBuilder(), and Typo3DbBackend\getObjectDataByQuery().

getStatement ( )

Returns the statement of this query.

Returns

Implemented in Query.

Referenced by Typo3DbBackend\getObjectDataByQuery().

getType ( )

Returns the type this query cares for.

Returns
string

Implemented in Query.

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
ComparisonInterface
Exceptions
TYPO3 if used on a multi-valued property or with a non-literal/non-DateTime operand

Implemented in Query.

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
ComparisonInterface
Exceptions
TYPO3 if used on a multi-valued property or with a non-literal/non-DateTime operand

Implemented in Query.

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
ComparisonInterface
Exceptions
TYPO3 if used on a multi-valued property

Implemented in Query.

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
bool
Exceptions
TYPO3 if used on a single-valued property

Implemented in Query.

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
ComparisonInterface
Exceptions
TYPO3 if used on a multi-valued property or with a non-literal/non-DateTime operand

Implemented in Query.

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
ComparisonInterface
Exceptions
TYPO3 if used on a multi-valued property or with a non-literal/non-DateTime operand

Implemented in Query.

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
bool$caseSensitiveWhether the matching should be done case-sensitive
Returns
ComparisonInterface
Exceptions
TYPO3 if used on a non-string property

Implemented in Query.

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
AndInterface

Implemented in Query.

logicalNot ( ConstraintInterface  $constraint)

Performs a logical negation of the given constraint

Parameters
ConstraintInterface$constraintConstraint to negate
Returns
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
OrInterface

Implemented in Query.

matching (   $constraint)

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

Parameters
ConstraintInterface$constraintSome constraint, depending on the backend
Returns

Implemented in Query.

setLimit (   $limit)

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

Parameters
int$limit
Returns

Implemented in Query.

setOffset (   $offset)

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

Parameters
int$offset
Returns

Implemented in Query.

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 Query.

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 ( Generic\Qom\SourceInterface  $source)

Sets the source to fetch the result from

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

Member Data Documentation

const OPERATOR_CONTAINS = 8

The 'contains' comparison operator for collections.

Definition at line 97 of file QueryInterface.php.

Referenced by Query\contains(), and Typo3DbQueryParser\parseComparison().

const OPERATOR_EQUAL_TO = 1

The '=' comparison operator.

Definition at line 34 of file QueryInterface.php.

Referenced by Query\equals(), Comparison\getOperator(), and Typo3DbQueryParser\parseDynamicOperand().

const OPERATOR_EQUAL_TO_NULL = 101

For NULL we have to use 'IS' instead of '='

Definition at line 41 of file QueryInterface.php.

Referenced by Comparison\getOperator(), and Typo3DbQueryParser\parseDynamicOperand().

const OPERATOR_GREATER_THAN = 5

The '>' comparison operator.

Definition at line 76 of file QueryInterface.php.

Referenced by Query\greaterThan(), and Typo3DbQueryParser\parseDynamicOperand().

const OPERATOR_GREATER_THAN_OR_EQUAL_TO = 6

The '>=' comparison operator.

Definition at line 83 of file QueryInterface.php.

Referenced by Query\greaterThanOrEqual(), and Typo3DbQueryParser\parseDynamicOperand().

const OPERATOR_IN = 9

The 'in' comparison operator.

Definition at line 104 of file QueryInterface.php.

Referenced by Query\in(), and Typo3DbQueryParser\parseDynamicOperand().

const OPERATOR_IS_EMPTY = 11

The 'is empty' comparison operator for collections.

Definition at line 118 of file QueryInterface.php.

const OPERATOR_IS_NULL = 10

The 'is NULL' comparison operator.

Definition at line 111 of file QueryInterface.php.

const OPERATOR_LESS_THAN = 3

The '<' comparison operator.

Definition at line 62 of file QueryInterface.php.

Referenced by Query\lessThan(), and Typo3DbQueryParser\parseDynamicOperand().

const OPERATOR_LESS_THAN_OR_EQUAL_TO = 4

The '<=' comparison operator.

Definition at line 69 of file QueryInterface.php.

Referenced by Query\lessThanOrEqual(), and Typo3DbQueryParser\parseDynamicOperand().

const OPERATOR_LIKE = 7

The 'like' comparison operator.

Definition at line 90 of file QueryInterface.php.

Referenced by Query\like(), and Typo3DbQueryParser\parseDynamicOperand().

const OPERATOR_NOT_EQUAL_TO = 2

The '!=' comparison operator.

Definition at line 48 of file QueryInterface.php.

Referenced by Comparison\getOperator(), and Typo3DbQueryParser\parseDynamicOperand().

const OPERATOR_NOT_EQUAL_TO_NULL = 202

For NULL we have to use 'IS NOT' instead of '!='

Definition at line 55 of file QueryInterface.php.

Referenced by Comparison\getOperator(), and Typo3DbQueryParser\parseDynamicOperand().