You are here

public function FlexiformFormEntityLoad::getEntity in Flexiform 8

Get the Entity.

Overrides FlexiformFormEntityProvided::getEntity

File

src/Plugin/FlexiformFormEntity/FlexiformFormEntityLoad.php, line 23

Class

FlexiformFormEntityLoad
Form Entity plugin.

Namespace

Drupal\flexiform\Plugin\FlexiformFormEntity

Code

public function getEntity() {
  if (isset($this->configuration['id'])) {
    $entity = $this->entityTypeManager
      ->getStorage($this
      ->getEntityType())
      ->load($this->configuration['id']);
    return $this
      ->checkBundle($entity) ? $entity : NULL;
  }
}