You are here

public function Menu::fields in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/system/src/Plugin/migrate/source/Menu.php \Drupal\system\Plugin\migrate\source\Menu::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

1 call to Menu::fields()
MenuTranslation::fields in core/modules/system/src/Plugin/migrate/source/d7/MenuTranslation.php
Returns available fields on the source.
1 method overrides Menu::fields()
MenuTranslation::fields in core/modules/system/src/Plugin/migrate/source/d7/MenuTranslation.php
Returns available fields on the source.

File

core/modules/system/src/Plugin/migrate/source/Menu.php, line 32

Class

Menu
Drupal 6/7 menu source from database.

Namespace

Drupal\system\Plugin\migrate\source

Code

public function fields() {
  $fields = [
    'menu_name' => $this
      ->t('The menu name. Primary key.'),
    'title' => $this
      ->t('The human-readable name of the menu.'),
    'description' => $this
      ->t('A description of the menu'),
  ];
  if ($this->database
    ->schema()
    ->fieldExists('menu_custom', 'language')) {
    $fields += [
      'language' => $this
        ->t('Menu language.'),
      'i8n_mode' => $this
        ->t('Menu i18n mode.'),
    ];
  }
  return $fields;
}