CascadingStrategy.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. /**
  12. * Specifies whether an object should be cascaded.
  13. *
  14. * Cascading is relevant for any node type but class nodes. If such a node
  15. * contains an object of value, and if cascading is enabled, then the node
  16. * traverser will try to find class metadata for that object and validate the
  17. * object against that metadata.
  18. *
  19. * If no metadata is found for a cascaded object, and if that object implements
  20. * {@link \Traversable}, the node traverser will iterate over the object and
  21. * cascade each object or collection contained within, unless iteration is
  22. * prohibited by the specified {@link TraversalStrategy}.
  23. *
  24. * Although the constants currently represent a boolean switch, they are
  25. * implemented as bit mask in order to allow future extensions.
  26. *
  27. * @since 2.5
  28. *
  29. * @author Bernhard Schussek <bschussek@gmail.com>
  30. *
  31. * @see TraversalStrategy
  32. */
  33. class CascadingStrategy
  34. {
  35. /**
  36. * Specifies that a node should not be cascaded.
  37. */
  38. const NONE = 1;
  39. /**
  40. * Specifies that a node should be cascaded.
  41. */
  42. const CASCADE = 2;
  43. /**
  44. * Not instantiable.
  45. */
  46. private function __construct()
  47. {
  48. }
  49. }