You are here

class CsvParserForm in Feeds 8.3

The configuration form for the CSV parser.

Hierarchy

Expanded class hierarchy of CsvParserForm

1 file declares its use of CsvParserForm
CsvParserFormTest.php in tests/src/Unit/Feeds/Parser/Form/CsvParserFormTest.php

File

src/Feeds/Parser/Form/CsvParserForm.php, line 11

Namespace

Drupal\feeds\Feeds\Parser\Form
View source
class CsvParserForm extends ExternalPluginFormBase {

  /**
   * {@inheritdoc}
   */
  public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
    $form['delimiter'] = [
      '#type' => 'select',
      '#title' => $this
        ->t('Default delimiter'),
      '#description' => $this
        ->t('Default field delimiter.'),
      '#options' => [
        ',' => ',',
        ';' => ';',
        'TAB' => 'TAB',
        '|' => '|',
        '+' => '+',
      ],
      '#default_value' => $this->plugin
        ->getConfiguration('delimiter'),
    ];
    $form['no_headers'] = [
      '#type' => 'checkbox',
      '#title' => $this
        ->t('No headers'),
      '#description' => $this
        ->t("Check if the imported CSV file does not start with a header row. If checked, mapping sources must be named '0', '1', '2' etc."),
      '#default_value' => $this->plugin
        ->getConfiguration('no_headers'),
    ];
    return $form;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
CsvParserForm::buildConfigurationForm public function Form constructor. Overrides PluginFormInterface::buildConfigurationForm
DependencySerializationTrait::$_entityStorages protected property An array of entity type IDs keyed by the property name of their storages.
DependencySerializationTrait::$_serviceIds protected property An array of service IDs keyed by property name used for serialization.
DependencySerializationTrait::__sleep public function 1
DependencySerializationTrait::__wakeup public function 2
ExternalPluginFormBase::$plugin protected property The Feeds plugin.
ExternalPluginFormBase::setPlugin public function Sets the plugin for this object. Overrides PluginAwareInterface::setPlugin
ExternalPluginFormBase::submitConfigurationForm public function Form submission handler. Overrides PluginFormInterface::submitConfigurationForm 4
ExternalPluginFormBase::validateConfigurationForm public function Form validation handler. Overrides PluginFormInterface::validateConfigurationForm 5
StringTranslationTrait::$stringTranslation protected property The string translation service. 1
StringTranslationTrait::formatPlural protected function Formats a string containing a count of items.
StringTranslationTrait::getNumberOfPlurals protected function Returns the number of plurals supported by a given language.
StringTranslationTrait::getStringTranslation protected function Gets the string translation service.
StringTranslationTrait::setStringTranslation public function Sets the string translation service to use. 2
StringTranslationTrait::t protected function Translates a string to the current language or to a given language.