function MediaSourceBase::prepareViewDisplay

Same name in other branches
  1. 9 core/modules/media/src/MediaSourceBase.php \Drupal\media\MediaSourceBase::prepareViewDisplay()
  2. 8.9.x core/modules/media/src/MediaSourceBase.php \Drupal\media\MediaSourceBase::prepareViewDisplay()
  3. 10 core/modules/media/src/MediaSourceBase.php \Drupal\media\MediaSourceBase::prepareViewDisplay()

Overrides MediaSourceInterface::prepareViewDisplay

2 calls to MediaSourceBase::prepareViewDisplay()
Image::prepareViewDisplay in core/modules/media/src/Plugin/media/Source/Image.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.
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 350

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',
    ]);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.