interface MediaSourceFieldConstraintsInterface

Same name in other branches
  1. 9 core/modules/media/src/MediaSourceFieldConstraintsInterface.php \Drupal\media\MediaSourceFieldConstraintsInterface
  2. 8.9.x core/modules/media/src/MediaSourceFieldConstraintsInterface.php \Drupal\media\MediaSourceFieldConstraintsInterface
  3. 11.x core/modules/media/src/MediaSourceFieldConstraintsInterface.php \Drupal\media\MediaSourceFieldConstraintsInterface

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.

Hierarchy

Expanded class hierarchy of MediaSourceFieldConstraintsInterface

All classes that implement MediaSourceFieldConstraintsInterface

See also

\Drupal\media\MediaSourceInterface

\Drupal\media\MediaSourceEntityConstraintsInterface

\Drupal\media\MediaSourceBase

\Drupal\media\Entity\Media

3 files declare their use of MediaSourceFieldConstraintsInterface
Media.php in core/modules/media/src/Entity/Media.php
OEmbedInterface.php in core/modules/media/src/Plugin/media/Source/OEmbedInterface.php
TestWithConstraints.php in core/modules/media/tests/modules/media_test_source/src/Plugin/media/Source/TestWithConstraints.php

File

core/modules/media/src/MediaSourceFieldConstraintsInterface.php, line 17

Namespace

Drupal\media
View source
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 plugin IDs. The
     *   corresponding values are options for each validation plugin.
     *   Each constraint definition can be used for instantiating
     *   \Symfony\Component\Validator\Constraint objects.
     */
    public function getSourceFieldConstraints();

}

Members

Title Sort descending Modifiers Object type Summary Overrides
ConfigurableInterface::defaultConfiguration public function Gets default configuration for this plugin. 13
ConfigurableInterface::getConfiguration public function Gets this plugin's configuration. 13
ConfigurableInterface::setConfiguration public function Sets the configuration for this plugin instance. 13
DependentPluginInterface::calculateDependencies public function Calculates dependencies for the configured plugin. 19
MediaSourceFieldConstraintsInterface::getSourceFieldConstraints public function Gets media source-specific validation constraints for a source field. 2
MediaSourceInterface::createSourceField public function Creates the source field definition for a type. 1
MediaSourceInterface::getMetadata public function Gets the value for a metadata attribute for a given media item. 1
MediaSourceInterface::getMetadataAttributes public function Gets a list of metadata attributes provided by this plugin. 3
MediaSourceInterface::getSourceFieldDefinition public function Get the source field definition for a media type. 1
MediaSourceInterface::getSourceFieldValue public function Get the primary value stored in the source field. 1
MediaSourceInterface::METADATA_FIELD_EMPTY constant Default empty value for metadata fields.
MediaSourceInterface::prepareFormDisplay public function Prepares the media type fields for this source in the form display. 1
MediaSourceInterface::prepareViewDisplay public function Prepares the media type fields for this source in the view display. 1
PluginFormInterface::buildConfigurationForm public function Form constructor. 31
PluginFormInterface::submitConfigurationForm public function Form submission handler. 29
PluginFormInterface::validateConfigurationForm public function Form validation handler. 16
PluginInspectionInterface::getPluginDefinition public function Gets the definition of the plugin implementation. 6
PluginInspectionInterface::getPluginId public function Gets the plugin ID of the plugin instance. 2

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.