You are here

interface ConfigurationInterface in Synonyms 2.0.x

Interface of a configurable synonyms provider.

Hierarchy

Expanded class hierarchy of ConfigurationInterface

All classes that implement ConfigurationInterface

1 file declares its use of ConfigurationInterface
AbstractProvider.php in src/Plugin/Synonyms/Provider/AbstractProvider.php

File

src/ProviderInterface/ConfigurationInterface.php, line 12

Namespace

Drupal\synonyms\ProviderInterface
View source
interface ConfigurationInterface extends ProviderInterface, ConfigurableInterface {

  /**
   * Build configuration form.
   *
   * @param array $form
   *   Form into which your configuration form will be embedded. You are
   *   supposed to extend this array with additional configuration form elements
   *   that your provider needs.
   * @param \Drupal\Core\Form\FormStateInterface $form_state
   *   Form state object that corresponds to this form.
   * @param array $configuration
   *   Array of existing configuration for your provider. Normally you would use
   *   it as a source of default values for your configuration form elements.
   * @param \Drupal\synonyms\SynonymInterface $synonym_config
   *   Synonym config entity in the context of which the form is being built.
   *
   * @return array
   *   Extended $form that includes the form elements required for configuration
   *   of your provider
   */
  public function buildConfigurationForm(array $form, FormStateInterface $form_state, array $configuration, SynonymInterface $synonym_config);

  /**
   * Validate submitted values into your configuration form.
   *
   * @param array $form
   *   Your configuration form as it was built in
   *   static::buildConfigurationForm().
   * @param \Drupal\Core\Form\FormStateInterface $form_state
   *   Form state that corresponds to this form. You should rise form validation
   *   errors on this form state, should you discover any in user input.
   * @param \Drupal\synonyms\SynonymInterface $synonym_config
   *   Synonym config entity in the context of which the form is being built.
   */
  public function validateConfigurationForm(array &$form, FormStateInterface $form_state, SynonymInterface $synonym_config);

  /**
   * Process submitted values and generate new configuration.
   *
   * @param array $form
   *   Your configuration form as it was built in
   *   static::buildConfigurationForm().
   * @param \Drupal\Core\Form\FormStateInterface $form_state
   *   Form state that corresponds to this form.
   * @param \Drupal\synonyms\SynonymInterface $synonym_config
   *   Synonym config entity in the context of which the form is being built.
   *
   * @return array
   *   Array of new provider configuration that corresponds to the submitted
   *   values in the form
   */
  public function submitConfigurationForm(array &$form, FormStateInterface $form_state, SynonymInterface $synonym_config);

}

Members

Namesort descending Modifiers Type Description Overrides
ConfigurableInterface::defaultConfiguration public function Gets default configuration for this plugin. 14
ConfigurableInterface::getConfiguration public function Gets this plugin's configuration. 15
ConfigurableInterface::setConfiguration public function Sets the configuration for this plugin instance. 15
ConfigurationInterface::buildConfigurationForm public function Build configuration form.
ConfigurationInterface::submitConfigurationForm public function Process submitted values and generate new configuration.
ConfigurationInterface::validateConfigurationForm public function Validate submitted values into your configuration form.