GenericMetadata
in package
implements
MetadataInterface
A generic container of {@link Constraint} objects.
This class supports serialization and cloning.
Tags
Table of Contents
Interfaces
- MetadataInterface
- A container for validation metadata.
Methods
- __clone() : mixed
- Clones this object.
- __sleep() : array<string|int, string>
- Returns the names of the properties that should be serialized.
- addConstraint() : $this
- Adds a constraint.
- addConstraints() : $this
- Adds an list of constraints.
- findConstraints() : array<string|int, Constraint>
- Returns all constraints for a given validation group.
- getAutoMappingStrategy() : int
- getCascadingStrategy() : int
- Returns the strategy for cascading objects.
- getConstraints() : array<string|int, Constraint>
- Returns all constraints of this element.
- getTraversalStrategy() : int
- Returns the strategy for traversing traversable objects.
- hasConstraints() : bool
- Returns whether this element has any constraints.
Methods
__clone()
Clones this object.
public
__clone() : mixed
__sleep()
Returns the names of the properties that should be serialized.
public
__sleep() : array<string|int, string>
Return values
array<string|int, string>addConstraint()
Adds a constraint.
public
addConstraint(Constraint $constraint) : $this
If the constraint is added, the cascading strategy will be changed to . Depending on the $traverse property of that constraint, the traversal strategy will be set to one of the following:
Parameters
- $constraint : Constraint
Tags
Return values
$thisaddConstraints()
Adds an list of constraints.
public
addConstraints(array<string|int, Constraint> $constraints) : $this
Parameters
- $constraints : array<string|int, Constraint>
-
The constraints to add
Return values
$thisfindConstraints()
Returns all constraints for a given validation group.
public
findConstraints(string $group) : array<string|int, Constraint>
Aware of the global group (* group).
Parameters
- $group : string
-
The validation group
Return values
array<string|int, Constraint>getAutoMappingStrategy()
public
getAutoMappingStrategy() : int
Tags
Return values
intgetCascadingStrategy()
Returns the strategy for cascading objects.
public
getCascadingStrategy() : int
Return values
intgetConstraints()
Returns all constraints of this element.
public
getConstraints() : array<string|int, Constraint>
Return values
array<string|int, Constraint>getTraversalStrategy()
Returns the strategy for traversing traversable objects.
public
getTraversalStrategy() : int
Return values
inthasConstraints()
Returns whether this element has any constraints.
public
hasConstraints() : bool