You are here

public function WebformRevisions::getContentEntityID in Config Entity Revisions 1.x

Same name and namespace in other branches
  1. 8 modules/webform_revisions/src/Entity/WebformRevisions.php \Drupal\webform_revisions\Entity\WebformRevisions::getContentEntityID()

Get from the configEntity the ID of the matching content entity.

Return value

int|null The ID (if any) of the matching content entity.

Overrides ConfigEntityRevisionsInterface::getContentEntityID

File

modules/webform_revisions/src/Entity/WebformRevisions.php, line 51

Class

WebformRevisions

Namespace

Drupal\webform_revisions\Entity

Code

public function getContentEntityID() {
  $id = $this
    ->getThirdPartySetting('webform_revisions', 'contentEntity_id');

  // Issue 3051713 - validate that the record exists.
  if ($id) {
    $record = $this->entityTypeManager
      ->getStorage('config_entity_revisions')
      ->load($id);
    if (!$record) {
      $id = NULL;
    }
  }
  return $id;
}