MetadataInterface.php 1.5 KB

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