protected function FlippingBookForm::deleteFlippingBook in Flipping Book 8
Delete Flipping Book.
Parameters
\Drupal\flipping_book\Entity\FlippingBook $flippingBook: A Flipping Book entity.
1 call to FlippingBookForm::deleteFlippingBook()
- FlippingBookForm::handleArchive in src/
Form/ FlippingBookForm.php - Handle uploaded archive.
File
- src/
Form/ FlippingBookForm.php, line 216
Class
- FlippingBookForm
- Form controller for Flipping Book edit forms.
Namespace
Drupal\flipping_book\FormCode
protected function deleteFlippingBook(FlippingBook $flippingBook) {
$this->flippingBook
->deleteArchive($flippingBook);
$data = $flippingBook
->get('file')
->getValue();
$file = $this
->getFileStorage()
->load($data[0]['target_id']);
$file
->delete();
}