|
0
|
1 |
<?php |
|
|
2 |
|
|
|
3 |
/* |
|
|
4 |
* This file is part of the Symfony package. |
|
|
5 |
* |
|
|
6 |
* (c) Fabien Potencier <fabien@symfony.com> |
|
|
7 |
* |
|
|
8 |
* For the full copyright and license information, please view the LICENSE |
|
|
9 |
* file that was distributed with this source code. |
|
|
10 |
*/ |
|
|
11 |
|
|
|
12 |
namespace Symfony\Component\Validator; |
|
|
13 |
|
|
|
14 |
use Symfony\Component\Validator\Constraint; |
|
|
15 |
|
|
|
16 |
/** |
|
|
17 |
* Validates a given value. |
|
|
18 |
* |
|
|
19 |
* @author Bernhard Schussek <bernhard.schussek@symfony.com> |
|
|
20 |
* |
|
|
21 |
* @api |
|
|
22 |
*/ |
|
|
23 |
interface ValidatorInterface |
|
|
24 |
{ |
|
|
25 |
/** |
|
|
26 |
* Validate the given object. |
|
|
27 |
* |
|
|
28 |
* @param object $object The object to validate |
|
|
29 |
* @param array|null $groups The validator groups to use for validating |
|
|
30 |
* @return ConstraintViolationList |
|
|
31 |
* |
|
|
32 |
* @api |
|
|
33 |
*/ |
|
|
34 |
function validate($object, $groups = null); |
|
|
35 |
|
|
|
36 |
/** |
|
|
37 |
* Validate a single property of an object against its current value. |
|
|
38 |
* |
|
|
39 |
* @param object $object The object to validate |
|
|
40 |
* @param string $property The name of the property to validate |
|
|
41 |
* @param array|null $groups The validator groups to use for validating |
|
|
42 |
* @return ConstraintViolationList |
|
|
43 |
* |
|
|
44 |
* @api |
|
|
45 |
*/ |
|
|
46 |
function validateProperty($object, $property, $groups = null); |
|
|
47 |
|
|
|
48 |
/** |
|
|
49 |
* Validate a single property of an object against the given value. |
|
|
50 |
* |
|
|
51 |
* @param string $class The class on which the property belongs |
|
|
52 |
* @param string $property The name of the property to validate |
|
|
53 |
* @param string $value |
|
|
54 |
* @param array|null $groups The validator groups to use for validating |
|
|
55 |
* @return ConstraintViolationList |
|
|
56 |
* |
|
|
57 |
* @api |
|
|
58 |
*/ |
|
|
59 |
function validatePropertyValue($class, $property, $value, $groups = null); |
|
|
60 |
|
|
|
61 |
/** |
|
|
62 |
* Validates a given value against a specific Constraint. |
|
|
63 |
* |
|
|
64 |
* @param mixed $value The value to validate |
|
|
65 |
* @param Constraint $constraint The constraint to validate against |
|
|
66 |
* @param array|null $groups The validator groups to use for validating |
|
|
67 |
* @return ConstraintViolationList |
|
|
68 |
* |
|
|
69 |
* @api |
|
|
70 |
*/ |
|
|
71 |
function validateValue($value, Constraint $constraint, $groups = null); |
|
|
72 |
|
|
|
73 |
/** |
|
|
74 |
* Returns the factory for ClassMetadata instances |
|
|
75 |
* |
|
|
76 |
* @return Mapping\ClassMetadataFactoryInterface |
|
|
77 |
* |
|
|
78 |
* @api |
|
|
79 |
*/ |
|
|
80 |
function getMetadataFactory(); |
|
|
81 |
} |