4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\Validator;
15 * Stores the node-independent state of a validation run.
17 * When the validator validates a graph of objects, it uses two classes to
18 * store the state during the validation:
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>
28 * @author Bernhard Schussek <bschussek@gmail.com>
30 * @deprecated since version 2.5, to be removed in 3.0.
31 * Use {@link Context\ExecutionContextInterface} instead.
33 interface GlobalExecutionContextInterface
36 * Returns the violations generated by the validator so far.
38 * @return ConstraintViolationListInterface A list of constraint violations
40 public function getViolations();
43 * Returns the value at which validation was started in the object graph.
45 * @return mixed The root value
47 * @see ExecutionContextInterface::getRoot()
49 public function getRoot();
52 * Returns the visitor instance used to validate the object graph nodes.
54 * @return ValidationVisitorInterface The validation visitor
56 public function getVisitor();
59 * Returns the factory for constraint validators.
61 * @return ConstraintValidatorFactoryInterface The constraint validator factory
63 public function getValidatorFactory();
66 * Returns the factory for validation metadata objects.
68 * @return MetadataFactoryInterface The metadata factory
70 public function getMetadataFactory();