You are here

public function FillPdfAdminFormHelper::getFormsByTemplateScheme in FillPDF 5.0.x

Same name and namespace in other branches
  1. 8.4 src/Service/FillPdfAdminFormHelper.php \Drupal\fillpdf\Service\FillPdfAdminFormHelper::getFormsByTemplateScheme()

Returns all FillPdfForms with template PDFs stored in a particular scheme.

Return value

string Scheme of the templates PDFs.

Overrides FillPdfAdminFormHelperInterface::getFormsByTemplateScheme

File

src/Service/FillPdfAdminFormHelper.php, line 97

Class

FillPdfAdminFormHelper
Various helper methods used in FillPDF administrative forms.

Namespace

Drupal\fillpdf\Service

Code

public function getFormsByTemplateScheme($scheme) {
  $query = $this->connection
    ->query("SELECT u.id AS form_id, f.uri AS file_uri\n      FROM {file_usage} u INNER JOIN {file_managed} f ON u.fid = f.fid\n      WHERE (type = :type) AND (uri LIKE :scheme)", [
    ':type' => 'fillpdf_form',
    ':scheme' => "{$scheme}://%",
  ]);
  return $query
    ->fetchAllKeyed();
}