1 | <?php |
||
7 | class ConstraintsReader extends Reader |
||
8 | { |
||
9 | /** |
||
10 | * The name of the annotation class that enable the constraints validation for a class. |
||
11 | * |
||
12 | * @var string |
||
13 | */ |
||
14 | private static $enableConstraintsValidationAnnotationClass = "Accessible\\Annotation\\EnableConstraintsValidation"; |
||
15 | |||
16 | /** |
||
17 | * The name of the annotation class that disable the constraints validation for a class. |
||
18 | * |
||
19 | * @var string |
||
20 | */ |
||
21 | private static $disableConstraintsValidationAnnotationClass = "Accessible\\Annotation\\DisableConstraintsValidation"; |
||
22 | |||
23 | /** |
||
24 | * Indicates wether the constraints validation is enabled or not for the given object. |
||
25 | * |
||
26 | * @param array $objectClasses The classes of the object to read. |
||
27 | * @param Reader $objectClasses The annotation reader to use. |
||
28 | * |
||
29 | * @return boolean True if the validation is enabled, else false. |
||
30 | */ |
||
31 | 6 | public static function isConstraintsValidationEnabled($objectClasses, $annotationReader) |
|
48 | |||
49 | /** |
||
50 | * Validates the given value compared to given property constraints. |
||
51 | * If the value is valid, a call to `count` to the object returned |
||
52 | * by this method should give 0. |
||
53 | * |
||
54 | * @param object $object The object to compare. |
||
55 | * @param string $property The name of the reference property. |
||
56 | * @param mixed $value The value to check. |
||
57 | * |
||
58 | * @return Symfony\Component\Validator\ConstraintViolationList |
||
59 | * The list of constraints violations the check returns. |
||
60 | */ |
||
61 | 28 | public static function validatePropertyValue($object, $property, $value) |
|
65 | } |
||
66 |