class ClassMetadata extends ElementMetadata
Represents all the configured constraints on a given class.
Properties
| $constraints | ||
| $constraintsByGroup | ||
| $name | ||
| $defaultGroup | ||
| $members | ||
| $properties | ||
| $getters | ||
| $groupSequence |
Methods
| array |
__sleep()
Returns the names of the properties that should be serialized. |
|
|
__clone()
Clones this object. |
from ElementMetadata | |
|
addConstraint(Constraint $constraint)
Adds a constraint to this element. |
||
| array |
getConstraints()
Returns all constraints of this element. |
from ElementMetadata |
| Boolean |
hasConstraints()
Returns whether this element has any constraints. |
from ElementMetadata |
| array |
findConstraints(string $group)
Returns the constraints of the given group and global ones (* group). |
from ElementMetadata |
|
__construct(string $class)
Constructs a metadata for the given class |
||
| string |
getClassName()
Returns the fully qualified name of the class |
|
| string |
getDefaultGroup()
Returns the name of the default group for this class |
|
| ClassMetadata |
addPropertyConstraint(string $property, Constraint $constraint)
Adds a constraint to the given property. |
|
| ClassMetadata |
addGetterConstraint(string $property, Constraint $constraint)
Adds a constraint to the getter of the given property. |
|
|
mergeConstraints(ClassMetadata $source)
Merges the constraints of the given metadata into this object. |
||
| Boolean |
hasMemberMetadatas(string $property)
Returns true if metadatas of members is present for the given property. |
|
| array |
getMemberMetadatas(string $property)
Returns all metadatas of members describing the given property |
|
| array |
getConstrainedProperties()
Returns all properties for which constraints are defined. |
|
|
setGroupSequence(array $groups)
Sets the default group sequence for this class. |
||
| Boolean |
hasGroupSequence()
Returns whether this class has an overridden default group sequence. |
|
| array |
getGroupSequence()
Returns the default group sequence for this class. |
|
| ReflectionClass |
getReflectionClass()
Returns a ReflectionClass instance for this class. |
Details
at line 55
public array
__sleep()
Returns the names of the properties that should be serialized.
in ElementMetadata at line 37
public
__clone()
Clones this object.
at line 100
public
addConstraint(Constraint $constraint)
Adds a constraint to this element.
in ElementMetadata at line 70
public array
getConstraints()
Returns all constraints of this element.
in ElementMetadata at line 80
public Boolean
hasConstraints()
Returns whether this element has any constraints.
in ElementMetadata at line 92
public array
findConstraints(string $group)
Returns the constraints of the given group and global ones (* group).
at line 39
public
__construct(string $class)
Constructs a metadata for the given class
at line 72
public string
getClassName()
Returns the fully qualified name of the class
at line 92
public string
getDefaultGroup()
Returns the name of the default group for this class
For each class, the group "Default" is an alias for the group
"<ClassName>", where <ClassName> is the non-namespaced name of the
class. All constraints implicitly or explicitly assigned to group
"Default" belong to both of these groups, unless the class defines
a group sequence.
If a class defines a group sequence, validating the class in "Default"
will validate the group sequence. The constraints assigned to "Default"
can still be validated by validating the class in "<ClassName>".
at line 122
public ClassMetadata
addPropertyConstraint(string $property, Constraint $constraint)
Adds a constraint to the given property.
at line 148
public ClassMetadata
addGetterConstraint(string $property, Constraint $constraint)
Adds a constraint to the getter of the given property.
The name of the getter is assumed to be the name of the property with an
uppercased first letter and either the prefix "get" or "is".
at line 168
public
mergeConstraints(ClassMetadata $source)
Merges the constraints of the given metadata into this object.
at line 216
public Boolean
hasMemberMetadatas(string $property)
Returns true if metadatas of members is present for the given property.
at line 228
public array
getMemberMetadatas(string $property)
Returns all metadatas of members describing the given property
at line 238
public array
getConstrainedProperties()
Returns all properties for which constraints are defined.
at line 248
public
setGroupSequence(array $groups)
Sets the default group sequence for this class.
at line 268
public Boolean
hasGroupSequence()
Returns whether this class has an overridden default group sequence.
at line 278
public array
getGroupSequence()
Returns the default group sequence for this class.
at line 288
public ReflectionClass
getReflectionClass()
Returns a ReflectionClass instance for this class.