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
Methods
- 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>getCascadingStrategy()
Returns the strategy for cascading objects.
public
getCascadingStrategy() : int
Tags
Return values
intgetClassName()
Returns the name of the backing PHP class.
public
getClassName() : string
Return values
stringgetConstrainedProperties()
Returns the names of all constrained properties.
public
getConstrainedProperties() : array<string|int, string>
Return values
array<string|int, string>getConstraints()
Returns all constraints of this element.
public
getConstraints() : array<string|int, Constraint>
Return values
array<string|int, Constraint>getGroupSequence()
Returns the group sequence that overrides the "Default" group for this class.
public
getGroupSequence() : GroupSequence|null
Return values
GroupSequence|nullgetPropertyMetadata()
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>getTraversalStrategy()
Returns the strategy for traversing traversable objects.
public
getTraversalStrategy() : int
Tags
Return values
inthasGroupSequence()
Returns whether the "Default" group is overridden by a group sequence.
public
hasGroupSequence() : bool
Return values
boolhasPropertyMetadata()
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
boolisGroupSequenceProvider()
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.