interface MediaSourceEntityConstraintsInterface in Drupal 9
Same name and namespace in other branches
- 8 core/modules/media/src/MediaSourceEntityConstraintsInterface.php \Drupal\media\MediaSourceEntityConstraintsInterface
Defines an interface for a media source with entity constraints.
This allows a media source to optionally add entity validation constraints for media items. To add constraints at the source field level, a media source can also implement MediaSourceFieldConstraintsInterface.
Hierarchy
- interface \Drupal\Component\Plugin\PluginInspectionInterface; interface \Drupal\Component\Plugin\ConfigurableInterface; interface \Drupal\Component\Plugin\DependentPluginInterface; interface \Drupal\Core\Plugin\PluginFormInterface- interface \Drupal\media\MediaSourceInterface- interface \Drupal\media\MediaSourceEntityConstraintsInterface
 
 
- interface \Drupal\media\MediaSourceInterface
Expanded class hierarchy of MediaSourceEntityConstraintsInterface
All classes that implement MediaSourceEntityConstraintsInterface
See also
\Drupal\media\MediaSourceInterface
\Drupal\media\MediaSourceFieldConstraintsInterface.php
2 files declare their use of MediaSourceEntityConstraintsInterface
- Media.php in core/modules/ media/ src/ Entity/ Media.php 
- TestWithConstraints.php in core/modules/ media/ tests/ modules/ media_test_source/ src/ Plugin/ media/ Source/ TestWithConstraints.php 
File
- core/modules/ media/ src/ MediaSourceEntityConstraintsInterface.php, line 17 
Namespace
Drupal\mediaView source
interface MediaSourceEntityConstraintsInterface extends MediaSourceInterface {
  /**
   * Gets media source-specific validation constraints for a media item.
   *
   * @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 getEntityConstraints();
}Members
| Name   | Modifiers | Type | Description | Overrides | 
|---|---|---|---|---|
| ConfigurableInterface:: | public | function | Gets default configuration for this plugin. | 14 | 
| ConfigurableInterface:: | public | function | Gets this plugin's configuration. | 15 | 
| ConfigurableInterface:: | public | function | Sets the configuration for this plugin instance. | 15 | 
| DependentPluginInterface:: | public | function | Calculates dependencies for the configured plugin. | 20 | 
| MediaSourceEntityConstraintsInterface:: | public | function | Gets media source-specific validation constraints for a media item. | 1 | 
| MediaSourceInterface:: | public | function | Creates the source field definition for a type. | 1 | 
| MediaSourceInterface:: | public | function | Gets the value for a metadata attribute for a given media item. | 1 | 
| MediaSourceInterface:: | public | function | Gets a list of metadata attributes provided by this plugin. | 3 | 
| MediaSourceInterface:: | public | function | Get the source field definition for a media type. | 1 | 
| MediaSourceInterface:: | public | function | Get the primary value stored in the source field. | 1 | 
| MediaSourceInterface:: | constant | Default empty value for metadata fields. | ||
| MediaSourceInterface:: | public | function | Prepares the media type fields for this source in the form display. | 1 | 
| MediaSourceInterface:: | public | function | Prepares the media type fields for this source in the view display. | 1 | 
| PluginFormInterface:: | public | function | Form constructor. | 37 | 
| PluginFormInterface:: | public | function | Form submission handler. | 32 | 
| PluginFormInterface:: | public | function | Form validation handler. | 18 | 
| PluginInspectionInterface:: | public | function | Gets the definition of the plugin implementation. | 4 | 
| PluginInspectionInterface:: | public | function | Gets the plugin_id of the plugin instance. | 2 | 
