You are here

public function BeerNode::fields in Migrate Plus 8

Same name and namespace in other branches
  1. 8.5 migrate_example/src/Plugin/migrate/source/BeerNode.php \Drupal\migrate_example\Plugin\migrate\source\BeerNode::fields()
  2. 8.2 migrate_example/src/Plugin/migrate/source/BeerNode.php \Drupal\migrate_example\Plugin\migrate\source\BeerNode::fields()
  3. 8.3 migrate_example/src/Plugin/migrate/source/BeerNode.php \Drupal\migrate_example\Plugin\migrate\source\BeerNode::fields()
  4. 8.4 migrate_example/src/Plugin/migrate/source/BeerNode.php \Drupal\migrate_example\Plugin\migrate\source\BeerNode::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/BeerNode.php, line 47
Contains \Drupal\migrate_example\Plugin\migrate\source\BeerNode.

Class

BeerNode
Source plugin for beer content.

Namespace

Drupal\migrate_example\Plugin\migrate\source

Code

public function fields() {
  $fields = [
    'bid' => $this
      ->t('Beer ID'),
    'name' => $this
      ->t('Name of beer'),
    'body' => $this
      ->t('Full description of the beer'),
    'excerpt' => $this
      ->t('Abstract for this beer'),
    'aid' => $this
      ->t('Account ID of the author'),
    'countries' => $this
      ->t('Countries of origin. Multiple values, delimited by pipe'),
    'image' => $this
      ->t('Image path'),
    'image_alt' => $this
      ->t('Image ALT'),
    'image_title' => $this
      ->t('Image title'),
    'image_description' => $this
      ->t('Image description'),
    // Note that this field is not part of the query above - it is populated
    // by prepareRow() below. You should document all source properties that
    // are available for mapping after prepareRow() is called.
    'terms' => $this
      ->t('Applicable styles'),
  ];
  return $fields;
}