You are here

public function WebformRevisionsConfigTrait::contentEntityCount in Config Entity Revisions 8

Same name and namespace in other branches
  1. 1.x modules/webform_revisions/src/WebformRevisionsConfigTrait.php \Drupal\webform_revisions\WebformRevisionsConfigTrait::contentEntityCount()

Get the number of submissions related to a revision.

Return value

integer The number of content entities using a particular revision.

File

modules/webform_revisions/src/WebformRevisionsConfigTrait.php, line 33

Class

WebformRevisionsConfigTrait

Namespace

Drupal\webform_revisions

Code

public function contentEntityCount($rid) {
  return \Drupal::database()
    ->query("SELECT COUNT(sid) FROM {webform_submission} WHERE webform_revision = :rid", [
    ':rid' => $rid,
  ])
    ->fetchField();
}