You are here

protected function YamlFormSubmissionDevelGenerate::deleteYamlFormSubmissions in YAML Form 8

Deletes all submissions of given forms.

Parameters

array $yamlform_ids: Array of form ids.

string|null $entity_type: A form source entity type.

int|null $entity_id: A form source entity id.

1 call to YamlFormSubmissionDevelGenerate::deleteYamlFormSubmissions()
YamlFormSubmissionDevelGenerate::generateSubmissions in src/Plugin/DevelGenerate/YamlFormSubmissionDevelGenerate.php
Generates submissions for a list of given forms.

File

src/Plugin/DevelGenerate/YamlFormSubmissionDevelGenerate.php, line 228

Class

YamlFormSubmissionDevelGenerate
Provides a YamlFormSubmissionDevelGenerate plugin.

Namespace

Drupal\yamlform\Plugin\DevelGenerate

Code

protected function deleteYamlFormSubmissions(array $yamlform_ids, $entity_type = NULL, $entity_id = NULL) {
  $yamlforms = $this->yamlformStorage
    ->loadMultiple($yamlform_ids);
  $entity = $entity_type && $entity_id ? $this->entityTypeManager
    ->getStorage($entity_type)
    ->load($entity_id) : NULL;
  foreach ($yamlforms as $yamlform) {
    $this->yamlformSubmissionStorage
      ->deleteAll($yamlform, $entity);
  }
}