ValidationData
in package
Table of Contents
- extractDataFromPath() : array<string|int, mixed>
- Extract data based on the given dot-notated path.
- getLeadingExplicitAttributePath() : string
- Get the explicit part of the attribute name.
- initializeAndGatherData() : mixed
- extractValuesForWildcards() : array<string|int, mixed>
- Get all of the exact attribute values for a given wildcard attribute.
- initializeAttributeOnData() : array<string|int, mixed>
- Gather a copy of the attribute data filled with any missing attributes.
Methods
extractDataFromPath()
Extract data based on the given dot-notated path.
public
static extractDataFromPath(string $attribute, array<string|int, mixed> $masterData) : array<string|int, mixed>
Used to extract a sub-section of the data for faster iteration.
Parameters
- $attribute : string
- $masterData : array<string|int, mixed>
Return values
array<string|int, mixed> —getLeadingExplicitAttributePath()
Get the explicit part of the attribute name.
public
static getLeadingExplicitAttributePath(string $attribute) : string
E.g. 'foo.bar.*.baz' -> 'foo.bar'
Allows us to not spin through all of the flattened data for some operations.
Parameters
- $attribute : string
Return values
string —initializeAndGatherData()
public
static initializeAndGatherData(mixed $attribute, mixed $masterData) : mixed
Parameters
- $attribute : mixed
- $masterData : mixed
Return values
mixed —extractValuesForWildcards()
Get all of the exact attribute values for a given wildcard attribute.
protected
static extractValuesForWildcards(array<string|int, mixed> $masterData, array<string|int, mixed> $data, string $attribute) : array<string|int, mixed>
Parameters
- $masterData : array<string|int, mixed>
- $data : array<string|int, mixed>
- $attribute : string
Return values
array<string|int, mixed> —initializeAttributeOnData()
Gather a copy of the attribute data filled with any missing attributes.
protected
static initializeAttributeOnData(string $attribute, array<string|int, mixed> $masterData) : array<string|int, mixed>
Parameters
- $attribute : string
- $masterData : array<string|int, mixed>