GlobalExecutionContextInterface.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\Validator;
  11. /**
  12. * Stores the node-independent state of a validation run.
  13. *
  14. * When the validator validates a graph of objects, it uses two classes to
  15. * store the state during the validation:
  16. *
  17. * <ul>
  18. * <li>For each node in the validation graph (objects, properties, getters) the
  19. * validator creates an instance of {@link ExecutionContextInterface} that
  20. * stores the information about that node.</li>
  21. * <li>One single <tt>GlobalExecutionContextInterface</tt> stores the state
  22. * that is independent of the current node.</li>
  23. * </ul>
  24. *
  25. * @author Bernhard Schussek <bschussek@gmail.com>
  26. *
  27. * @deprecated since version 2.5, to be removed in 3.0.
  28. * Use {@link Context\ExecutionContextInterface} instead.
  29. */
  30. interface GlobalExecutionContextInterface
  31. {
  32. /**
  33. * Returns the violations generated by the validator so far.
  34. *
  35. * @return ConstraintViolationListInterface A list of constraint violations
  36. */
  37. public function getViolations();
  38. /**
  39. * Returns the value at which validation was started in the object graph.
  40. *
  41. * @return mixed The root value
  42. *
  43. * @see ExecutionContextInterface::getRoot()
  44. */
  45. public function getRoot();
  46. /**
  47. * Returns the visitor instance used to validate the object graph nodes.
  48. *
  49. * @return ValidationVisitorInterface The validation visitor
  50. */
  51. public function getVisitor();
  52. /**
  53. * Returns the factory for constraint validators.
  54. *
  55. * @return ConstraintValidatorFactoryInterface The constraint validator factory
  56. */
  57. public function getValidatorFactory();
  58. /**
  59. * Returns the factory for validation metadata objects.
  60. *
  61. * @return MetadataFactoryInterface The metadata factory
  62. */
  63. public function getMetadataFactory();
  64. }