You are here

public static function MediaHelper::isPreviewable in Lightning Media 8

Same name and namespace in other branches
  1. 8.4 src/MediaHelper.php \Drupal\lightning_media\MediaHelper::isPreviewable()
  2. 8.2 src/MediaHelper.php \Drupal\lightning_media\MediaHelper::isPreviewable()
  3. 8.3 src/MediaHelper.php \Drupal\lightning_media\MediaHelper::isPreviewable()

Indicates if the media entity's type plugin supports dynamic previews.

Parameters

\Drupal\media\MediaInterface $entity: The media entity.

Return value

bool TRUE if dynamic previews are supported, FALSE otherwise.

2 calls to MediaHelper::isPreviewable()
lightning_media_inline_entity_form_entity_form_alter in ./lightning_media.module
Implements hook_inline_entity_form_entity_form_alter().
MediaForm::form in src/Form/MediaForm.php
Gets the actual form array to be built.

File

src/MediaHelper.php, line 210

Class

MediaHelper
Provides helper methods for dealing with media entities.

Namespace

Drupal\lightning_media

Code

public static function isPreviewable(MediaInterface $entity) {
  $plugin_definition = $entity
    ->getSource()
    ->getPluginDefinition();
  return isset($plugin_definition['preview']);
}