PHP Class Neos\Flow\Persistence\Doctrine\Query

Inheritance: implements Neos\Flow\Persistence\QueryInterface
Afficher le fichier Open project: neos/flow-development-collection Class Usage Examples

Protected Properties

Свойство Type Description
$cacheResult boolean
$constraint mixed
$distinct boolean
$entityClassName string
$entityManager Doctrine\ORM\EntityManager
$joinAliasCounter integer
$joins array
$limit integer
$offset integer
$orderings array
$parameterIndex integer
$parameters array
$queryBuilder Doctrine\ORM\QueryBuilder
$settings array
$systemLogger Neos\Flow\Log\SystemLoggerInterface

Méthodes publiques

Méthode Description
__clone ( ) Cloning the query clones also the internal QueryBuilder, as they are tightly coupled.
__construct ( string $entityClassName )
__sleep ( ) : array We need to drop the query builder, as it contains a PDO instance deep inside.
__wakeup ( ) : void Recreate query builder and set state again.
addParameters ( array $parameters ) : void Add parameters to the query
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 ( ) : Neos\Flow\Persistence\Generic\Qom\Constraint Gets the constraint for this query.
getLimit ( ) : integer Returns the maximum size of the result set to limit.
getOffset ( ) : integer Returns the start offset of the result set.
getOrderings ( ) : array Returns 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 )
getParameters ( ) : array Gets all defined query parameters for the query being constructed.
getQueryBuilder ( ) : Doctrine\ORM\QueryBuilder
getResult ( ) : array Gets the results of this query as array.
getSql ( ) : array Return the SQL statements representing this Query.
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.
injectEntityManager ( Doctrine\Common\Persistence\ObjectManager $entityManager ) : void
injectSettings ( array $settings ) : void Injects the Flow settings, the persistence part is kept for further use.
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 )

Méthodes protégées

Méthode Description
getParamNeedle ( mixed $operand ) : string Get a needle for parameter binding.
getPropertyNameWithAlias ( string $propertyPath ) : string Adds left join clauses along the given property path to the query, if needed.

Method Details

__clone() public méthode

Cloning the query clones also the internal QueryBuilder, as they are tightly coupled.
public __clone ( )

__construct() public méthode

public __construct ( string $entityClassName )
$entityClassName string

__sleep() public méthode

We need to drop the query builder, as it contains a PDO instance deep inside.
public __sleep ( ) : array
Résultat array

__wakeup() public méthode

Recreate query builder and set state again.
public __wakeup ( ) : void
Résultat void

addParameters() public méthode

Add parameters to the query
public addParameters ( array $parameters ) : void
$parameters array
Résultat void

contains() public méthode

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
Résultat object

count() public méthode

Returns the query result count
public count ( ) : integer
Résultat integer The query result count

equals() public méthode

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. Note: case-sensitivity is only possible if the database supports it. E.g. if you are using MySQL with a case-insensitive collation you will not be able to test for case-sensitive equality (the other way around works, because we compare lowercased values).
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
Résultat object

execute() public méthode

Executes the query and returns the result.
public execute ( boolean $cacheResult = false ) : Neos\Flow\Persistence\QueryResultInterface
$cacheResult boolean If the Doctrine result cache should be used
Résultat Neos\Flow\Persistence\QueryResultInterface The query result

getConstraint() public méthode

Gets the constraint for this query.
public getConstraint ( ) : Neos\Flow\Persistence\Generic\Qom\Constraint
Résultat Neos\Flow\Persistence\Generic\Qom\Constraint the constraint, or null if none

getLimit() public méthode

Returns the maximum size of the result set to limit.
public getLimit ( ) : integer
Résultat integer

getOffset() public méthode

Returns the start offset of the result set.
public getOffset ( ) : integer
Résultat integer

getOrderings() public méthode

Returns 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
Résultat array

getParamNeedle() protected méthode

Get a needle for parameter binding.
protected getParamNeedle ( mixed $operand ) : string
$operand mixed
Résultat string

