You are here

YamlFormTableSort.php in YAML Form 8

File

src/Plugin/YamlFormElement/YamlFormTableSort.php
View source
<?php

namespace Drupal\yamlform\Plugin\YamlFormElement;


/**
 * Provides a 'yamlform_table_sort' element.
 *
 * @YamlFormElement(
 *   id = "yamlform_table_sort",
 *   label = @Translation("Table sort"),
 *   category = @Translation("Options elements"),
 *   multiple = TRUE,
 *   states_wrapper = TRUE,
 * )
 */
class YamlFormTableSort extends OptionsBase {
  use YamlFormTableTrait;

  /**
   * {@inheritdoc}
   */
  protected $exportDelta = TRUE;

  /**
   * {@inheritdoc}
   */
  public function getDefaultProperties() {
    $properties = parent::getDefaultProperties();
    unset($properties['options_randomize']);
    return $properties;
  }

  /**
   * {@inheritdoc}
   */
  public function hasMultipleValues(array $element) {
    return TRUE;
  }

  /**
   * {@inheritdoc}
   */
  public function getDefaultFormat() {
    return 'ol';
  }

  /**
   * {@inheritdoc}
   */
  public function getElementSelectorOptions(array $element) {
    return [];
  }

}

Classes

Namesort descending Description
YamlFormTableSort Provides a 'yamlform_table_sort' element.