use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\Exception\ConstraintDefinitionException;
-use Symfony\Component\Validator\ValidationVisitorInterface;
/**
* Stores all metadata needed for validating a class property.
*
* @see PropertyMetadataInterface
*/
-abstract class MemberMetadata extends ElementMetadata implements PropertyMetadataInterface
+abstract class MemberMetadata extends GenericMetadata implements PropertyMetadataInterface
{
/**
- * @var string
- *
* @internal This property is public in order to reduce the size of the
* class' serialized representation. Do not access it. Use
* {@link getClassName()} instead.
public $class;
/**
- * @var string
- *
* @internal This property is public in order to reduce the size of the
* class' serialized representation. Do not access it. Use
* {@link getName()} instead.
public $name;
/**
- * @var string
- *
* @internal This property is public in order to reduce the size of the
* class' serialized representation. Do not access it. Use
* {@link getPropertyName()} instead.
private $reflMember = array();
/**
- * Constructor.
- *
* @param string $class The name of the class this member is defined on
* @param string $name The name of the member
* @param string $property The property the member belongs to
$this->property = $property;
}
- /**
- * {@inheritdoc}
- *
- * @deprecated since version 2.5, to be removed in 3.0.
- */
- public function accept(ValidationVisitorInterface $visitor, $value, $group, $propertyPath, $propagatedGroup = null)
- {
- @trigger_error('The '.__METHOD__.' method is deprecated since version 2.5 and will be removed in 3.0.', E_USER_DEPRECATED);
-
- $visitor->visit($this, $value, $group, $propertyPath);
-
- if ($this->isCascaded()) {
- $visitor->validate($value, $propagatedGroup ?: $group, $propertyPath, $this->isCollectionCascaded(), $this->isCollectionCascadedDeeply());
- }
- }
-
/**
* {@inheritdoc}
*/
return $this->getReflectionMember($objectOrClassName)->isPrivate();
}
- /**
- * Returns whether objects stored in this member should be validated.
- *
- * @return bool
- *
- * @deprecated since version 2.5, to be removed in 3.0.
- * Use {@link getCascadingStrategy()} instead.
- */
- public function isCascaded()
- {
- @trigger_error('The '.__METHOD__.' method is deprecated since version 2.5 and will be removed in 3.0. Use the getCascadingStrategy() method instead.', E_USER_DEPRECATED);
-
- return (bool) ($this->cascadingStrategy & CascadingStrategy::CASCADE);
- }
-
- /**
- * Returns whether arrays or traversable objects stored in this member
- * should be traversed and validated in each entry.
- *
- * @return bool
- *
- * @deprecated since version 2.5, to be removed in 3.0.
- * Use {@link getTraversalStrategy()} instead.
- */
- public function isCollectionCascaded()
- {
- @trigger_error('The '.__METHOD__.' method is deprecated since version 2.5 and will be removed in 3.0. Use the getTraversalStrategy() method instead.', E_USER_DEPRECATED);
-
- return (bool) ($this->traversalStrategy & (TraversalStrategy::IMPLICIT | TraversalStrategy::TRAVERSE));
- }
-
- /**
- * Returns whether arrays or traversable objects stored in this member
- * should be traversed recursively for inner arrays/traversable objects.
- *
- * @return bool
- *
- * @deprecated since version 2.5, to be removed in 3.0.
- * Use {@link getTraversalStrategy()} instead.
- */
- public function isCollectionCascadedDeeply()
- {
- @trigger_error('The '.__METHOD__.' method is deprecated since version 2.5 and will be removed in 3.0. Use the getTraversalStrategy() method instead.', E_USER_DEPRECATED);
-
- return !($this->traversalStrategy & TraversalStrategy::STOP_RECURSION);
- }
-
/**
* Returns the reflection instance for accessing the member's value.
*