You are here

interface MediaSourceEntityConstraintsInterface in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/media/src/MediaSourceEntityConstraintsInterface.php \Drupal\media\MediaSourceEntityConstraintsInterface
  2. 9 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

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

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\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 constraint name.
   *   Each constraint definition can be used for instantiating
   *   \Symfony\Component\Validator\Constraint objects.
   */
  public function getEntityConstraints();

}

Members