CascadingStrategy.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. * @author Bernhard Schussek <bschussek@gmail.com>
  28. *
  29. * @see TraversalStrategy
  30. */
  31. class CascadingStrategy
  32. {
  33. /**
  34. * Specifies that a node should not be cascaded.
  35. */
  36. const NONE = 1;
  37. /**
  38. * Specifies that a node should be cascaded.
  39. */
  40. const CASCADE = 2;
  41. /**
  42. * Not instantiable.
  43. */
  44. private function __construct()
  45. {
  46. }
  47. }