public static function MediaHelper::isPreviewable in Lightning Media 8.4
Same name and namespace in other branches
- 8 src/MediaHelper.php \Drupal\lightning_media\MediaHelper::isPreviewable()
- 8.2 src/MediaHelper.php \Drupal\lightning_media\MediaHelper::isPreviewable()
- 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 235
Class
- MediaHelper
- Provides helper methods for dealing with media entities.
Namespace
Drupal\lightning_mediaCode
public static function isPreviewable(MediaInterface $entity) {
$plugin_definition = $entity
->getSource()
->getPluginDefinition();
return isset($plugin_definition['preview']);
}