You are here

public function OpignoModule::getModuleImage in Opigno module 8

Same name and namespace in other branches
  1. 3.x src/Entity/OpignoModule.php \Drupal\opigno_module\Entity\OpignoModule::getModuleImage()

Get image entity.

File

src/Entity/OpignoModule.php, line 256

Class

OpignoModule
Defines the Module entity.

Namespace

Drupal\opigno_module\Entity

Code

public function getModuleImage() {
  $media = $this
    ->get('module_media_image')->entity;
  if ($media) {
    return $media
      ->get('field_media_image')->entity;
  }
  else {
    return NULL;
  }
}