You are here

public function FlippingBook::deleteArchive in Flipping Book 8

Delete Flipping Book Archive.

Parameters

\Drupal\flipping_book\Entity\FlippingBook $flippingBook: A Flipping Book entity.

Overrides FlippingBookInterface::deleteArchive

File

src/FlippingBook.php, line 91

Class

FlippingBook
Class FlippingBook.

Namespace

Drupal\flipping_book

Code

public function deleteArchive(FlippingBookEntity $flippingBook) {
  $dir = $flippingBook
    ->get('directory')->value;
  if (empty($dir)) {
    return;
  }
  $location = $this
    ->extractUploadLocation($flippingBook);
  $this->fileSystem
    ->deleteRecursive($this->fileSystem
    ->realpath("{$location}/{$dir}"));
}