Symfony2 API
Class

Symfony\Component\Validator\Mapping\ElementMetadata

abstract class ElementMetadata

Properties

Constraint[] $constraints
array $constraintsByGroup

Methods

array __sleep()

Returns the names of the properties that should be serialized.

__clone()

Clones this object.

ElementMetadata addConstraint(Constraint $constraint)

Adds a constraint to this element.

Constraint[] getConstraints()

Returns all constraints of this element.

Boolean hasConstraints()

Returns whether this element has any constraints.

array findConstraints(string $group)

Returns the constraints of the given group and global ones (* group).

Details

at line 33
public array __sleep()

Returns the names of the properties that should be serialized.

Return Value

array

at line 44
public __clone()

Clones this object.

at line 63
public ElementMetadata addConstraint(Constraint $constraint)

Adds a constraint to this element.

Parameters

Constraint $constraint

Return Value

ElementMetadata

at line 79
public Constraint[] getConstraints()

Returns all constraints of this element.

Return Value

Constraint[] An array of Constraint instances

at line 89
public Boolean hasConstraints()

Returns whether this element has any constraints.

Return Value

Boolean

at line 101
public array findConstraints(string $group)

Returns the constraints of the given group and global ones (* group).

Parameters

string $group The group name

Return Value

array An array with all Constraint instances belonging to the group