Version 1
[yaffs-website] / vendor / symfony / validator / GlobalExecutionContextInterface.php
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 /**
15  * Stores the node-independent state of a validation run.
16  *
17  * When the validator validates a graph of objects, it uses two classes to
18  * store the state during the validation:
19  *
20  * <ul>
21  * <li>For each node in the validation graph (objects, properties, getters) the
22  * validator creates an instance of {@link ExecutionContextInterface} that
23  * stores the information about that node.</li>
24  * <li>One single <tt>GlobalExecutionContextInterface</tt> stores the state
25  * that is independent of the current node.</li>
26  * </ul>
27  *
28  * @author Bernhard Schussek <bschussek@gmail.com>
29  *
30  * @deprecated since version 2.5, to be removed in 3.0.
31  *             Use {@link Context\ExecutionContextInterface} instead.
32  */
33 interface GlobalExecutionContextInterface
34 {
35     /**
36      * Returns the violations generated by the validator so far.
37      *
38      * @return ConstraintViolationListInterface A list of constraint violations
39      */
40     public function getViolations();
41
42     /**
43      * Returns the value at which validation was started in the object graph.
44      *
45      * @return mixed The root value
46      *
47      * @see ExecutionContextInterface::getRoot()
48      */
49     public function getRoot();
50
51     /**
52      * Returns the visitor instance used to validate the object graph nodes.
53      *
54      * @return ValidationVisitorInterface The validation visitor
55      */
56     public function getVisitor();
57
58     /**
59      * Returns the factory for constraint validators.
60      *
61      * @return ConstraintValidatorFactoryInterface The constraint validator factory
62      */
63     public function getValidatorFactory();
64
65     /**
66      * Returns the factory for validation metadata objects.
67      *
68      * @return MetadataFactoryInterface The metadata factory
69      */
70     public function getMetadataFactory();
71 }