Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. MediaSourceEntityConstraintsInterface.php

interface 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\ConfigurableInterface; interface \Drupal\Component\Plugin\DependentPluginInterface; interface \Drupal\Component\Plugin\PluginInspectionInterface; interface \Drupal\Core\Plugin\PluginFormInterface
    • interface \Drupal\media\MediaSourceInterface extends \Drupal\Component\Plugin\PluginInspectionInterface \Drupal\Component\Plugin\ConfigurableInterface \Drupal\Component\Plugin\DependentPluginInterface \Drupal\Core\Plugin\PluginFormInterface
      • interface \Drupal\media\MediaSourceEntityConstraintsInterface extends \Drupal\media\MediaSourceInterface

Expanded class hierarchy of MediaSourceEntityConstraintsInterface

All classes that implement MediaSourceEntityConstraintsInterface

See also

\Drupal\media\MediaSourceInterface

\Drupal\media\MediaSourceFieldConstraintsInterface.php

\Drupal\media\MediaSourceBase

\Drupal\media\Entity\Media

1 file declares its use of MediaSourceEntityConstraintsInterface
Media.php in core/modules/media/src/Entity/Media.php

File

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

Namespace

Drupal\media
View 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 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 getEntityConstraints();

}

Members

Title Sort descending Modifiers Object type Summary Overrides
ConfigurableInterface::defaultConfiguration public function Gets default configuration for this plugin. 10
ConfigurableInterface::getConfiguration public function Gets this plugin's configuration. 10
ConfigurableInterface::setConfiguration public function Sets the configuration for this plugin instance. 10
DependentPluginInterface::calculateDependencies public function Calculates dependencies for the configured plugin. 18
MediaSourceEntityConstraintsInterface::getEntityConstraints public function Gets media source-specific validation constraints for a media item.
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. 2
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. 20
PluginFormInterface::submitConfigurationForm public function Form submission handler. 20
PluginFormInterface::validateConfigurationForm public function Form validation handler. 15
PluginInspectionInterface::getPluginDefinition public function Gets the definition of the plugin implementation. 5
PluginInspectionInterface::getPluginId public function Gets the plugin ID of the plugin instance. 2

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal