function TestDifferentDisplays::prepareFormDisplay
Same name in other branches
- 9 core/modules/media/tests/modules/media_test_source/src/Plugin/media/Source/TestDifferentDisplays.php \Drupal\media_test_source\Plugin\media\Source\TestDifferentDisplays::prepareFormDisplay()
- 8.9.x core/modules/media/tests/modules/media_test_source/src/Plugin/media/Source/TestDifferentDisplays.php \Drupal\media_test_source\Plugin\media\Source\TestDifferentDisplays::prepareFormDisplay()
- 10 core/modules/media/tests/modules/media_test_source/src/Plugin/media/Source/TestDifferentDisplays.php \Drupal\media_test_source\Plugin\media\Source\TestDifferentDisplays::prepareFormDisplay()
Overrides MediaSourceBase::prepareFormDisplay
File
-
core/
modules/ media/ tests/ modules/ media_test_source/ src/ Plugin/ media/ Source/ TestDifferentDisplays.php, line 38
Class
- TestDifferentDisplays
- Provides test media source.
Namespace
Drupal\media_test_source\Plugin\media\SourceCode
public function prepareFormDisplay(MediaTypeInterface $type, EntityFormDisplayInterface $display) {
parent::prepareFormDisplay($type, $display);
$source_name = $this->getSourceFieldDefinition($type)
->getName();
$source_component = $display->getComponent($source_name) ?: [];
$source_component['type'] = 'entity_reference_autocomplete_tags';
$display->setComponent($source_name, $source_component);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.