ticket-8.x-1.x-dev/src/Plugin/Field/FieldWidget/RegistrationTypeWidget.php

src/Plugin/Field/FieldWidget/RegistrationTypeWidget.php
<?php

namespace Drupal\ticket\Plugin\Field\FieldWidget;

use Drupal\Core\Field\FieldItemListInterface;
use Drupal\Core\Field\WidgetBase;
use Drupal\Core\Form\FormStateInterface;

/**
 * A widget to display the  form.
 *
 * @FieldWidget(
 *   id = "registration_type_widget",
 *   label = @Translation("Registration Type Widget"),
 *   description = @Translation("A field widget for embedded Registration Types."),
 *   field_types = {
 *     "registration_type_config",
 *   },
 *   multiple_values = FALSE,
 * )
 *
 * @internal
 *   Plugin classes are internal.
 */
class RegistrationTypeWidget extends WidgetBase {

  /**
   * {@inheritdoc}
   */
  public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) {
    /*
    $element += [
      '#type' => 'registration_type_config',
      '#config' => $this->get($form_state),
    ];
    */
    return $element;
  }

  /**
   * {@inheritdoc}

  public function extractFormValues(FieldItemListInterface $items, array $form, FormStateInterface $form_state) {
    // @todo This isn't resilient to being set twice, during validation and
    //   save https://www.drupal.org/project/drupal/issues/2833682.
    if (!$form_state->isValidationComplete()) {
      return;
    }

    $items->setValue($this->getSectionStorage($form_state)->getSections());
  }
   */
}

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

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