2010-06-24 09:40:05 +01:00
|
|
|
<?php
|
|
|
|
|
2010-10-02 11:42:31 +01:00
|
|
|
/*
|
2011-01-15 13:29:43 +00:00
|
|
|
* This file is part of the Symfony package.
|
2010-10-02 11:42:31 +01:00
|
|
|
*
|
|
|
|
* (c) Fabien Potencier <fabien.potencier@symfony-project.com>
|
|
|
|
*
|
2011-01-15 13:29:43 +00:00
|
|
|
* For the full copyright and license information, please view the LICENSE
|
|
|
|
* file that was distributed with this source code.
|
2010-10-02 11:42:31 +01:00
|
|
|
*/
|
|
|
|
|
2011-01-15 13:29:43 +00:00
|
|
|
namespace Symfony\Component\Validator;
|
|
|
|
|
2010-08-20 22:09:55 +01:00
|
|
|
use Symfony\Component\Validator\Constraint;
|
2010-06-24 09:40:05 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Validates a given value.
|
|
|
|
*
|
2010-10-15 22:49:09 +01:00
|
|
|
* @author Bernhard Schussek <bernhard.schussek@symfony-project.com>
|
2010-06-24 09:40:05 +01:00
|
|
|
*/
|
|
|
|
interface ValidatorInterface
|
|
|
|
{
|
2011-01-16 04:41:23 +00:00
|
|
|
/**
|
|
|
|
* Validate the given object.
|
|
|
|
*
|
|
|
|
* @param object $object The object to validate
|
|
|
|
* @param array|null $groups The validator groups to use for validating
|
|
|
|
* @return ConstraintViolationList
|
|
|
|
*/
|
2010-10-15 22:49:09 +01:00
|
|
|
function validate($object, $groups = null);
|
2010-06-24 09:40:05 +01:00
|
|
|
|
2011-01-16 04:41:23 +00:00
|
|
|
/**
|
|
|
|
* Validate a single property of an object against its current value.
|
|
|
|
*
|
|
|
|
* @param object $object The object to validate
|
|
|
|
* @param string $property The name of the property to validate
|
|
|
|
* @param array|null $groups The validator groups to use for validating
|
|
|
|
* @return ConstraintViolationList
|
|
|
|
*/
|
2010-10-15 22:49:09 +01:00
|
|
|
function validateProperty($object, $property, $groups = null);
|
2010-06-24 09:40:05 +01:00
|
|
|
|
2011-01-16 04:41:23 +00:00
|
|
|
/**
|
|
|
|
* Validate a single property of an object against the given value.
|
|
|
|
*
|
|
|
|
* @param string $class The class on which the property belongs
|
|
|
|
* @param string $property The name of the property to validate
|
|
|
|
* @param array|null $groups The validator groups to use for validating
|
|
|
|
* @return ConstraintViolationList
|
|
|
|
*/
|
2010-10-15 22:49:09 +01:00
|
|
|
function validatePropertyValue($class, $property, $value, $groups = null);
|
2010-06-24 09:40:05 +01:00
|
|
|
|
2011-01-16 04:41:23 +00:00
|
|
|
/**
|
|
|
|
* Validates a given value against a specific Constraint.
|
|
|
|
*
|
|
|
|
* @param mixed $value The value to validate
|
|
|
|
* @param Constraint $constraint The constraint to validate against
|
|
|
|
* @param array|null $groups The validator groups to use for validating
|
|
|
|
* @return ConstraintViolationList
|
|
|
|
*/
|
2010-10-15 22:49:09 +01:00
|
|
|
function validateValue($value, Constraint $constraint, $groups = null);
|
2010-06-24 09:40:05 +01:00
|
|
|
}
|