Documentation

ClassMetadataInterface extends MetadataInterface

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
author

Bernhard Schussek bschussek@gmail.com

see
MetadataInterface
see
GroupSequence
see
GroupSequenceProviderInterface
see
TraversalStrategy

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>

getClassName()

Returns the name of the backing PHP class.

public getClassName() : string
Return values
string

getConstrainedProperties()

Returns the names of all constrained properties.

public getConstrainedProperties() : array<string|int, string>
Return values
array<string|int, string>

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>

hasGroupSequence()

Returns whether the "Default" group is overridden by a group sequence.

public hasGroupSequence() : bool

If it is, you can access the group sequence with .

Return values
bool

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.

Return values
bool

        
On this page

Search results