Chris@0: Chris@0: * Chris@0: * For the full copyright and license information, please view the LICENSE Chris@0: * file that was distributed with this source code. Chris@0: */ Chris@0: Chris@0: namespace Symfony\Component\Validator\Validator; Chris@0: Chris@0: use Symfony\Component\Validator\Constraint; Chris@17: use Symfony\Component\Validator\Constraints\GroupSequence; Chris@0: use Symfony\Component\Validator\ConstraintViolationListInterface; Chris@0: Chris@0: /** Chris@0: * A validator in a specific execution context. Chris@0: * Chris@0: * @author Bernhard Schussek Chris@0: */ Chris@0: interface ContextualValidatorInterface Chris@0: { Chris@0: /** Chris@0: * Appends the given path to the property path of the context. Chris@0: * Chris@0: * If called multiple times, the path will always be reset to the context's Chris@0: * original path with the given path appended to it. Chris@0: * Chris@0: * @param string $path The path to append Chris@0: * Chris@0: * @return $this Chris@0: */ Chris@0: public function atPath($path); Chris@0: Chris@0: /** Chris@0: * Validates a value against a constraint or a list of constraints. Chris@0: * Chris@0: * If no constraint is passed, the constraint Chris@0: * {@link \Symfony\Component\Validator\Constraints\Valid} is assumed. Chris@0: * Chris@17: * @param mixed $value The value to validate Chris@17: * @param Constraint|Constraint[] $constraints The constraint(s) to validate against Chris@17: * @param string|GroupSequence|(string|GroupSequence)[]|null $groups The validation groups to validate. If none is given, "Default" is assumed Chris@0: * Chris@0: * @return $this Chris@0: */ Chris@0: public function validate($value, $constraints = null, $groups = null); Chris@0: Chris@0: /** Chris@0: * Validates a property of an object against the constraints specified Chris@0: * for this property. Chris@0: * Chris@17: * @param object $object The object Chris@17: * @param string $propertyName The name of the validated property Chris@17: * @param string|GroupSequence|(string|GroupSequence)[]|null $groups The validation groups to validate. If none is given, "Default" is assumed Chris@0: * Chris@0: * @return $this Chris@0: */ Chris@0: public function validateProperty($object, $propertyName, $groups = null); Chris@0: Chris@0: /** Chris@0: * Validates a value against the constraints specified for an object's Chris@0: * property. Chris@0: * Chris@17: * @param object|string $objectOrClass The object or its class name Chris@17: * @param string $propertyName The name of the property Chris@17: * @param mixed $value The value to validate against the property's constraints Chris@17: * @param string|GroupSequence|(string|GroupSequence)[]|null $groups The validation groups to validate. If none is given, "Default" is assumed Chris@0: * Chris@0: * @return $this Chris@0: */ Chris@0: public function validatePropertyValue($objectOrClass, $propertyName, $value, $groups = null); Chris@0: Chris@0: /** Chris@0: * Returns the violations that have been generated so far in the context Chris@0: * of the validator. Chris@0: * Chris@0: * @return ConstraintViolationListInterface The constraint violations Chris@0: */ Chris@0: public function getViolations(); Chris@0: }