You are here

protected function MediaImage::isValidImage in Lightning Media 8

Same name and namespace in other branches
  1. 8.4 src/Plugin/entity_embed/EntityEmbedDisplay/MediaImage.php \Drupal\lightning_media\Plugin\entity_embed\EntityEmbedDisplay\MediaImage::isValidImage()
  2. 8.2 src/Plugin/entity_embed/EntityEmbedDisplay/MediaImage.php \Drupal\lightning_media\Plugin\entity_embed\EntityEmbedDisplay\MediaImage::isValidImage()
  3. 8.3 src/Plugin/entity_embed/EntityEmbedDisplay/MediaImage.php \Drupal\lightning_media\Plugin\entity_embed\EntityEmbedDisplay\MediaImage::isValidImage()

Checks if the image is valid.

Return value

\Drupal\Core\Access\AccessResult Returns the access result.

Overrides ImageFieldFormatter::isValidImage

File

src/Plugin/entity_embed/EntityEmbedDisplay/MediaImage.php, line 67

Class

MediaImage
Renders a media item's image via the image formatter.

Namespace

Drupal\lightning_media\Plugin\entity_embed\EntityEmbedDisplay

Code

protected function isValidImage() {

  // This display plugin works for any media entity. And media items always
  // have at least a thumbnail. So, we can bypass this access gate.
  return AccessResult::allowed();
}