You are here

protected function EntityPrintPdfBuilder::generateMultiFilename in Entity Print 8

Parameters

array $entities: An array of entities to derive the filename for.

bool $with_extension: Allow us to exclude the PDF file extension when generating the filename.

Return value

string The filename to use.

1 call to EntityPrintPdfBuilder::generateMultiFilename()
EntityPrintPdfBuilder::getMultipleEntitiesRenderedAsPdf in src/EntityPrintPdfBuilder.php
Render any content entity as a PDF.

File

src/EntityPrintPdfBuilder.php, line 112

Class

EntityPrintPdfBuilder

Namespace

Drupal\entity_print

Code

protected function generateMultiFilename(array $entities, $with_extension = TRUE) {
  $filename = '';
  foreach ($entities as $entity) {
    $filename .= $this
      ->generateFilename($entity, FALSE) . '-';
  }
  $filename = rtrim($filename, '-');
  return $with_extension ? $filename . '.pdf' : $filename;
}