You are here

public static function FillPdfForm::preDelete in FillPDF 5.0.x

Same name and namespace in other branches
  1. 8.4 src/Entity/FillPdfForm.php \Drupal\fillpdf\Entity\FillPdfForm::preDelete()

Acts on FillPdfForms before they are deleted and before hooks are invoked.

Deletes the FillPdfForm's FillPdfFormFields.

Parameters

\Drupal\Core\Entity\EntityStorageInterface $storage: The entity storage object.

\Drupal\fillpdf\FillPdfFormInterface[] $entities: An array of FillPdfForms.

Overrides EntityBase::preDelete

File

src/Entity/FillPdfForm.php, line 211

Class

FillPdfForm
Defines the entity for managing uploaded FillPDF forms.

Namespace

Drupal\fillpdf\Entity

Code

public static function preDelete(EntityStorageInterface $storage, array $entities) {
  parent::preDelete($storage, $entities);
  foreach ($entities as $fillpdf_form) {
    \Drupal::entityTypeManager()
      ->getStorage('fillpdf_form_field')
      ->delete($fillpdf_form
      ->getFormFields());
  }
}