You are here

public function Webform::hasSubmissions in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/Entity/Webform.php \Drupal\webform\Entity\Webform::hasSubmissions()

Checks if a webform has submissions.

Return value

bool TRUE if the webform has submissions.

Overrides WebformInterface::hasSubmissions

File

src/Entity/Webform.php, line 729

Class

Webform
Defines the webform entity.

Namespace

Drupal\webform\Entity

Code

public function hasSubmissions() {

  /** @var \Drupal\webform\WebformSubmissionStorageInterface $submission_storage */
  $submission_storage = \Drupal::entityTypeManager()
    ->getStorage('webform_submission');
  return $submission_storage
    ->getTotal($this) ? TRUE : FALSE;
}