marketo_suite-1.0.x-dev/src/Plugin/SubmissionBehaviorBase.php

src/Plugin/SubmissionBehaviorBase.php
<?php

namespace Drupal\e3_marketo\Plugin;

use Drupal\Component\Plugin\PluginBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\e3_marketo\Entity\MarketoFormEntityInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;

/**
 * Base class for SubmissionBehavior plugins.
 *
 * @ingroup e3_marketo
 */
abstract class SubmissionBehaviorBase extends PluginBase implements SubmissionBehaviorInterface {

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

  /**
   * {@inheritdoc}
   */
  public function getLabel() : string {
    return $this->pluginDefinition['label'];
  }

  /**
   * {@inheritdoc}
   */
  public function getDescription() : string {
    return $this->pluginDefinition['description'] ?? '';
  }

  /**
   * {@inheritdoc}
   */
  public function alterMarketoFormEntityForm(array $form, FormStateInterface $form_state) {
    // Nothing to do here.
  }

  /**
   * {@inheritdoc}
   */
  abstract public function getSubmissionCallbacks(MarketoFormEntityInterface $marketo_form = NULL, array $extra_data = []) : array;

}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc