You are here

public function TestWithConstraints::getEntityConstraints in Drupal 10

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

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

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 MediaSourceEntityConstraintsInterface::getEntityConstraints

File

core/modules/media/tests/modules/media_test_source/src/Plugin/media/Source/TestWithConstraints.php, line 23

Class

TestWithConstraints
Provides generic media type.

Namespace

Drupal\media_test_source\Plugin\media\Source

Code

public function getEntityConstraints() {
  return \Drupal::state()
    ->get('media_source_test_entity_constraints', []);
}