You are here

interface MediaSourceFieldConstraintsInterface in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/media/src/MediaSourceFieldConstraintsInterface.php \Drupal\media\MediaSourceFieldConstraintsInterface
  2. 9 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 constraint name.
   *   Each constraint definition can be used for instantiating
   *   \Symfony\Component\Validator\Constraint objects.
   */
  public function getSourceFieldConstraints();

}

Members