You are here

interface YamlFormHandlerInterface in YAML Form 8

Defines the interface for form handlers.

Hierarchy

Expanded class hierarchy of YamlFormHandlerInterface

All classes that implement YamlFormHandlerInterface

See also

\Drupal\yamlform\Annotation\YamlFormHandler

\Drupal\yamlform\YamlFormHandlerBase

\Drupal\yamlform\YamlFormHandlerManager

\Drupal\yamlform\YamlFormHandlerManagerInterface

Plugin API

4 files declare their use of YamlFormHandlerInterface
YamlForm.php in src/Entity/YamlForm.php
YamlFormHandler.php in src/Annotation/YamlFormHandler.php
YamlFormHandlerFormBase.php in src/Form/YamlFormHandlerFormBase.php
YamlFormPluginHandlerController.php in src/Controller/YamlFormPluginHandlerController.php

File

src/YamlFormHandlerInterface.php, line 20

Namespace

Drupal\yamlform
View source
interface YamlFormHandlerInterface extends PluginInspectionInterface, ConfigurablePluginInterface, ContainerFactoryPluginInterface, PluginFormInterface {

  /**
   * Value indicating unlimited plugin instances are permitted.
   */
  const CARDINALITY_UNLIMITED = -1;

  /**
   * Value indicating a single plugin instances are permitted.
   */
  const CARDINALITY_SINGLE = 1;

  /**
   * Value indicating form submissions are not processed (ie email or saved) by the handler.
   */
  const RESULTS_IGNORED = 0;

  /**
   * Value indicating form submissions are processed (ie email or saved) by the handler.
   */
  const RESULTS_PROCESSED = 1;

  /**
   * Returns a render array summarizing the configuration of the form handler.
   *
   * @return array
   *   A render array.
   */
  public function getSummary();

  /**
   * Returns the form handler label.
   *
   * @return string
   *   The form handler label.
   */
  public function label();

  /**
   * Returns the form handler description.
   *
   * @return string
   *   The form handler description.
   */
  public function description();

  /**
   * Returns the form handler cardinality settings.
   *
   * @return string
   *   The form handler cardinality settings.
   */
  public function cardinality();

  /**
   * Returns the unique ID representing the form handler.
   *
   * @return string
   *   The form handler ID.
   */
  public function getHandlerId();

  /**
   * Sets the id for this form handler.
   *
   * @param int $handler_id
   *   The handler_id for this form handler.
   *
   * @return $this
   */
  public function setHandlerId($handler_id);

  /**
   * Returns the label of the form handler.
   *
   * @return int|string
   *   Either the integer label of the form handler, or an empty string.
   */
  public function getLabel();

  /**
   * Sets the label for this form handler.
   *
   * @param int $label
   *   The label for this form handler.
   *
   * @return $this
   */
  public function setLabel($label);

  /**
   * Returns the weight of the form handler.
   *
   * @return int|string
   *   Either the integer weight of the form handler, or an empty string.
   */
  public function getWeight();

  /**
   * Sets the weight for this form handler.
   *
   * @param int $weight
   *   The weight for this form handler.
   *
   * @return $this
   */
  public function setWeight($weight);

  /**
   * Returns the status of the form handler.
   *
   * @return bool
   *   The status of the form handler.
   */
  public function getStatus();

  /**
   * Sets the status for this form handler.
   *
   * @param bool $status
   *   The status for this form handler.
   *
   * @return $this
   */
  public function setStatus($status);

  /**
   * Returns the form handler enabled indicator.
   *
   * @return bool
   *   TRUE if the form handler is enabled.
   */
  public function isEnabled();

  /**
   * Returns the form handler disabled indicator.
   *
   * @return bool
   *   TRUE if the form handler is disabled.
   */
  public function isDisabled();

  /**
   * Alter form submission form elements.
   *
   * @param array $elements
   *   An associative array containing the form elements.
   * @param \Drupal\yamlform\YamlFormInterface $yamlform
   *   The form.
   */
  public function alterElements(array &$elements, YamlFormInterface $yamlform);

  /**
   * Alter form submission form .
   *
   * @param array $form
   *   An associative array containing the structure of the form.
   * @param \Drupal\Core\Form\FormStateInterface $form_state
   *   The current state of the form.
   * @param \Drupal\yamlform\YamlFormSubmissionInterface $yamlform_submission
   *   A form submission.
   */
  public function alterForm(array &$form, FormStateInterface $form_state, YamlFormSubmissionInterface $yamlform_submission);

  /**
   * Validate form submission form .
   *
   * @param array $form
   *   An associative array containing the structure of the form.
   * @param \Drupal\Core\Form\FormStateInterface $form_state
   *   The current state of the form.
   * @param \Drupal\yamlform\YamlFormSubmissionInterface $yamlform_submission
   *   A form submission.
   */
  public function validateForm(array &$form, FormStateInterface $form_state, YamlFormSubmissionInterface $yamlform_submission);

  /**
   * Submit form submission form.
   *
   * @param array $form
   *   An associative array containing the structure of the form.
   * @param \Drupal\Core\Form\FormStateInterface $form_state
   *   The current state of the form.
   * @param \Drupal\yamlform\YamlFormSubmissionInterface $yamlform_submission
   *   A form submission.
   */
  public function submitForm(array &$form, FormStateInterface $form_state, YamlFormSubmissionInterface $yamlform_submission);

  /**
   * Confirm form submission form.
   *
   * @param array $form
   *   An associative array containing the structure of the form.
   * @param \Drupal\Core\Form\FormStateInterface $form_state
   *   The current state of the form.
   * @param \Drupal\yamlform\YamlFormSubmissionInterface $yamlform_submission
   *   A form submission.
   */
  public function confirmForm(array &$form, FormStateInterface $form_state, YamlFormSubmissionInterface $yamlform_submission);

