MetadataInterface.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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\Mapping;
  11. use Symfony\Component\Validator\Constraint;
  12. /**
  13. * A container for validation metadata.
  14. *
  15. * Most importantly, the metadata stores the constraints against which an object
  16. * and its properties should be validated.
  17. *
  18. * Additionally, the metadata stores whether objects should be validated
  19. * against their class' metadata and whether traversable objects should be
  20. * traversed or not.
  21. *
  22. * @author Bernhard Schussek <bschussek@gmail.com>
  23. *
  24. * @see CascadingStrategy
  25. * @see TraversalStrategy
  26. */
  27. interface MetadataInterface
  28. {
  29. /**
  30. * Returns the strategy for cascading objects.
  31. *
  32. * @return int The cascading strategy
  33. *
  34. * @see CascadingStrategy
  35. */
  36. public function getCascadingStrategy();
  37. /**
  38. * Returns the strategy for traversing traversable objects.
  39. *
  40. * @return int The traversal strategy
  41. *
  42. * @see TraversalStrategy
  43. */
  44. public function getTraversalStrategy();
  45. /**
  46. * Returns all constraints of this element.
  47. *
  48. * @return Constraint[] A list of Constraint instances
  49. */
  50. public function getConstraints();
  51. /**
  52. * Returns all constraints for a given validation group.
  53. *
  54. * @param string $group The validation group
  55. *
  56. * @return Constraint[] A list of constraint instances
  57. */
  58. public function findConstraints(string $group);
  59. }