You are here

public function OEmbed::getSourceFieldConstraints in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/media/src/Plugin/media/Source/OEmbed.php \Drupal\media\Plugin\media\Source\OEmbed::getSourceFieldConstraints()
  2. 9 core/modules/media/src/Plugin/media/Source/OEmbed.php \Drupal\media\Plugin\media\Source\OEmbed::getSourceFieldConstraints()

Gets media source-specific validation constraints for a source field.

Return value

\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.

Overrides MediaSourceFieldConstraintsInterface::getSourceFieldConstraints

File

core/modules/media/src/Plugin/media/Source/OEmbed.php, line 495

Class

OEmbed
Provides a media source plugin for oEmbed resources.

Namespace

Drupal\media\Plugin\media\Source

Code

public function getSourceFieldConstraints() {
  return [
    'oembed_resource' => [],
  ];
}