MediaSourceFieldConstraintsInterface.php 992 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace Drupal\media;
  3. /**
  4. * Defines an interface for a media source with source field constraints.
  5. *
  6. * This allows a media source to optionally add source field validation
  7. * constraints for media items. To add constraints at the entity level, a
  8. * media source can also implement MediaSourceEntityConstraintsInterface.
  9. *
  10. * @see \Drupal\media\MediaSourceInterface
  11. * @see \Drupal\media\MediaSourceEntityConstraintsInterface
  12. * @see \Drupal\media\MediaSourceBase
  13. * @see \Drupal\media\Entity\Media
  14. */
  15. interface MediaSourceFieldConstraintsInterface extends MediaSourceInterface {
  16. /**
  17. * Gets media source-specific validation constraints for a source field.
  18. *
  19. * @return \Symfony\Component\Validator\Constraint[]
  20. * An array of validation constraint definitions, keyed by constraint name.
  21. * Each constraint definition can be used for instantiating
  22. * \Symfony\Component\Validator\Constraint objects.
  23. */
  24. public function getSourceFieldConstraints();
  25. }