You are here

FillPdfActionPluginInterface.php in FillPDF 8.4

Same filename and directory in other branches
  1. 5.0.x src/Plugin/FillPdfActionPluginInterface.php

File

src/Plugin/FillPdfActionPluginInterface.php
View source
<?php

namespace Drupal\fillpdf\Plugin;

use Drupal\Component\Plugin\DependentPluginInterface;
use Drupal\Component\Plugin\PluginInspectionInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\Core\Executable\ExecutableInterface;

/**
 * Defines an interface for FillPDF action plugins.
 *
 * Action plugins must ultimately return a
 * \Symfony\Component\HttpFoundation\Response. They may provide additional
 * methods to provide callers with additional plugin-specific metadata.
 *
 * They may also have side effects, such as saving a file to the file system.
 * They must not, however, end the request.
 *
 * @todo Extend ConfigurableInterface once drupal:8.6.x is no longer supported.
 */
interface FillPdfActionPluginInterface extends PluginInspectionInterface, DependentPluginInterface, ContainerFactoryPluginInterface, ExecutableInterface {

  /**
   * Take action according to the plugin configuration.
   *
   * This will vary for each action plugin, but it should do something with the
   * PDF (e.g. prepare a download response, save it to a file, etc.) and return
   * an appropriate Response (or subclass thereof, such as RedirectResponse) to
   * the caller.
   *
   * When you need context info, see if it is passed to you in
   * $this->configuration.
   *
   * @return \Symfony\Component\HttpFoundation\Response
   *   A response.
   *
   * @todo Document exceptions thrown if something goes wrong.
   */
  public function execute();

}

Interfaces

Namesort descending Description
FillPdfActionPluginInterface Defines an interface for FillPDF action plugins.