class MediaViewController in Media Expire 8.2
Same name and namespace in other branches
- 8 src/Controller/MediaViewController.php \Drupal\media_expire\Controller\MediaViewController
 
Extends EntityViewController to overwrite the view method.
Hierarchy
- class \Drupal\Core\Entity\Controller\EntityViewController implements ContainerInjectionInterface, TrustedCallbackInterface uses DeprecatedServicePropertyTrait
- class \Drupal\media_expire\Controller\MediaViewController
 
 
Expanded class hierarchy of MediaViewController
File
- src/
Controller/ MediaViewController.php, line 11  
Namespace
Drupal\media_expire\ControllerView source
class MediaViewController extends EntityViewController {
  /**
   * {@inheritdoc}
   */
  public function view(EntityInterface $media, $view_mode = 'full') {
    $page = $this->entityTypeManager
      ->getViewBuilder($media
      ->getEntityTypeId())
      ->view($media, $view_mode);
    $page['#pre_render'][] = [
      $this,
      'buildTitle',
    ];
    $page['#entity_type'] = $media
      ->getEntityTypeId();
    if (empty($page['#' . $page['#entity_type']])) {
      $page['#' . $page['#entity_type']] = $media;
    }
    if (empty($page['#view_mode'])) {
      // Make sure the view mode is set.
      $page['#view_mode'] = $view_mode;
    }
    return $page;
  }
}Members
| 
            Name | 
                  Modifiers | Type | Description | Overrides | 
|---|---|---|---|---|
| 
            DeprecatedServicePropertyTrait:: | 
                  public | function | Allows to access deprecated/removed properties. | |
| 
            EntityViewController:: | 
                  protected | property | ||
| 
            EntityViewController:: | 
                  protected | property | The entity type manager. | |
| 
            EntityViewController:: | 
                  protected | property | The renderer service. | |
| 
            EntityViewController:: | 
                  public | function | Pre-render callback to build the page title. | |
| 
            EntityViewController:: | 
                  public static | function | 
            Instantiates a new instance of this class. Overrides ContainerInjectionInterface:: | 
                  2 | 
| 
            EntityViewController:: | 
                  public static | function | 
            Lists the trusted callbacks provided by the implementing class. Overrides TrustedCallbackInterface:: | 
                  |
| 
            EntityViewController:: | 
                  public | function | Provides a page to render a single entity revision. | |
| 
            EntityViewController:: | 
                  public | function | Creates an EntityViewController object. | 2 | 
| 
            MediaViewController:: | 
                  public | function | 
            Provides a page to render a single entity. Overrides EntityViewController:: | 
                  |
| 
            TrustedCallbackInterface:: | 
                  constant | Untrusted callbacks throw exceptions. | ||
| 
            TrustedCallbackInterface:: | 
                  constant | Untrusted callbacks trigger silenced E_USER_DEPRECATION errors. | ||
| 
            TrustedCallbackInterface:: | 
                  constant | Untrusted callbacks trigger E_USER_WARNING errors. |