PrecomputedPresenceVerifier
final class PrecomputedPresenceVerifier implements DatabasePresenceVerifierInterface
Return database-proven presence facts from batched queries.
Lookups and fallback memoization are scoped to one validation execution and keyed by the complete database query shape. Unknown probes delegate to the original verifier, preserving ordinary validation semantics.
Methods
Build a key for the complete database query shape.
Register database-proven facts for one query shape.
Count the number of objects in a collection having the given value.
Count the number of objects in a collection with the given values.
Set the connection to be used.
Determine if any lookups have been registered.
Build a key for the PDO binding identity of a supported presence value.
Normalize a supported presence value for lookup comparisons.
Details
at line 33
__construct(DatabasePresenceVerifierInterface $fallback)
No description
at line 41
static string|null
lookupKey(string|null $connection, string $collection, string $column, int|string|null $excludeId = null, string|null $idColumn = null, array $extra = [])
Build a key for the complete database query shape.
at line 82
void
addLookup(string $lookupKey, array $exactHits, array $knownPresent, array $provenAbsent, bool $stageOneSingleChunk)
Register database-proven facts for one query shape.
at line 102
int
getCount(string $collection, string $column, mixed $value, int|string|null $excludeId = null, string|null $idColumn = null, array $extra = [])
Count the number of objects in a collection having the given value.
at line 143
int
getMultiCount(string $collection, string $column, array $values, array $extra = [])
Count the number of objects in a collection with the given values.
at line 197
void
setConnection(string|null $connection)
Set the connection to be used.
at line 206
bool
hasLookups()
Determine if any lookups have been registered.
at line 217
static string|null
bindingKey(mixed $value)
Build a key for the PDO binding identity of a supported presence value.
The one-character prefix preserves integer/string PDO binding identity and prevents PHP from coercing numeric-string array keys to integers.
at line 229
static string|null
normalizeValue(mixed $value)
Normalize a supported presence value for lookup comparisons.