You are here

interface SubscriptionWidgetInterface in Simplenews 8

Same name and namespace in other branches
  1. 8.2 src/SubscriptionWidgetInterface.php \Drupal\simplenews\SubscriptionWidgetInterface
  2. 3.x src/SubscriptionWidgetInterface.php \Drupal\simplenews\SubscriptionWidgetInterface

Defines a widget used for the subscriptions field of a Subscriber.

Hierarchy

Expanded class hierarchy of SubscriptionWidgetInterface

All classes that implement SubscriptionWidgetInterface

1 file declares its use of SubscriptionWidgetInterface
SubscriptionWidget.php in src/Plugin/Field/FieldWidget/SubscriptionWidget.php

File

src/SubscriptionWidgetInterface.php, line 10

Namespace

Drupal\simplenews
View source
interface SubscriptionWidgetInterface extends WidgetInterface {

  /**
   * Set the newsletters available for selection.
   *
   * @param string[] $newsletter_ids
   *   Indexed array of newsletter IDs.
   */
  public function setAvailableNewsletterIds(array $newsletter_ids);

  /**
   * Hide the widget.
   *
   * Must be called before ::formElement().
   *
   * @param bool $set
   *   If FALSE, widget will not be hidden.
   */
  public function setHidden($set = TRUE);

  /**
   * Whether the widget is set to be hidden.
   *
   * @return bool
   *   Whether the widget is hidden.
   */
  public function isHidden();

  /**
   * Returns the IDs of the selected or deselected newsletters.
   *
   * @param array $form_state_value
   *   The value of the widget as returned by FormStateInterface::getValue().
   * @param bool $selected
   *   Whether to extract selected (TRUE) or deselected (FALSE) newsletter IDs.
   *
   * @return string[]
   *   IDs of selected/deselected newsletters.
   */
  public function extractNewsletterIds($form_state_value, $selected);

}

Members

Namesort descending Modifiers Type Description Overrides
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
PluginSettingsInterface::defaultSettings public static function Defines the default settings for this plugin. 1
PluginSettingsInterface::getSetting public function Returns the value of a setting, or its default value if absent. 1
PluginSettingsInterface::getSettings public function Returns the array of settings, including defaults for missing settings. 1
PluginSettingsInterface::onDependencyRemoval public function Informs the plugin that some configuration it depends on will be deleted. 1
PluginSettingsInterface::setSetting public function Sets the value of a setting for the plugin. 1
PluginSettingsInterface::setSettings public function Sets the settings for the plugin. 1
SubscriptionWidgetInterface::extractNewsletterIds public function Returns the IDs of the selected or deselected newsletters. 1
SubscriptionWidgetInterface::isHidden public function Whether the widget is set to be hidden. 1
SubscriptionWidgetInterface::setAvailableNewsletterIds public function Set the newsletters available for selection. 1
SubscriptionWidgetInterface::setHidden public function Hide the widget. 1
ThirdPartySettingsInterface::getThirdPartyProviders public function Gets the list of third parties that store information. 5
ThirdPartySettingsInterface::getThirdPartySetting public function Gets the value of a third-party setting. 5
ThirdPartySettingsInterface::getThirdPartySettings public function Gets all third-party settings of a given module. 5
ThirdPartySettingsInterface::setThirdPartySetting public function Sets the value of a third-party setting. 5
ThirdPartySettingsInterface::unsetThirdPartySetting public function Unsets a third-party setting. 5
WidgetBaseInterface::extractFormValues public function Extracts field values from submitted form values. 1
WidgetBaseInterface::flagErrors public function Reports field-level validation errors against actual form elements. 1
WidgetBaseInterface::form public function Creates a form element for a field. 1
WidgetBaseInterface::getWidgetState public static function Retrieves processing information about the widget from $form_state. 1
WidgetBaseInterface::setWidgetState public static function Stores processing information about the widget in $form_state. 1
WidgetInterface::errorElement public function Assigns a field-level validation error to the right widget sub-element. 1
WidgetInterface::formElement public function Returns the form for a single field widget. 22
WidgetInterface::isApplicable public static function Returns if the widget can be used for the provided field. 1
WidgetInterface::massageFormValues public function Massages the form values into the format expected for field values. 1
WidgetInterface::settingsForm public function Returns a form to configure settings for the widget. 1
WidgetInterface::settingsSummary public function Returns a short summary for the current widget settings. 1