Same name and namespace in other branches
  1. 8.9.x core/modules/views/src/Plugin/views/ViewsPluginInterface.php \Drupal\views\Plugin\views\ViewsPluginInterface
  2. 9 core/modules/views/src/Plugin/views/ViewsPluginInterface.php \Drupal\views\Plugin\views\ViewsPluginInterface

Provides an interface for all views plugins.

Hierarchy

Expanded class hierarchy of ViewsPluginInterface

All classes that implement ViewsPluginInterface

1 file declares its use of ViewsPluginInterface
ExposedFormPluginInterface.php in core/modules/views/src/Plugin/views/exposed_form/ExposedFormPluginInterface.php

File

core/modules/views/src/Plugin/views/ViewsPluginInterface.php, line 15

Namespace

Drupal\views\Plugin\views
View source
interface ViewsPluginInterface extends PluginInspectionInterface, DerivativeInspectionInterface, ContainerFactoryPluginInterface {

  /**
   * Returns the plugin provider.
   *
   * @return string
   */
  public function getProvider();

  /**
   * Return the human readable name of the display.
   *
   * This appears on the ui beside each plugin and beside the settings link.
   */
  public function pluginTitle();

  /**
   * Returns the usesOptions property.
   */
  public function usesOptions();

  /**
   * Filter out stored options depending on the defined options.
   *
   * @param array $storage
   *   The stored options.
   */
  public function filterByDefinedOptions(array &$storage);

  /**
   * Validate the options form.
   */
  public function validateOptionsForm(&$form, FormStateInterface $form_state);

  /**
   * Returns the summary of the settings in the display.
   */
  public function summaryTitle();

  /**
   * Moves form elements into fieldsets for presentation purposes.
   *
   * Many views forms use #tree = TRUE to keep their values in a hierarchy for
   * easier storage. Moving the form elements into fieldsets during form
   * building would break up that hierarchy. Therefore, we wait until the
   * pre_render stage, where any changes we make affect presentation only and
   * aren't reflected in $form_state->getValues().
   *
   * @param array $form
   *   The form build array to alter.
   *
   * @return array
   *   The form build array.
   */
  public static function preRenderAddFieldsetMarkup(array $form);

  /**
   * Initialize the plugin.
   *
   * @param \Drupal\views\ViewExecutable $view
   *   The view object.
   * @param \Drupal\views\Plugin\views\display\DisplayPluginBase $display
   *   The display handler.
   * @param array $options
   *   The options configured for this plugin.
   */
  public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL);

  /**
   * Handle any special handling on the validate form.
   */
  public function submitOptionsForm(&$form, FormStateInterface $form_state);

  /**
   * Adds elements for available core tokens to a form.
   *
   * @param array $form
   *   The form array to alter, passed by reference.
   * @param \Drupal\Core\Form\FormStateInterface $form_state
   *   The current state of the form.
   */
  public function globalTokenForm(&$form, FormStateInterface $form_state);

  /**
   * Returns an array of available token replacements.
   *
   * @param bool $prepared
   *   Whether to return the raw token info for each token or an array of
   *   prepared tokens for each type. E.g. "[view:name]".
   * @param array $types
   *   An array of additional token types to return, defaults to 'site' and
   *   'view'.
   *
   * @return array
   *   An array of available token replacement info or tokens, grouped by type.
   */
  public function getAvailableGlobalTokens($prepared = FALSE, array $types = []);

  /**
   * Flattens the structure of form elements.
   *
   * If a form element has #flatten = TRUE, then all of its children get moved
   * to the same level as the element itself. So $form['to_be_flattened'][$key]
   * becomes $form[$key], and $form['to_be_flattened'] gets unset.
   *
   * @param array $form
   *   The form build array to alter.
   *
   * @return array
   *   The form build array.
   */
  public static function preRenderFlattenData($form);

  /**
   * Returns a string with any core tokens replaced.
   *
   * @param string $string
   *   The string to preform the token replacement on.
   * @param array $options
   *   An array of options, as passed to \Drupal\Core\Utility\Token::replace().
   *
   * @return string
   *   The tokenized string.
   */
  public function globalTokenReplace($string = '', array $options = []);

  /**
   * Clears a plugin.
   */
  public function destroy();

  /**
   * Validate that the plugin is correct and can be saved.
   *
   * @return array|null
   *   An array of error strings to tell the user what is wrong with this
   *   plugin.
   */
  public function validate();

  /**
   * Add anything to the query that we might need to.
   */
  public function query();

  /**
   * Unpacks options over our existing defaults.
   *
   * This will drill down into arrays so that defaults don't get totally blown
   * away.
   */
  public function unpackOptions(&$storage, $options, $definition = NULL, $all = TRUE, $check = TRUE);

  /**
   * Provide a form to edit options for this plugin.
   */
  public function buildOptionsForm(&$form, FormStateInterface $form_state);

  /**
   * Provide a full list of possible theme templates used by this style.
   */
  public function themeFunctions();

}

Members

Namesort descending Modifiers Type Description Overrides
ContainerFactoryPluginInterface::create public static function Creates an instance of the plugin. 59
DerivativeInspectionInterface::getBaseId public function Gets the base_plugin_id of the plugin instance. 1
DerivativeInspectionInterface::getDerivativeId public function Gets the derivative_id of the plugin instance. 1
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
ViewsPluginInterface::buildOptionsForm public function Provide a form to edit options for this plugin. 2
ViewsPluginInterface::destroy public function Clears a plugin.
ViewsPluginInterface::filterByDefinedOptions public function Filter out stored options depending on the defined options.
ViewsPluginInterface::getAvailableGlobalTokens public function Returns an array of available token replacements.
ViewsPluginInterface::getProvider public function Returns the plugin provider.
ViewsPluginInterface::globalTokenForm public function Adds elements for available core tokens to a form.
ViewsPluginInterface::globalTokenReplace public function Returns a string with any core tokens replaced.
ViewsPluginInterface::init public function Initialize the plugin. 3
ViewsPluginInterface::pluginTitle public function Return the human readable name of the display.
ViewsPluginInterface::preRenderAddFieldsetMarkup public static function Moves form elements into fieldsets for presentation purposes.
ViewsPluginInterface::preRenderFlattenData public static function Flattens the structure of form elements.
ViewsPluginInterface::query public function Add anything to the query that we might need to. 4
ViewsPluginInterface::submitOptionsForm public function Handle any special handling on the validate form.
ViewsPluginInterface::summaryTitle public function Returns the summary of the settings in the display.
ViewsPluginInterface::themeFunctions public function Provide a full list of possible theme templates used by this style.
ViewsPluginInterface::unpackOptions public function Unpacks options over our existing defaults.
ViewsPluginInterface::usesOptions public function Returns the usesOptions property.
ViewsPluginInterface::validate public function Validate that the plugin is correct and can be saved.
ViewsPluginInterface::validateOptionsForm public function Validate the options form.