You are here

public function MediaSourceBase::prepareViewDisplay in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/media/src/MediaSourceBase.php \Drupal\media\MediaSourceBase::prepareViewDisplay()
  2. 9 core/modules/media/src/MediaSourceBase.php \Drupal\media\MediaSourceBase::prepareViewDisplay()
1 call to MediaSourceBase::prepareViewDisplay()
TestDifferentDisplays::prepareViewDisplay in core/modules/media/tests/modules/media_test_source/src/Plugin/media/Source/TestDifferentDisplays.php
Prepares the media type fields for this source in the view display.
6 methods override MediaSourceBase::prepareViewDisplay()
AudioFile::prepareViewDisplay in core/modules/media/src/Plugin/media/Source/AudioFile.php
Prepares the media type fields for this source in the view display.
Image::prepareViewDisplay in core/modules/media/src/Plugin/media/Source/Image.php
Prepares the media type fields for this source in the view display.
OEmbed::prepareViewDisplay in core/modules/media/src/Plugin/media/Source/OEmbed.php
Prepares the media type fields for this source in the view display.
TestDifferentDisplays::prepareViewDisplay in core/modules/media/tests/modules/media_test_source/src/Plugin/media/Source/TestDifferentDisplays.php
Prepares the media type fields for this source in the view display.
TestWithHiddenSourceField::prepareViewDisplay in core/modules/media/tests/modules/media_test_source/src/Plugin/media/Source/TestWithHiddenSourceField.php
Prepares the media type fields for this source in the view display.

... See full list

File

core/modules/media/src/MediaSourceBase.php, line 345

Class

MediaSourceBase
Base implementation of media source plugin.

Namespace

Drupal\media

Code

public function prepareViewDisplay(MediaTypeInterface $type, EntityViewDisplayInterface $display) {
  $display
    ->setComponent($this
    ->getSourceFieldDefinition($type)
    ->getName(), [
    'label' => 'visually_hidden',
  ]);
}