MemberMetadata
abstract class MemberMetadata extends GenericMetadata implements PropertyMetadataInterface
Stores all metadata needed for validating a class property.
The method of accessing the property's value must be specified by subclasses by implementing the {@link newReflectionMember()} method.
This class supports serialization and cloning.
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 |
$class | |||
$name | |||
$property |
Methods
Returns the names of the properties that should be serialized.
Returns all constraints for a given validation group.
Returns the strategy for traversing traversable objects.
No description
Returns the name of the member.
{@inheritdoc}
Returns the name of the property.
Returns whether this member is public.
Returns whether this member is protected.
Returns whether this member is private.
Returns the reflection instance for accessing the member's value.
Creates a new reflection instance for accessing the member's value.
Details
$this
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
ReflectionMethod|ReflectionProperty
getReflectionMember(object|string $objectOrClassName)
Returns the reflection instance for accessing the member's value.
abstract protected ReflectionMethod|ReflectionProperty
newReflectionMember(object|string $objectOrClassName)
Creates a new reflection instance for accessing the member's value.
Must be implemented by subclasses.