Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
novicell/custom_forms / src / Plugin / CustomForms / SubmissionHandler / CustomFormsSubmissionHandlerBase.php
Size: Mime:
<?php

namespace Drupal\custom_forms\Plugin\CustomForms\SubmissionHandler;

use Drupal\Core\Plugin\PluginBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\custom_forms\CustomFormInterface;
use Drupal\custom_forms\Entity\CustomFormSubmissionHandlerInterface;
use Drupal\custom_forms\Entity\CustomFormSubmissionInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;

/**
 * Class CustomFormsSubmissionHandlerBase
 *
 * The base class for custom submission handler plugins, all group plugins must
 * extend this class to ensure they function properly.
 *
 * @package Drupal\custom_forms\Plugin\CustomForms\FieldType
 */
abstract class CustomFormsSubmissionHandlerBase extends PluginBase implements CustomFormsSubmissionHandlerInterface {

  /**
   * {@inheritdoc}
   */
  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
    return new static(
      $configuration,
      $plugin_id,
      $plugin_definition
    );
  }

  /**
   * {@inheritdoc}
   */
  public function buildSettingsForm(CustomFormInterface $custom_form, array $form, FormStateInterface $form_state) : array {
    return [];
  }

  /**
   * {@inheritdoc}
   */
  public function submitSettingsForm(CustomFormInterface $custom_form, array &$form, FormStateInterface $form_state): void {}

  /**
   * {@inheritdoc}
   */
  abstract public function executeHandler(CustomFormSubmissionInterface $submission, CustomFormSubmissionHandlerInterface $handler_entity): void;

}