ClassMetadataInterface
extends
MetadataInterface
in
Stores all metadata needed for validating objects of specific class.
Most importantly, the metadata stores the constraints against which an object and its properties should be validated.
Additionally, the metadata stores whether the "Default" group is overridden by a group sequence for that class and whether instances of that class should be traversed or not.
Tags
Table of Contents
- findConstraints() : array<string|int, Constraint>
- Returns all constraints for a given validation group.
- getCascadingStrategy() : int
- Returns the strategy for cascading objects.
- getClassName() : string
- Returns the name of the backing PHP class.
- getConstrainedProperties() : array<string|int, string>
- Returns the names of all constrained properties.
- getConstraints() : array<string|int, Constraint>
- Returns all constraints of this element.
- getGroupSequence() : GroupSequence|null
- Returns the group sequence that overrides the "Default" group for this class.
- getPropertyMetadata() : array<string|int, PropertyMetadataInterface>
- Returns all metadata instances for the given named property.
- getTraversalStrategy() : int
- Returns the strategy for traversing traversable objects.
- hasGroupSequence() : bool
- Returns whether the "Default" group is overridden by a group sequence.
- hasPropertyMetadata() : bool
- Check if there's any metadata attached to the given named property.
- isGroupSequenceProvider() : bool
- Returns whether the "Default" group is overridden by a dynamic group sequence obtained by the validated objects.
Methods
findConstraints()
Returns all constraints for a given validation group.
public
findConstraints(string $group) : array<string|int, Constraint>
Parameters
- $group : string
-
The validation group
Return values
array<string|int, Constraint> —A list of constraint instances
getCascadingStrategy()
Returns the strategy for cascading objects.
public
getCascadingStrategy() : int
Tags
Return values
int —The cascading strategy
getClassName()
Returns the name of the backing PHP class.
public
getClassName() : string
Return values
string —The name of the backing class
getConstrainedProperties()
Returns the names of all constrained properties.
public
getConstrainedProperties() : array<string|int, string>
Return values
array<string|int, string> —A list of property names
getConstraints()
Returns all constraints of this element.
public
getConstraints() : array<string|int, Constraint>
Return values
array<string|int, Constraint> —A list of Constraint instances
getGroupSequence()
Returns the group sequence that overrides the "Default" group for this class.
public
getGroupSequence() : GroupSequence|null
Tags
Return values
GroupSequence|null —The group sequence or null
getPropertyMetadata()
Returns all metadata instances for the given named property.
public
getPropertyMetadata(string $property) : array<string|int, PropertyMetadataInterface>
If your implementation does not support properties, throw an exception in this method (for example a BadMethodCallException).
Parameters
- $property : string
-
The property name
Return values
array<string|int, PropertyMetadataInterface> —A list of metadata instances. Empty if no metadata exists for the property.
getTraversalStrategy()
Returns the strategy for traversing traversable objects.
public
getTraversalStrategy() : int
Tags
Return values
int —The traversal strategy
hasGroupSequence()
Returns whether the "Default" group is overridden by a group sequence.
public
hasGroupSequence() : bool
Tags
Return values
bool —Returns true if the "Default" group is overridden
hasPropertyMetadata()
Check if there's any metadata attached to the given named property.
public
hasPropertyMetadata(string $property) : bool
Parameters
- $property : string
-
The property name
Return values
bool —isGroupSequenceProvider()
Returns whether the "Default" group is overridden by a dynamic group sequence obtained by the validated objects.
public
isGroupSequenceProvider() : bool
If this method returns true, the class must implement . This interface will be used to obtain the group sequence when an object of this class is validated.
Tags
Return values
bool —Returns true if the "Default" group is overridden by a dynamic group sequence