You are here

public function ImageHotspot::getTarget in Image Hotspots 8

Returns the target image with applied style.

Return value

array Return array of image style, fid, field name.

Overrides ImageHotspotInterface::getTarget

File

src/Entity/ImageHotspot.php, line 35

Class

ImageHotspot
Defines the image hotspot entity class.

Namespace

Drupal\image_hotspots\Entity

Code

public function getTarget() {
  return [
    'field_name' => $this->field_name
      ->getValue()[0]['target_id'],
    'fid' => $this->fid
      ->getValue()[0]['target_id'],
    'image_style' => $this->image_style
      ->getValue()[0]['target_id'],
    'langcode' => $this->langcode
      ->getValue()[0]['target_id'],
  ];
}