DataValidator
class DataValidator
Methods
Create a data validator.
Determine whether validation applies to the root source list.
Authorize the root Request before named creation can finish the object.
Compile validation for a filled root collection.
Validate and replace the state with its filtered payload.
Restore surviving payload keys to their source insertion order.
Apply operation-scoped validator hooks.
Apply class-owned validation failure configuration.
Resolve the effective stop-on-first-failure setting.
Resolve a method-over-attribute string setting.
Details
at line 30
__construct(Container $container, Factory $validationFactory, DataClassRepository $dataClasses, DataValidationCompiler $compiler)
Create a data validator.
at line 43
bool
shouldValidate(CreationContext $context, array $payloads)
Determine whether validation applies to the root source list.
at line 58
Request|null
authorize(string $class, array $payloads)
Authorize the root Request before named creation can finish the object.
at line 92
CompiledValidation
compile(ConstructionState $state)
Compile validation for a filled construction state.
at line 102
CompiledValidation
compileCollection(ConstructionState $state, string $dataClass)
Compile validation for a filled root collection.
at line 114
void
validate(ConstructionState $state, CompiledValidation $compiled, Request|null $request = null, string|null $class = null)
Validate and replace the state with its filtered payload.
at line 186
protected array
restoreSourceKeyOrder(array $payload, array $sourcePayload)
Restore surviving payload keys to their source insertion order.
at line 213
protected void
configureValidator(Validator $validator, ConstructionState $state, DataClass $dataClass)
Apply operation-scoped validator hooks.
at line 264
protected void
configureValidationException(ValidationException $exception, DataClass $dataClass)
Apply class-owned validation failure configuration.
at line 307
protected bool
resolveStopOnFirstFailure(DataClass $dataClass)
Resolve the effective stop-on-first-failure setting.
at line 331
protected string|null
resolveStringLifecycleSetting(DataClass $dataClass, string $method, string|null $attributeValue)
Resolve a method-over-attribute string setting.
at line 361
protected Request|null
request(array $payloads)
Find the first Request in the root source list.