class PropertyConditionGenerator implements SqlGeneratorInterface (View source)

A sql generator to create a sql condition for an entity property.

Properties

protected string $path

Property path the currently parsed expression relates to

protected string $operator
protected string|array $operandDefinition
protected mixed $operand
protected array $globalObjects

Array of registered global objects that can be accessed as operands

protected Context $securityContext
protected ObjectManagerInterface $objectManager
protected PolicyService $policyService
protected EntityManagerInterface $entityManager
protected PersistenceManager $persistenceManager
protected array $parameters

Raw parameter values

Methods

__construct(string $path)

No description

equals(string|array $operandDefinition)

No description

notEquals(string|array $operandDefinition)

No description

lessThan(mixed $operandDefinition)

No description

lessOrEqual(mixed $operandDefinition)

No description

greaterThan(mixed $operandDefinition)

No description

greaterOrEqual(mixed $operandDefinition)

No description

like(mixed $operandDefinition)

No description

in(mixed $operandDefinition)

No description

contains(mixed $operandDefinition)

No description

string
getSql(SQLFilter $sqlFilter, ClassMetadata $targetEntity, string $targetTableAlias)

No description

string
getSqlForPropertyContains(SQLFilter $sqlFilter, QuoteStrategy $quoteStrategy, ClassMetadata $targetEntity, string $targetTableAlias, string $targetEntityPropertyName)

No description

string
getSqlForSimpleProperty(SQLFilter $sqlFilter, QuoteStrategy $quoteStrategy, ClassMetadata $targetEntity, string $targetTableAlias, string $targetEntityPropertyName)

No description

string
getSqlForManyToOneAndOneToOneRelationsWithoutPropertyPath(SQLFilter $sqlFilter, QuoteStrategy $quoteStrategy, ClassMetadata $targetEntity, string $targetTableAlias, string $targetEntityPropertyName)

No description

string
getSqlForManyToOneAndOneToOneRelationsWithPropertyPath(SQLFilter $sqlFilter, QuoteStrategy $quoteStrategy, ClassMetadata $targetEntity, string $targetTableAlias, string $targetEntityPropertyName)

No description

getSubselectQuery(ClassMetadata $targetEntity, string $targetEntityPropertyName)

No description

string
getConstraintStringForSimpleProperty(SQLFilter $sqlFilter, string $propertyPointer, string $operandDefinition = null)

No description

mixed
getValueForOperand(mixed $expression)

Returns the static value of the given operand, this might be also a global object

void
setParameter(SQLFilter $sqlFilter, mixed $name, mixed $value, string $type = null)

No description

mixed
getRawParameterValue(mixed $name)

No description

mixed
getObjectValueByPath(mixed $object, string $path)

Redirects directly to \Neos\Utility\ObjectAccess::getPropertyPath($result, $propertyPath) This is only needed for unit tests!

Details

__construct(string $path)

No description

Parameters

string $path

Property path the currently parsed expression relates to

PropertyConditionGenerator equals(string|array $operandDefinition)

No description

Parameters

string|array $operandDefinition

Return Value

PropertyConditionGenerator

the current instance to allow for method chaining

PropertyConditionGenerator notEquals(string|array $operandDefinition)

No description

Parameters

string|array $operandDefinition

Return Value

PropertyConditionGenerator

the current instance to allow for method chaining

PropertyConditionGenerator lessThan(mixed $operandDefinition)

No description

Parameters

mixed $operandDefinition

Return Value

PropertyConditionGenerator

the current instance to allow for method chaining

PropertyConditionGenerator lessOrEqual(mixed $operandDefinition)

No description

Parameters

mixed $operandDefinition

Return Value

PropertyConditionGenerator

the current instance to allow for method chaining

PropertyConditionGenerator greaterThan(mixed $operandDefinition)

No description

Parameters

mixed $operandDefinition

Return Value

PropertyConditionGenerator

the current instance to allow for method chaining

PropertyConditionGenerator greaterOrEqual(mixed $operandDefinition)

No description

Parameters

mixed $operandDefinition

Return Value

PropertyConditionGenerator

the current instance to allow for method chaining

PropertyConditionGenerator like(mixed $operandDefinition)

No description

Parameters

mixed $operandDefinition

Return Value

