You are here

public function WebformRevisionsSubmission::getWebform in Config Entity Revisions 8.2

Same name and namespace in other branches
  1. 8 modules/webform_revisions/src/Entity/WebformRevisionsSubmission.php \Drupal\webform_revisions\Entity\WebformRevisionsSubmission::getWebform()
  2. 1.x modules/webform_revisions/src/Entity/WebformRevisionsSubmission.php \Drupal\webform_revisions\Entity\WebformRevisionsSubmission::getWebform()

Gets the webform submission's webform entity.

Return value

\Drupal\webform\WebformInterface The webform entity.

Overrides WebformSubmission::getWebform

File

modules/webform_revisions/src/Entity/WebformRevisionsSubmission.php, line 22

Class

WebformRevisionsSubmission
Class WebformRevisionsSubmission.

Namespace

Drupal\webform_revisions\Entity

Code

public function getWebform() {
  if (!static::$webform) {
    $webform_revision = $this->webform_revision->target_id;
    $content_entity_storage = $this
      ->entityTypeManager()
      ->getStorage('config_entity_revisions');
    $content_entity = $content_entity_storage
      ->loadRevision($webform_revision);
    static::$webform = $content_entity_storage
      ->getConfigEntity($content_entity, 'Drupal\\webform_revisions\\Entity\\WebformRevision');
  }
  return static::$webform;
}