  /**
   * Changes the values of an entity before it is created.
   *
   * @param mixed[] $values
   *   An array of values to set, keyed by property name.
   */
  public function preCreate(array $values);

  /**
   * Acts on a form submission after it is created.
   *
   * @param \Drupal\yamlform\YamlFormSubmissionInterface $yamlform_submission
   *   A form submission.
   */
  public function postCreate(YamlFormSubmissionInterface $yamlform_submission);

  /**
   * Acts on loaded form submission.
   *
   * @param \Drupal\yamlform\YamlFormSubmissionInterface $yamlform_submission
   *   A form submission.
   */
  public function postLoad(YamlFormSubmissionInterface $yamlform_submission);

  /**
   * Acts on a form submission before the presave hook is invoked.
   *
   * @param \Drupal\yamlform\YamlFormSubmissionInterface $yamlform_submission
   *   A form submission.
   */
  public function preSave(YamlFormSubmissionInterface $yamlform_submission);

  /**
   * Acts on a saved form submission before the insert or update hook is invoked.
   *
   * @param \Drupal\yamlform\YamlFormSubmissionInterface $yamlform_submission
   *   A form submission.
   * @param bool $update
   *   TRUE if the entity has been updated, or FALSE if it has been inserted.
   */
  public function postSave(YamlFormSubmissionInterface $yamlform_submission, $update = TRUE);

  /**
   * Acts on a form submission before they are deleted and before hooks are invoked.
   *
   * Used before the entities are deleted and before invoking the delete hook.
   *
   * @param \Drupal\yamlform\YamlFormSubmissionInterface $yamlform_submission
   *   A form submission.
   */
  public function preDelete(YamlFormSubmissionInterface $yamlform_submission);

  /**
   * Acts on deleted a form submission before the delete hook is invoked.
   *
   * Used after the entities are deleted but before invoking the delete hook.
   *
   * @param \Drupal\yamlform\YamlFormSubmissionInterface $yamlform_submission
   *   A form submission.
   */
  public function postDelete(YamlFormSubmissionInterface $yamlform_submission);

}

Members

Namesort descending Modifiers Type Description Overrides
ConfigurablePluginInterface::defaultConfiguration public function Gets default configuration for this plugin. 1
ConfigurablePluginInterface::getConfiguration public function Gets this plugin's configuration. 1
ConfigurablePluginInterface::setConfiguration public function Sets the configuration for this plugin instance. 1
ContainerFactoryPluginInterface::create public static function Creates an instance of the plugin. 112
DependentPluginInterface::calculateDependencies public function Calculates dependencies for the configured plugin. 19
PluginFormInterface::buildConfigurationForm public function Form constructor. 36
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
YamlFormHandlerInterface::alterElements public function Alter form submission form elements. 1
YamlFormHandlerInterface::alterForm public function Alter form submission form . 1
YamlFormHandlerInterface::cardinality public function Returns the form handler cardinality settings. 1
YamlFormHandlerInterface::CARDINALITY_SINGLE constant Value indicating a single plugin instances are permitted.
YamlFormHandlerInterface::CARDINALITY_UNLIMITED constant Value indicating unlimited plugin instances are permitted.
YamlFormHandlerInterface::confirmForm public function Confirm form submission form. 1
YamlFormHandlerInterface::description public function Returns the form handler description. 1
YamlFormHandlerInterface::getHandlerId public function Returns the unique ID representing the form handler. 1
YamlFormHandlerInterface::getLabel public function Returns the label of the form handler. 1
YamlFormHandlerInterface::getStatus public function Returns the status of the form handler. 1
YamlFormHandlerInterface::getSummary public function Returns a render array summarizing the configuration of the form handler. 1
YamlFormHandlerInterface::getWeight public function Returns the weight of the form handler. 1
YamlFormHandlerInterface::isDisabled public function Returns the form handler disabled indicator. 1
YamlFormHandlerInterface::isEnabled public function Returns the form handler enabled indicator. 1
YamlFormHandlerInterface::label public function Returns the form handler label. 1
YamlFormHandlerInterface::postCreate public function Acts on a form submission after it is created. 1
YamlFormHandlerInterface::postDelete public function Acts on deleted a form submission before the delete hook is invoked. 1
YamlFormHandlerInterface::postLoad public function Acts on loaded form submission. 1
YamlFormHandlerInterface::postSave public function Acts on a saved form submission before the insert or update hook is invoked. 1
YamlFormHandlerInterface::preCreate public function Changes the values of an entity before it is created. 1
YamlFormHandlerInterface::preDelete public function Acts on a form submission before they are deleted and before hooks are invoked. 1
YamlFormHandlerInterface::preSave public function Acts on a form submission before the presave hook is invoked. 1
YamlFormHandlerInterface::RESULTS_IGNORED constant Value indicating form submissions are not processed (ie email or saved) by the handler.
YamlFormHandlerInterface::RESULTS_PROCESSED constant Value indicating form submissions are processed (ie email or saved) by the handler.
YamlFormHandlerInterface::setHandlerId public function Sets the id for this form handler. 1
YamlFormHandlerInterface::setLabel public function Sets the label for this form handler. 1
YamlFormHandlerInterface::setStatus public function Sets the status for this form handler. 1
YamlFormHandlerInterface::setWeight public function Sets the weight for this form handler. 1
YamlFormHandlerInterface::submitForm public function Submit form submission form. 1
YamlFormHandlerInterface::validateForm public function Validate form submission form . 1