PropertyConditionGenerator

the current instance to allow for method chaining

PropertyConditionGenerator in(mixed $operandDefinition)

No description

Parameters

mixed $operandDefinition

Return Value

PropertyConditionGenerator

the current instance to allow for method chaining

Exceptions

InvalidPolicyException

PropertyConditionGenerator contains(mixed $operandDefinition)

No description

Parameters

mixed $operandDefinition

Return Value

PropertyConditionGenerator

Exceptions

InvalidPolicyException

string getSql(SQLFilter $sqlFilter, ClassMetadata $targetEntity, string $targetTableAlias)

No description

Parameters

SQLFilter $sqlFilter
ClassMetadata $targetEntity

Metadata object for the target entity to create the constraint for

string $targetTableAlias

The target table alias used in the current query

Return Value

string

Exceptions

InvalidQueryRewritingConstraintException
Exception

protected string getSqlForPropertyContains(SQLFilter $sqlFilter, QuoteStrategy $quoteStrategy, ClassMetadata $targetEntity, string $targetTableAlias, string $targetEntityPropertyName)

No description

Parameters

SQLFilter $sqlFilter
QuoteStrategy $quoteStrategy
ClassMetadata $targetEntity
string $targetTableAlias
string $targetEntityPropertyName

Return Value

string

Exceptions

InvalidQueryRewritingConstraintException
Exception

protected string getSqlForSimpleProperty(SQLFilter $sqlFilter, QuoteStrategy $quoteStrategy, ClassMetadata $targetEntity, string $targetTableAlias, string $targetEntityPropertyName)

No description

Parameters

SQLFilter $sqlFilter
QuoteStrategy $quoteStrategy
ClassMetadata $targetEntity
string $targetTableAlias
string $targetEntityPropertyName

Return Value

string

Exceptions

InvalidQueryRewritingConstraintException
Exception

protected string getSqlForManyToOneAndOneToOneRelationsWithoutPropertyPath(SQLFilter $sqlFilter, QuoteStrategy $quoteStrategy, ClassMetadata $targetEntity, string $targetTableAlias, string $targetEntityPropertyName)

No description

Parameters

SQLFilter $sqlFilter
QuoteStrategy $quoteStrategy
ClassMetadata $targetEntity
string $targetTableAlias
string $targetEntityPropertyName

Return Value

string

Exceptions

InvalidQueryRewritingConstraintException
Exception

protected string getSqlForManyToOneAndOneToOneRelationsWithPropertyPath(SQLFilter $sqlFilter, QuoteStrategy $quoteStrategy, ClassMetadata $targetEntity, string $targetTableAlias, string $targetEntityPropertyName)

No description

Parameters

SQLFilter $sqlFilter
QuoteStrategy $quoteStrategy
ClassMetadata $targetEntity
string $targetTableAlias
string $targetEntityPropertyName

Return Value

string

Exceptions

InvalidQueryRewritingConstraintException
Exception

protected Query getSubselectQuery(ClassMetadata $targetEntity, string $targetEntityPropertyName)

No description

Parameters

ClassMetadata $targetEntity
string $targetEntityPropertyName

Return Value

Query

protected string getConstraintStringForSimpleProperty(SQLFilter $sqlFilter, string $propertyPointer, string $operandDefinition = null)

No description

Parameters

SQLFilter $sqlFilter
string $propertyPointer
string $operandDefinition

Return Value

string

mixed getValueForOperand(mixed $expression)

Returns the static value of the given operand, this might be also a global object

Parameters

mixed $expression

The expression string representing the operand

Return Value

mixed

The calculated value

protected void setParameter(SQLFilter $sqlFilter, mixed $name, mixed $value, string $type = null)

No description

Parameters

SQLFilter $sqlFilter
mixed $name
mixed $value
string $type

Return Value

void

protected mixed getRawParameterValue(mixed $name)

No description

Parameters

mixed $name

Return Value

mixed

the raw parameter value

mixed getObjectValueByPath(mixed $object, string $path)

Redirects directly to \Neos\Utility\ObjectAccess::getPropertyPath($result, $propertyPath) This is only needed for unit tests!

Parameters

mixed $object

The object to fetch the property from

string $path

The path to the property to be fetched

Return Value

mixed

The property value