You are here

protected static function FillPdfForm::getAllowedStorageSchemes in FillPDF 8.4

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

Gets a list of all storage schemes that are both available and allowed.

Return value

string[] List of storage schemes that are both available and allowed.

2 calls to FillPdfForm::getAllowedStorageSchemes()
FillPdfForm::getStorageSchemeDefault in src/Entity/FillPdfForm.php
Default value callback for 'scheme' base field definition.
FillPdfForm::getStorageSchemeOptions in src/Entity/FillPdfForm.php
Allowed values callback for 'scheme' base field definition.

File

src/Entity/FillPdfForm.php, line 285

Class

FillPdfForm
Defines the entity for managing uploaded FillPDF forms.

Namespace

Drupal\fillpdf\Entity

Code

protected static function getAllowedStorageSchemes() {
  $available = array_keys(\Drupal::service('stream_wrapper_manager')
    ->getWrappers(StreamWrapperInterface::WRITE_VISIBLE));
  $allowed = \Drupal::config('fillpdf.settings')
    ->get('allowed_schemes') ?: [];
  return array_intersect($available, $allowed);
}