This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Component/Validator/ValidatorInterface.php

86 lines
2.3 KiB
PHP
Raw Normal View History

<?php
2010-10-02 11:42:31 +01:00
/*
* This file is part of the Symfony package.
2010-10-02 11:42:31 +01:00
*
* (c) Fabien Potencier <fabien@symfony.com>
2010-10-02 11:42:31 +01: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
*/
namespace Symfony\Component\Validator;
use Symfony\Component\Validator\Constraint;
/**
* Validates a given value.
*
2012-05-26 08:48:33 +01:00
* @author Bernhard Schussek <bschussek@gmail.com>
2011-07-20 09:37:57 +01:00
*
* @api
*/
interface ValidatorInterface
{
/**
* Validate the given object.
*
2012-05-15 21:19:31 +01:00
* @param object $object The object to validate
* @param array|null $groups The validator groups to use for validating
2011-12-13 07:50:54 +00:00
*
* @return ConstraintViolationList
2011-07-20 09:37:57 +01:00
*
* @api
*/
2012-07-09 13:50:58 +01:00
public function validate($object, $groups = null);
/**
* Validate a single property of an object against its current value.
*
2012-05-15 21:19:31 +01:00
* @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
2011-12-13 07:50:54 +00:00
*
* @return ConstraintViolationList
2011-07-20 09:37:57 +01:00
*
* @api
*/
2012-07-09 13:50:58 +01:00
public function validateProperty($object, $property, $groups = null);
/**
* Validate a single property of an object against the given value.
*
2012-05-18 18:41:48 +01:00
* @param string $class The class on which the property belongs
* @param string $property The name of the property to validate
2011-04-23 16:05:44 +01:00
* @param string $value
2012-05-18 18:41:48 +01:00
* @param array|null $groups The validator groups to use for validating
2011-12-13 07:50:54 +00:00
*
* @return ConstraintViolationList
2011-07-20 09:37:57 +01:00
*
* @api
*/
2012-07-09 13:50:58 +01:00
public function validatePropertyValue($class, $property, $value, $groups = null);
/**
* Validates a given value against a specific Constraint.
*
2012-05-15 21:19:31 +01:00
* @param mixed $value The value to validate
* @param Constraint $constraint The constraint to validate against
2012-05-15 21:19:31 +01:00
* @param array|null $groups The validator groups to use for validating
2011-12-13 07:50:54 +00:00
*
* @return ConstraintViolationList
2011-07-20 09:37:57 +01:00
*
* @api
*/
2012-07-09 13:50:58 +01:00
public function validateValue($value, Constraint $constraint, $groups = null);
/**
* Returns the factory for ClassMetadata instances
*
* @return Mapping\ClassMetadataFactoryInterface
2011-07-20 09:37:57 +01:00
*
* @api
*/
2012-07-09 13:50:58 +01:00
public function getMetadataFactory();
2011-06-08 11:16:48 +01:00
}