Menu.php in Drupal 10
File
core/modules/system/src/Plugin/migrate/source/Menu.php
View source
<?php
namespace Drupal\system\Plugin\migrate\source;
use Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase;
class Menu extends DrupalSqlBase {
public function query() {
return $this
->select('menu_custom', 'm')
->fields('m');
}
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;
}
public function getIds() {
$ids['menu_name']['type'] = 'string';
return $ids;
}
}
Classes
Name |
Description |
Menu |
Drupal 6/7 menu source from database. |