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 32
__construct(Container $container, Factory $validationFactory, DataClassRepository $dataClasses, DataValidationCompiler $compiler)
Create a data validator.
at line 45
bool
shouldValidate(CreationContext $context, array $payloads)
Determine whether validation applies to the root source list.
at line 60
Request|null
authorize(string $class, array $payloads)
Authorize the root Request before named creation can finish the object.
at line 94
CompiledValidation
compile(ConstructionState $state)
Compile validation for a filled construction state.
at line 104
CompiledValidation
compileCollection(ConstructionState $state, string $dataClass)
Compile validation for a filled root collection.
at line 116
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 198
protected array
restoreSourceKeyOrder(array $payload, array $sourcePayload)
Restore surviving payload keys to their source insertion order.
at line 225
protected void
configureValidator(Validator $validator, ConstructionState $state, DataClass $dataClass)
Apply operation-scoped validator hooks.
at line 276
protected void
configureValidationException(ValidationException $exception, DataClass $dataClass)
Apply class-owned validation failure configuration.
at line 319
protected bool
resolveStopOnFirstFailure(DataClass $dataClass)
Resolve the effective stop-on-first-failure setting.
at line 341
protected string|null
resolveStringLifecycleSetting(DataClass $dataClass, string $method, string|null $attributeValue)
Resolve a method-over-attribute string setting.
at line 369
protected Request|null
request(array $payloads)
Find the first Request in the root source list.