public function TestWithConstraints::getSourceFieldConstraints in Drupal 8
Same name and namespace in other branches
- 9 core/modules/media/tests/modules/media_test_source/src/Plugin/media/Source/TestWithConstraints.php \Drupal\media_test_source\Plugin\media\Source\TestWithConstraints::getSourceFieldConstraints()
- 10 core/modules/media/tests/modules/media_test_source/src/Plugin/media/Source/TestWithConstraints.php \Drupal\media_test_source\Plugin\media\Source\TestWithConstraints::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/ tests/ modules/ media_test_source/ src/ Plugin/ media/ Source/ TestWithConstraints.php, line 30
Class
- TestWithConstraints
- Provides generic media type.
Namespace
Drupal\media_test_source\Plugin\media\SourceCode
public function getSourceFieldConstraints() {
return \Drupal::state()
->get('media_source_test_field_constraints', []);
}