class CsvParserFeedForm in Feeds 8.3
Provides a form on the feed edit page for the CsvParser.
Hierarchy
- class \Drupal\feeds\Plugin\Type\ExternalPluginFormBase implements PluginFormInterface, PluginAwareInterface uses DependencySerializationTrait, StringTranslationTrait
- class \Drupal\feeds\Feeds\Parser\Form\CsvParserFeedForm
Expanded class hierarchy of CsvParserFeedForm
1 file declares its use of CsvParserFeedForm
- CsvParserFeedFormTest.php in tests/
src/ Unit/ Feeds/ Parser/ Form/ CsvParserFeedFormTest.php
File
- src/
Feeds/ Parser/ Form/ CsvParserFeedForm.php, line 12
Namespace
Drupal\feeds\Feeds\Parser\FormView source
class CsvParserFeedForm extends ExternalPluginFormBase {
/**
* {@inheritdoc}
*/
public function buildConfigurationForm(array $form, FormStateInterface $form_state, FeedInterface $feed = NULL) {
$feed_config = $feed
->getConfigurationFor($this->plugin);
$form['delimiter'] = [
'#type' => 'select',
'#title' => $this
->t('Delimiter'),
'#description' => $this
->t('The character that delimits fields in the CSV file.'),
'#options' => [
',' => ',',
';' => ';',
'TAB' => 'TAB',
'|' => '|',
'+' => '+',
],
'#default_value' => $feed_config['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' => $feed_config['no_headers'],
];
return $form;
}
/**
* {@inheritdoc}
*/
public function submitConfigurationForm(array &$form, FormStateInterface $form_state, FeedInterface $feed = NULL) {
$feed
->setConfigurationFor($this->plugin, $form_state
->getValues());
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CsvParserFeedForm:: |
public | function |
Form constructor. Overrides PluginFormInterface:: |
|
CsvParserFeedForm:: |
public | function |
Form submission handler. Overrides ExternalPluginFormBase:: |
|
DependencySerializationTrait:: |
protected | property | An array of entity type IDs keyed by the property name of their storages. | |
DependencySerializationTrait:: |
protected | property | An array of service IDs keyed by property name used for serialization. | |
DependencySerializationTrait:: |
public | function | 1 | |
DependencySerializationTrait:: |
public | function | 2 | |
ExternalPluginFormBase:: |
protected | property | The Feeds plugin. | |
ExternalPluginFormBase:: |
public | function |
Sets the plugin for this object. Overrides PluginAwareInterface:: |
|
ExternalPluginFormBase:: |
public | function |
Form validation handler. Overrides PluginFormInterface:: |
5 |
StringTranslationTrait:: |
protected | property | The string translation service. | 1 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. |