getParameters() public méthode

Gets all defined query parameters for the query being constructed.
public getParameters ( ) : array
Résultat array

getPropertyNameWithAlias() protected méthode

This enables us to set conditions on related objects.
protected getPropertyNameWithAlias ( string $propertyPath ) : string
$propertyPath string The path to a sub property, e.g. property.subProperty.foo, or a simple property name
Résultat string The last part of the property name prefixed by the used join alias, if joins have been added

getQueryBuilder() public méthode

public getQueryBuilder ( ) : Doctrine\ORM\QueryBuilder
Résultat Doctrine\ORM\QueryBuilder

getResult() public méthode

Really executes the query on the database. This should only ever be executed from the QueryResult class.
public getResult ( ) : array
Résultat array result set

getSql() public méthode

Return the SQL statements representing this Query.
public getSql ( ) : array
Résultat array

getType() public méthode

Returns the type this query cares for.
public getType ( ) : string
Résultat string

greaterThan() public méthode

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
Résultat object

greaterThanOrEqual() public méthode

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
Résultat object

in() public méthode

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
Résultat object

injectEntityManager() public méthode

public injectEntityManager ( Doctrine\Common\Persistence\ObjectManager $entityManager ) : void
$entityManager Doctrine\Common\Persistence\ObjectManager
Résultat void

injectSettings() public méthode

Injects the Flow settings, the persistence part is kept for further use.
public injectSettings ( array $settings ) : void
$settings array
Résultat void

isDistinct() public méthode

Returns the DISTINCT flag for this query.
public isDistinct ( ) : boolean
Résultat boolean

isEmpty() public méthode

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
Résultat boolean

lessThan() public méthode

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
Résultat object

lessThanOrEqual() public méthode

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
Résultat object

like() public méthode

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
Résultat object

logicalAnd() public méthode

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.
Résultat object

logicalNot() public méthode

Performs a logical negation of the given constraint
public logicalNot ( object $constraint ) : object
$constraint object Constraint to negate
Résultat object

logicalOr() public méthode

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.
Résultat object

matching() public méthode

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
Résultat Neos\Flow\Persistence\QueryInterface

setDistinct() public méthode

Sets the DISTINCT flag for this query.
public setDistinct ( boolean $distinct = true ) : Neos\Flow\Persistence\QueryInterface
$distinct boolean
Résultat Neos\Flow\Persistence\QueryInterface

setLimit() public méthode

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
Résultat Neos\Flow\Persistence\QueryInterface

setOffset() public méthode

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
Résultat Neos\Flow\Persistence\QueryInterface

setOrderings() public méthode

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
Résultat Neos\Flow\Persistence\QueryInterface

Property Details

$cacheResult protected_oe property

protected bool $cacheResult
Résultat boolean

$constraint protected_oe property

protected mixed $constraint
Résultat mixed

$distinct protected_oe property

protected bool $distinct
Résultat boolean

$entityClassName protected_oe property

protected string $entityClassName
Résultat string

$entityManager protected_oe property

protected EntityManager,Doctrine\ORM $entityManager
Résultat Doctrine\ORM\EntityManager

$joinAliasCounter protected_oe property

protected int $joinAliasCounter
Résultat integer

$joins protected_oe property

protected array $joins
Résultat array

$limit protected_oe property

protected int $limit
Résultat integer

$offset protected_oe property

protected int $offset
Résultat integer

$orderings protected_oe property

protected array $orderings
Résultat array

$parameterIndex protected_oe property

protected int $parameterIndex
Résultat integer

$parameters protected_oe property

protected array $parameters
Résultat array

$queryBuilder protected_oe property

protected QueryBuilder,Doctrine\ORM $queryBuilder
Résultat Doctrine\ORM\QueryBuilder

$settings protected_oe property

protected array $settings
Résultat array

$systemLogger protected_oe property

protected SystemLoggerInterface,Neos\Flow\Log $systemLogger
Résultat Neos\Flow\Log\SystemLoggerInterface