Symfony2 API
Class

Symfony\Component\Validator\Mapping\MemberMetadata

abstract class MemberMetadata extends ElementMetadata implements PropertyMetadataInterface, ClassBasedInterface

Properties

$class
$name
$property
$cascaded
$collectionCascaded
$collectionCascadedDeeply

Methods

__construct(string $class, string $name, string $property)

Constructor.

accept(ValidationVisitorInterface $visitor, mixed $value, string|string[] $group, string $propertyPath, $propagatedGroup = null)

Implementation of the Visitor design pattern.

ElementMetadata addConstraint(Constraint $constraint)

Adds a constraint to this element.

array __sleep()

Returns the names of the properties that should be serialized.

string getName()

Returns the name of the member

string getClassName()

Returns the name of the backing PHP class.

string getPropertyName()

Returns the name of the property.

Boolean isPublic(object|string $objectOrClassName)

Returns whether this member is public

Boolean isProtected(object|string $objectOrClassName)

Returns whether this member is protected

Boolean isPrivate(object|string $objectOrClassName)

Returns whether this member is private

Boolean isCascaded()

Returns whether objects stored in this member should be validated

Boolean isCollectionCascaded()

Returns whether arrays or traversable objects stored in this member should be traversed and validated in each entry

Boolean isCollectionCascadedDeeply()

Returns whether arrays or traversable objects stored in this member should be traversed recursively for inner arrays/traversable objects

object getReflectionMember(object|string $objectOrClassName)

Returns the Reflection instance of the member

Details

at line 38
public __construct(string $class, string $name, string $property)

Constructor.

Parameters

string $class The name of the class this member is defined on
string $name The name of the member
string $property The property the member belongs to

at line 45
public accept(ValidationVisitorInterface $visitor, mixed $value, string|string[] $group, string $propertyPath, $propagatedGroup = null)

Implementation of the Visitor design pattern.

Calls {@link ValidationVisitorInterface::visit} and then forwards the
<tt>accept()</tt>-call to all property metadata instances.

Parameters

ValidationVisitorInterface $visitor The visitor implementing the validation logic.
mixed $value The value to validate.
string|string[] $group The validation group to validate in.
string $propertyPath The current property path in the validation graph.
$propagatedGroup

at line 57
public ElementMetadata addConstraint(Constraint $constraint)

Adds a constraint to this element.

Parameters

Constraint $constraint

Return Value

ElementMetadata

at line 83
public array __sleep()

Returns the names of the properties that should be serialized.

Return Value

array

at line 98
public string getName()

Returns the name of the member

Return Value

string

at line 108
public string getClassName()

Returns the name of the backing PHP class.

Return Value

string The name of the backing class.

at line 118
public string getPropertyName()

Returns the name of the property.

Return Value

string The property name

at line 130
public Boolean isPublic(object|string $objectOrClassName)

Returns whether this member is public

Parameters

object|string $objectOrClassName The object or the class name

Return Value

Boolean

at line 142
public Boolean isProtected(object|string $objectOrClassName)

Returns whether this member is protected

Parameters

object|string $objectOrClassName The object or the class name

Return Value

Boolean

at line 154
public Boolean isPrivate(object|string $objectOrClassName)

Returns whether this member is private

Parameters

object|string $objectOrClassName The object or the class name

Return Value

Boolean

at line 164
public Boolean isCascaded()

Returns whether objects stored in this member should be validated

Return Value

Boolean

at line 175
public Boolean isCollectionCascaded()

Returns whether arrays or traversable objects stored in this member should be traversed and validated in each entry

Return Value

Boolean

at line 186
public Boolean isCollectionCascadedDeeply()

Returns whether arrays or traversable objects stored in this member should be traversed recursively for inner arrays/traversable objects

Return Value

Boolean

at line 198
public object getReflectionMember(object|string $objectOrClassName)

Returns the Reflection instance of the member

Parameters

object|string $objectOrClassName The object or the class name

Return Value

object