GenericMetadata
class GenericMetadata implements MetadataInterface
A generic container of {@link Constraint} objects.
This class supports serialization and cloning.
Properties
Constraint[] | $constraints | ||
array | $constraintsByGroup | ||
int | $cascadingStrategy | The strategy for cascading objects. | |
int | $traversalStrategy | The strategy for traversing traversable objects. |
Methods
Returns the names of the properties that should be serialized.
Clones this object.
Adds an list of constraints.
Returns all constraints of this element.
Returns whether this element has any constraints.
Returns all constraints for a given validation group.
Returns the strategy for cascading objects.
Returns the strategy for traversing traversable objects.
Details
at line line 83
string[]
__sleep()
Returns the names of the properties that should be serialized.
at line line 96
__clone()
Clones this object.
at line line 126
GenericMetadata
addConstraint(Constraint $constraint)
Adds a constraint.
If the constraint {@link Valid} is added, the cascading strategy will be changed to {@link CascadingStrategy::CASCADE}. Depending on the $traverse property of that constraint, the traversal strategy will be set to one of the following:
- {@link TraversalStrategy::IMPLICIT} if $traverse is enabled
- {@link TraversalStrategy::NONE} if $traverse is disabled
at line line 164
GenericMetadata
addConstraints(array $constraints)
Adds an list of constraints.
at line line 176
Constraint[]
getConstraints()
Returns all constraints of this element.
at line line 186
bool
hasConstraints()
Returns whether this element has any constraints.
at line line 196
Constraint[]
findConstraints(string $group)
Returns all constraints for a given validation group.
at line line 206
int
getCascadingStrategy()
Returns the strategy for cascading objects.
at line line 214
int
getTraversalStrategy()
Returns the strategy for traversing traversable objects.