PropertyMetadataInterface.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. * A container for validation metadata of a property.
  13. *
  14. * What exactly you define as "property" is up to you. The validator expects
  15. * implementations of {@link MetadataInterface} that contain constraints and
  16. * optionally a list of named properties that also have constraints (and may
  17. * have further sub properties). Such properties are mapped by implementations
  18. * of this interface.
  19. *
  20. * @author Bernhard Schussek <bschussek@gmail.com>
  21. *
  22. * @see MetadataInterface
  23. */
  24. interface PropertyMetadataInterface extends MetadataInterface
  25. {
  26. /**
  27. * Returns the name of the property.
  28. *
  29. * @return string The property name.
  30. */
  31. public function getPropertyName();
  32. /**
  33. * Extracts the value of the property from the given container.
  34. *
  35. * @param mixed $containingValue The container to extract the property value from.
  36. *
  37. * @return mixed The value of the property.
  38. */
  39. public function getPropertyValue($containingValue);
  40. }