PHP Интерфейс Neos\Flow\Persistence\QueryInterface

The main point when implementing this is to make sure that methods with a return type of "object" return something that can be fed to matching() and all constraint-generating methods (like logicalAnd(), equals(), like(), ...). This allows for code like $query->matching($query->equals('foo', 'bar'))->setLimit(10)->execute();
Показать файл Открыть проект Примеры использования интерфейса

Открытые методы

Метод Описание
contains ( string $propertyName, mixed $operand ) : object Returns a "contains" criterion used for matching objects against a query.
count ( ) : integer Returns the query result count.
equals ( string $propertyName, mixed $operand, boolean $caseSensitive = true ) : object Returns an equals criterion used for matching objects against a query.
execute ( boolean $cacheResult = false ) : Neos\Flow\Persistence\QueryResultInterface Executes the query and returns the result.
getConstraint ( ) : mixed Gets the constraint for this query.
getLimit ( ) Returns the maximum size of the result set to limit.
getOffset ( ) : integer Returns the start offset of the result set.
getOrderings ( ) : array Gets the property names to order the result by, like this: array( 'foo' => \Neos\Flow\Persistence\QueryInterface::ORDER_ASCENDING, 'bar' => \Neos\Flow\Persistence\QueryInterface::ORDER_DESCENDING )
getType ( ) : string Returns the type this query cares for.
greaterThan ( string $propertyName, mixed $operand ) : object Returns a greater than criterion used for matching objects against a query
greaterThanOrEqual ( string $propertyName, mixed $operand ) : object Returns a greater than or equal criterion used for matching objects against a query
in ( string $propertyName, mixed $operand ) : object Returns an "in" criterion used for matching objects against a query. It matches if the property's value is contained in the multivalued operand.
isDistinct ( ) : boolean Returns the DISTINCT flag for this query.
isEmpty ( string $propertyName ) : boolean Returns an "isEmpty" criterion used for matching objects against a query.
lessThan ( string $propertyName, mixed $operand ) : object Returns a less than criterion used for matching objects against a query
lessThanOrEqual ( string $propertyName, mixed $operand ) : object Returns a less or equal than criterion used for matching objects against a query
like ( string $propertyName, string $operand, boolean $caseSensitive = true ) : object Returns a like criterion used for matching objects against a query.
logicalAnd ( mixed $constraint1 ) : object Performs a logical conjunction of the two given constraints. The method takes one or more constraints and concatenates them with a boolean AND.
logicalNot ( object $constraint ) : object Performs a logical negation of the given constraint
logicalOr ( mixed $constraint1 ) : object Performs a logical disjunction of the two given constraints. The method takes one or more constraints and concatenates them with a boolean OR.
matching ( object $constraint ) : Neos\Flow\Persistence\QueryInterface The constraint used to limit the result set. Returns $this to allow for chaining (fluid interface).
setDistinct ( boolean $distinct = true ) : Neos\Flow\Persistence\QueryInterface Sets the DISTINCT flag for this query.
setLimit ( integer $limit ) : Neos\Flow\Persistence\QueryInterface Sets the maximum size of the result set to limit. Returns $this to allow for chaining (fluid interface).
setOffset ( integer $offset ) : Neos\Flow\Persistence\QueryInterface Sets the start offset of the result set to offset. Returns $this to allow for chaining (fluid interface).
setOrderings ( array $orderings ) : Neos\Flow\Persistence\QueryInterface Sets the property names to order the result by. Expected like this: array( 'foo' => \Neos\Flow\Persistence\QueryInterface::ORDER_ASCENDING, 'bar' => \Neos\Flow\Persistence\QueryInterface::ORDER_DESCENDING )

Описание методов

contains() публичный Метод

It matches if the multivalued property contains the given operand. If NULL is given as $operand, there will never be a match!
public contains ( string $propertyName, mixed $operand ) : object
$propertyName string The name of the multivalued property to compare against
$operand mixed The value to compare with
Результат object

count() публичный Метод

Returns the query result count.
public count ( ) : integer
Результат integer The query result count

equals() публичный Метод

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.
public equals ( string $propertyName, mixed $operand, boolean $caseSensitive = true ) : object
$propertyName string The name of the property to compare against
$operand mixed The value to compare with
$caseSensitive boolean Whether the equality test should be done case-sensitive for strings
Результат object

execute() публичный Метод

Executes the query and returns the result.
public execute ( boolean $cacheResult = false ) : Neos\Flow\Persistence\QueryResultInterface
$cacheResult boolean If the result cache should be used
Результат Neos\Flow\Persistence\QueryResultInterface The query result

getConstraint() публичный Метод

Gets the constraint for this query.
public getConstraint ( ) : mixed
Результат mixed the constraint, or null if none

