MediaSourceEntityConstraintsInterface.php 982 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace Drupal\media;
  3. /**
  4. * Defines an interface for a media source with entity constraints.
  5. *
  6. * This allows a media source to optionally add entity validation constraints
  7. * for media items. To add constraints at the source field level, a media source
  8. * can also implement MediaSourceFieldConstraintsInterface.
  9. *
  10. * @see \Drupal\media\MediaSourceInterface
  11. * @see \Drupal\media\MediaSourceFieldConstraintsInterface.php
  12. * @see \Drupal\media\MediaSourceBase
  13. * @see \Drupal\media\Entity\Media
  14. */
  15. interface MediaSourceEntityConstraintsInterface extends MediaSourceInterface {
  16. /**
  17. * Gets media source-specific validation constraints for a media item.
  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 getEntityConstraints();
  25. }