ElementMetadata deprecated
class ElementMetadata extends GenericMetadata
deprecated
Contains the metadata of a structural element.
Properties
Constraint[] | $constraints | from GenericMetadata | |
array | $constraintsByGroup | from GenericMetadata | |
int | $cascadingStrategy | The strategy for cascading objects. | from GenericMetadata |
int | $traversalStrategy | The strategy for traversing traversable objects. | from GenericMetadata |
Methods
Returns the names of the properties that should be serialized.
Adds an list of constraints.
Returns all constraints for a given validation group.
Returns the strategy for traversing traversable objects.
Exists for compatibility with the deprecated {@link Symfony\Component\Validator\MetadataInterface}.
No description
Details
in GenericMetadata at line line 85
string[]
__sleep()
Returns the names of the properties that should be serialized.
in GenericMetadata at line line 98
__clone()
Clones this object.
in GenericMetadata at line line 131
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 properties $traverse and $deep of that constraint, the traversal strategy will be set to one of the following:
- {@link TraversalStrategy::IMPLICIT} if $traverse is enabled and $deep is enabled
- {@link TraversalStrategy::IMPLICIT} | {@link TraversalStrategy::STOP_RECURSION} if $traverse is enabled, but $deep is disabled
- {@link TraversalStrategy::NONE} if $traverse is disabled
in GenericMetadata at line line 174
GenericMetadata
addConstraints(array $constraints)
Adds an list of constraints.
in GenericMetadata at line line 186
Constraint[]
getConstraints()
Returns all constraints of this element.
in GenericMetadata at line line 196
bool
hasConstraints()
Returns whether this element has any constraints.
in GenericMetadata at line line 206
Constraint[]
findConstraints(string $group)
Returns all constraints for a given validation group.
in GenericMetadata at line line 216
int
getCascadingStrategy()
Returns the strategy for cascading objects.
in GenericMetadata at line line 224
int
getTraversalStrategy()
Returns the strategy for traversing traversable objects.
in GenericMetadata at line line 241
accept(ValidationVisitorInterface $visitor, mixed $value, string|string[] $group, string $propertyPath)
deprecated
deprecated
Exists for compatibility with the deprecated {@link Symfony\Component\Validator\MetadataInterface}.
Should not be used.
Implemented for backward compatibility with Symfony < 2.5.