Mercurial > hg > cmmr2012-drupal-site
diff core/modules/media/src/MediaSourceFieldConstraintsInterface.php @ 0:c75dbcec494b
Initial commit from drush-created site
author | Chris Cannam |
---|---|
date | Thu, 05 Jul 2018 14:24:15 +0000 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/modules/media/src/MediaSourceFieldConstraintsInterface.php Thu Jul 05 14:24:15 2018 +0000 @@ -0,0 +1,29 @@ +<?php + +namespace Drupal\media; + +/** + * Defines an interface for a media source with source field constraints. + * + * This allows a media source to optionally add source field validation + * constraints for media items. To add constraints at the entity level, a + * media source can also implement MediaSourceEntityConstraintsInterface. + * + * @see \Drupal\media\MediaSourceInterface + * @see \Drupal\media\MediaSourceEntityConstraintsInterface + * @see \Drupal\media\MediaSourceBase + * @see \Drupal\media\Entity\Media + */ +interface MediaSourceFieldConstraintsInterface extends MediaSourceInterface { + + /** + * Gets media source-specific validation constraints for a source field. + * + * @return \Symfony\Component\Validator\Constraint[] + * An array of validation constraint definitions, keyed by constraint name. + * Each constraint definition can be used for instantiating + * \Symfony\Component\Validator\Constraint objects. + */ + public function getSourceFieldConstraints(); + +}