getLimit() публичный Метод

Returns the maximum size of the result set to limit.
public getLimit ( )

getOffset() публичный Метод

Returns the start offset of the result set.
public getOffset ( ) : integer
Результат integer

getOrderings() публичный Метод

Gets the property names to order the result by, like this: array( 'foo' => \Neos\Flow\Persistence\QueryInterface::ORDER_ASCENDING, 'bar' => \Neos\Flow\Persistence\QueryInterface::ORDER_DESCENDING )
public getOrderings ( ) : array
Результат array

getType() публичный Метод

Returns the type this query cares for.
public getType ( ) : string
Результат string

greaterThan() публичный Метод

Returns a greater than criterion used for matching objects against a query
public greaterThan ( string $propertyName, mixed $operand ) : object
$propertyName string The name of the property to compare against
$operand mixed The value to compare with
Результат object

greaterThanOrEqual() публичный Метод

Returns a greater than or equal criterion used for matching objects against a query
public greaterThanOrEqual ( string $propertyName, mixed $operand ) : object
$propertyName string The name of the property to compare against
$operand mixed The value to compare with
Результат object

in() публичный Метод

Returns an "in" criterion used for matching objects against a query. It matches if the property's value is contained in the multivalued operand.
public in ( string $propertyName, mixed $operand ) : object
$propertyName string The name of the property to compare against
$operand mixed The value to compare with, multivalued
Результат object

isDistinct() публичный Метод

Returns the DISTINCT flag for this query.
public isDistinct ( ) : boolean
Результат boolean

isEmpty() публичный Метод

It matches if the multivalued property contains no values or is NULL.
public isEmpty ( string $propertyName ) : boolean
$propertyName string The name of the multivalued property to compare against
Результат boolean

lessThan() публичный Метод

Returns a less than criterion used for matching objects against a query
public lessThan ( string $propertyName, mixed $operand ) : object
$propertyName string The name of the property to compare against
$operand mixed The value to compare with
Результат object

lessThanOrEqual() публичный Метод

Returns a less or equal than criterion used for matching objects against a query
public lessThanOrEqual ( string $propertyName, mixed $operand ) : object
$propertyName string The name of the property to compare against
$operand mixed The value to compare with
Результат object

like() публичный Метод

Matches if the property named $propertyName is like the $operand, using standard SQL wildcards.
public like ( string $propertyName, string $operand, boolean $caseSensitive = true ) : object
$propertyName string The name of the property to compare against
$operand string The value to compare with
$caseSensitive boolean Whether the matching should be done case-sensitive
Результат object

logicalAnd() публичный Метод

It also accepts a single array of constraints to be concatenated.
public logicalAnd ( mixed $constraint1 ) : object
$constraint1 mixed The first of multiple constraints or an array of constraints.
Результат object

logicalNot() публичный Метод

Performs a logical negation of the given constraint
public logicalNot ( object $constraint ) : object
$constraint object Constraint to negate
Результат object

logicalOr() публичный Метод

It also accepts a single array of constraints to be concatenated.
public logicalOr ( mixed $constraint1 ) : object
$constraint1 mixed The first of multiple constraints or an array of constraints.
Результат object

matching() публичный Метод

The constraint used to limit the result set. Returns $this to allow for chaining (fluid interface).
public matching ( object $constraint ) : Neos\Flow\Persistence\QueryInterface
$constraint object Some constraint, depending on the backend
Результат Neos\Flow\Persistence\QueryInterface

setDistinct() публичный Метод

Sets the DISTINCT flag for this query.
public setDistinct ( boolean $distinct = true ) : Neos\Flow\Persistence\QueryInterface
$distinct boolean
Результат Neos\Flow\Persistence\QueryInterface

setLimit() публичный Метод

Sets the maximum size of the result set to limit. Returns $this to allow for chaining (fluid interface).
public setLimit ( integer $limit ) : Neos\Flow\Persistence\QueryInterface
$limit integer
Результат Neos\Flow\Persistence\QueryInterface

setOffset() публичный Метод

Sets the start offset of the result set to offset. Returns $this to allow for chaining (fluid interface).
public setOffset ( integer $offset ) : Neos\Flow\Persistence\QueryInterface
$offset integer
Результат Neos\Flow\Persistence\QueryInterface

setOrderings() публичный Метод

Sets the property names to order the result by. Expected like this: array( 'foo' => \Neos\Flow\Persistence\QueryInterface::ORDER_ASCENDING, 'bar' => \Neos\Flow\Persistence\QueryInterface::ORDER_DESCENDING )
public setOrderings ( array $orderings ) : Neos\Flow\Persistence\QueryInterface
$orderings array The property names to order by
Результат Neos\Flow\Persistence\QueryInterface