You are here

interface RecipientTypeInterface in Workbench Email 8

Same name and namespace in other branches
  1. 2.x src/Plugin/RecipientTypeInterface.php \Drupal\workbench_email\Plugin\RecipientTypeInterface

Defines the interface for Recipient type plugins.

TODO Docs.

Hierarchy

Expanded class hierarchy of RecipientTypeInterface

All classes that implement RecipientTypeInterface

See also

\Drupal\workbench_email\Annotation\RecipientType

\Drupal\workbench_email\RecipientTypePluginManager

\Drupal\workbench_email\Plugin\RecipientTypeBase

Plugin API

1 file declares its use of RecipientTypeInterface
Template.php in src/Entity/Template.php

File

src/Plugin/RecipientTypeInterface.php, line 24

Namespace

Drupal\workbench_email\Plugin
View source
interface RecipientTypeInterface extends ConfigurableInterface, PluginInspectionInterface, PluginWithFormsInterface, PluginFormInterface, DependentPluginInterface {

  /**
   * Returns the administrative label for this recipient type plugin.
   *
   * @return string
   *   The label.
   */
  public function getLabel();

  /**
   * Returns the administrative description for this recipient type plugin.
   *
   * @return string
   *   The description.
   */
  public function getDescription();

  /**
   * Generates a recipient types's settings form.
   *
   * @param array $form
   *   A minimally prepopulated form array.
   * @param \Drupal\Core\Form\FormStateInterface $form_state
   *   The state of the (entire) configuration form.
   *
   * @return array
   *   The $form array with additional form elements for the settings of this
   *   recipient type. The submitted form values should match $this->settings.
   */
  public function buildConfigurationForm(array $form, FormStateInterface $form_state);

  /**
   * Returns email address(s) matching this recipient type's configuration.
   *
   * @param \Drupal\Core\Entity\ContentEntityInterface $entity
   *   Entity being transitioned.
   * @param \Drupal\workbench_email\TemplateInterface $template
   *   Template being used.
   */
  public function prepareRecipients(ContentEntityInterface $entity, TemplateInterface $template);

  /**
   * Checks status.
   *
   * @return bool
   *   TRUE if enabled.
   */
  public function isEnabled();

  /**
   * Informs the plugin that a dependency of the recipient type will be deleted.
   *
   * @param array $dependencies
   *   An array of dependencies that will be deleted keyed by dependency type.
   *
   * @return bool
   *   TRUE if the template settings have been changed.
   *
   * @see \Drupal\Core\Config\ConfigEntityInterface::onDependencyRemoval()
   *
   * @todo https://www.drupal.org/node/2579743 make part of a generic interface.
   */
  public function onDependencyRemoval(array $dependencies);

}

Members

Namesort descending Modifiers Type Description Overrides
ConfigurableInterface::defaultConfiguration public function Gets default configuration for this plugin. 11
ConfigurableInterface::getConfiguration public function Gets this plugin's configuration. 12
ConfigurableInterface::setConfiguration public function Sets the configuration for this plugin instance. 12
DependentPluginInterface::calculateDependencies public function Calculates dependencies for the configured plugin. 19
PluginFormInterface::submitConfigurationForm public function Form submission handler. 32
PluginFormInterface::validateConfigurationForm public function Form validation handler. 18
PluginInspectionInterface::getPluginDefinition public function Gets the definition of the plugin implementation. 4
PluginInspectionInterface::getPluginId public function Gets the plugin_id of the plugin instance. 2
PluginWithFormsInterface::getFormClass public function Gets the form class for the given operation.
PluginWithFormsInterface::hasFormClass public function Gets whether the plugin has a form class for the given operation.
RecipientTypeInterface::buildConfigurationForm public function Generates a recipient types's settings form. Overrides PluginFormInterface::buildConfigurationForm 1
RecipientTypeInterface::getDescription public function Returns the administrative description for this recipient type plugin. 1
RecipientTypeInterface::getLabel public function Returns the administrative label for this recipient type plugin. 1
RecipientTypeInterface::isEnabled public function Checks status. 1
RecipientTypeInterface::onDependencyRemoval public function Informs the plugin that a dependency of the recipient type will be deleted. 1
RecipientTypeInterface::prepareRecipients public function Returns email address(s) matching this recipient type's configuration. 1