You are here

public function PdfBackendManager::getDefinitions in FillPDF 8.4

Same name and namespace in other branches
  1. 5.0.x src/Plugin/PdfBackendManager.php \Drupal\fillpdf\Plugin\PdfBackendManager::getDefinitions()

Gets the definitions of all FillPDF backend plugins.

Return value

mixed[] An associative array of plugin definitions, keyed by plugin ID and sorted by weight.

Overrides DefaultPluginManager::getDefinitions

File

src/Plugin/PdfBackendManager.php, line 40

Class

PdfBackendManager
Provides the FillPDF PdfBackend plugin manager.

Namespace

Drupal\fillpdf\Plugin

Code

public function getDefinitions() {

  // Get all plugin definitions of this type.
  $definitions = parent::getDefinitions();

  // Unset the legacy plugin provider.
  // @todo Remove in fillpdf:8.x-5.x.
  unset($definitions['legacy_provider']);

  // Sort plugins by weight.
  uasort($definitions, function ($a, $b) {
    return $a['weight'] - $b['weight'];
  });
  return $definitions;
}