public static function FillPdfLinkManipulator::prepareBooleanFlags in FillPDF 5.0.x
Same name and namespace in other branches
- 8.4 src/Service/FillPdfLinkManipulator.php \Drupal\fillpdf\Service\FillPdfLinkManipulator::prepareBooleanFlags()
Helper method preparing boolean flags for link generation.
@internal
Parameters
array $parameters: Array of parameters.
Return value
array An associative array of sanitized boolean flags.
1 call to FillPdfLinkManipulator::prepareBooleanFlags()
- FillPdfLinkManipulator::generateLink in src/
Service/ FillPdfLinkManipulator.php - Generates a FillPdf Url from the given parameters.
File
- src/
Service/ FillPdfLinkManipulator.php, line 203
Class
Namespace
Drupal\fillpdf\ServiceCode
public static function prepareBooleanFlags(array $parameters) {
// @todo: Create a value object for FillPdfMergeContext and get the defaults
// here from that.
$query = [];
if (!empty($parameters['force_download'])) {
$query['download'] = TRUE;
}
if (isset($parameters['flatten']) && $parameters['flatten'] == FALSE) {
$query['flatten'] = FALSE;
}
if (!empty($parameters['sample'])) {
$query['sample'] = TRUE;
}
return $query;
}