You are here

protected function MediaViewMode::getMediaViewModeLabel in Media Migration 8

Returns the label of the specified media view mode on the destination site.

Parameters

string $view_mode_id: The ID of the view mode.

Return value

string|null The label of the view mode, or NULL if the view mode does not exist.

1 call to MediaViewMode::getMediaViewModeLabel()
MediaViewMode::initializeIterator in src/Plugin/migrate/source/d7/MediaViewMode.php

File

src/Plugin/migrate/source/d7/MediaViewMode.php, line 89

Class

MediaViewMode
Drupal 7 media view mode source based on source database.

Namespace

Drupal\media_migration\Plugin\migrate\source\d7

Code

protected function getMediaViewModeLabel(string $view_mode_id) {
  $view_mode_storage = $this->entityTypeManager
    ->getStorage('entity_view_mode');
  $view_mode = $view_mode_storage
    ->load("media.{$view_mode_id}");
  return $view_mode ? $view_mode
    ->label() : NULL;
}