MemberMetadata
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 |
string | $class | ||
string | $name | ||
string | $property |
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.
Constructor.
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.
Details
at line line 97
string[]
__sleep()
Returns the names of the properties that should be serialized.
in GenericMetadata at line line 96
__clone()
Clones this object.
at line line 80
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
in GenericMetadata at line line 164
GenericMetadata
addConstraints(array $constraints)
Adds an list of constraints.
in GenericMetadata at line line 176
Constraint[]
getConstraints()
Returns all constraints of this element.
in GenericMetadata at line line 186
bool
hasConstraints()
Returns whether this element has any constraints.
in GenericMetadata at line line 196
Constraint[]
findConstraints(string $group)
Returns all constraints for a given validation group.
in GenericMetadata at line line 206
int
getCascadingStrategy()
Returns the strategy for cascading objects.
in GenericMetadata at line line 214
int
getTraversalStrategy()
Returns the strategy for traversing traversable objects.
at line line 70
__construct(string $class, string $name, string $property)
Constructor.
at line line 111
string
getName()
Returns the name of the member.
at line line 119
getClassName()
{@inheritdoc}
at line line 127
string
getPropertyName()
Returns the name of the property.
at line line 139
bool
isPublic(object|string $objectOrClassName)
Returns whether this member is public.
at line line 151
bool
isProtected(object|string $objectOrClassName)
Returns whether this member is protected.
at line line 163
bool
isPrivate(object|string $objectOrClassName)
Returns whether this member is private.
at line line 175
ReflectionMethod|ReflectionProperty
getReflectionMember(object|string $objectOrClassName)
Returns the reflection instance for accessing the member's value.