You are here

protected function QueryPathXmlParser::configFormTableColumn in Feeds extensible parsers 8

Returns a form element for a specific column.

Parameters

\Drupal\Core\Form\FormStateInterface $form_state: The current form state.

array $values: The individual source item values.

string $column: The name of the column.

string $machine_name: The machine name of the source.

Return value

array A single form element.

Overrides XmlParser::configFormTableColumn

File

src/Feeds/Parser/QueryPathXmlParser.php, line 141

Class

QueryPathXmlParser
Defines a XML parser using QueryPath.

Namespace

Drupal\feeds_ex\Feeds\Parser

Code

protected function configFormTableColumn(FormStateInterface $form_state, array $values, $column, $machine_name) {
  switch ($column) {
    case 'attribute':
      return [
        '#type' => 'textfield',
        '#title' => $this
          ->t('Attribute name'),
        '#title_display' => 'invisible',
        '#default_value' => !empty($values['attribute']) ? $values['attribute'] : '',
        '#size' => 10,
        '#maxlength' => 1024,
      ];
    default:
      return parent::configFormTableColumn($form_state, $values, $column, $machine_name);
  }
}