You are here

public function MediaImage::getFieldDefinition in Varbase Media 9.0.x

Same name and namespace in other branches
  1. 8.7 modules/entity_browser_generic_embed/src/Plugin/entity_embed/EntityEmbedDisplay/MediaImage.php \Drupal\entity_browser_generic_embed\Plugin\entity_embed\EntityEmbedDisplay\MediaImage::getFieldDefinition()
  2. 8.5 modules/entity_browser_generic_embed/src/Plugin/entity_embed/EntityEmbedDisplay/MediaImage.php \Drupal\entity_browser_generic_embed\Plugin\entity_embed\EntityEmbedDisplay\MediaImage::getFieldDefinition()
  3. 8.6 modules/entity_browser_generic_embed/src/Plugin/entity_embed/EntityEmbedDisplay/MediaImage.php \Drupal\entity_browser_generic_embed\Plugin\entity_embed\EntityEmbedDisplay\MediaImage::getFieldDefinition()

File

modules/entity_browser_generic_embed/src/Plugin/entity_embed/EntityEmbedDisplay/MediaImage.php, line 76

Class

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

Namespace

Drupal\entity_browser_generic_embed\Plugin\entity_embed\EntityEmbedDisplay

Code

public function getFieldDefinition() {

  // The parent method will set the target_type to the entity type being
  // embedded, but we are actually rendering an image (i.e., a file entity).
  return parent::getFieldDefinition()
    ->setSetting('target_type', 'file');
}