CaseInsensitiveQuery
in package
FinalYes
Builds portable case-insensitive conditions for trusted database fields.
SCA-name fields also ignore diacritics. PostgreSQL uses its unaccent dictionary while MySQL relies on the configured accent-insensitive collation.
Table of Contents
Methods
- contains() : array<string, string|ExpressionInterface>
- endsWith() : array<string, string|ExpressionInterface>
- equals() : array<string, string|ExpressionInterface>
- isScaNameField() : bool
- Whether the trusted field identifier represents an SCA name.
- normalize() : string
- Normalize a query value without changing the stored value.
- notEquals() : array<string, string|ExpressionInterface>
- startsWith() : array<string, string|ExpressionInterface>
- fieldExpression() : string
- Build the database-side comparison expression.
- usesPostgres() : bool
- Whether the active tenant connection needs explicit unaccent support.
- valueExpression() : string|ExpressionInterface
- Normalize a value according to the field's comparison behavior.
Methods
contains()
public
static contains(string $field, string $value) : array<string, string|ExpressionInterface>
Parameters
- $field : string
- $value : string
Return values
array<string, string|ExpressionInterface>endsWith()
public
static endsWith(string $field, string $value) : array<string, string|ExpressionInterface>
Parameters
- $field : string
- $value : string
Return values
array<string, string|ExpressionInterface>equals()
public
static equals(string $field, string $value) : array<string, string|ExpressionInterface>
Parameters
- $field : string
- $value : string
Return values
array<string, string|ExpressionInterface>isScaNameField()
Whether the trusted field identifier represents an SCA name.
public
static isScaNameField(string $field) : bool
Parameters
- $field : string
Return values
boolnormalize()
Normalize a query value without changing the stored value.
public
static normalize(string $value) : string
Parameters
- $value : string
Return values
stringnotEquals()
public
static notEquals(string $field, string $value) : array<string, string|ExpressionInterface>
Parameters
- $field : string
- $value : string
Return values
array<string, string|ExpressionInterface>startsWith()
public
static startsWith(string $field, string $value) : array<string, string|ExpressionInterface>
Parameters
- $field : string
- $value : string
Return values
array<string, string|ExpressionInterface>fieldExpression()
Build the database-side comparison expression.
private
static fieldExpression(string $field) : string
Parameters
- $field : string
Return values
stringusesPostgres()
Whether the active tenant connection needs explicit unaccent support.
private
static usesPostgres() : bool
Return values
boolvalueExpression()
Normalize a value according to the field's comparison behavior.
private
static valueExpression(string $field, string $value) : string|ExpressionInterface
Parameters
- $field : string
- $value : string