You are here

public function BeerTerm::fields in Migrate Plus 8.2

Same name and namespace in other branches
  1. 8.5 migrate_example/src/Plugin/migrate/source/BeerTerm.php \Drupal\migrate_example\Plugin\migrate\source\BeerTerm::fields()
  2. 8 migrate_example/src/Plugin/migrate/source/BeerTerm.php \Drupal\migrate_example\Plugin\migrate\source\BeerTerm::fields()
  3. 8.3 migrate_example/src/Plugin/migrate/source/BeerTerm.php \Drupal\migrate_example\Plugin\migrate\source\BeerTerm::fields()
  4. 8.4 migrate_example/src/Plugin/migrate/source/BeerTerm.php \Drupal\migrate_example\Plugin\migrate\source\BeerTerm::fields()

Returns available fields on the source.

Return value

array Available fields in the source, keys are the field machine names as used in field mappings, values are descriptions.

Overrides MigrateSourceInterface::fields

File

migrate_example/src/Plugin/migrate/source/BeerTerm.php, line 45

Class

BeerTerm
This is an example of a simple SQL-based source plugin. Source plugins are classes which deliver source data to the processing pipeline. For SQL sources, the SqlBase class provides most of the functionality needed - for a specific migration, you are…

Namespace

Drupal\migrate_example\Plugin\migrate\source

Code

public function fields() {

  /**
   * This method simply documents the available source fields provided by
   * the source plugin, for use by front-end tools. It returns an array keyed
   * by field/column name, with the value being a translated string explaining
   * to humans what the field represents. You should always
   */
  $fields = [
    'style' => $this
      ->t('Account ID'),
    'details' => $this
      ->t('Blocked/Allowed'),
    'style_parent' => $this
      ->t('Registered date'),
    // These values are not currently migrated - it's OK to skip fields you
    // don't need.
    'region' => $this
      ->t('Region the style is associated with'),
    'hoppiness' => $this
      ->t('Hoppiness of the style'),
  ];
  return $fields;
}