class Menu

Same name in this branch
  1. 9 core/modules/system/src/Entity/Menu.php \Drupal\system\Entity\Menu
Same name and namespace in other branches
  1. 11.x core/modules/system/src/Entity/Menu.php \Drupal\system\Entity\Menu
  2. 11.x core/modules/system/src/Plugin/migrate/source/Menu.php \Drupal\system\Plugin\migrate\source\Menu
  3. 10 core/modules/system/src/Entity/Menu.php \Drupal\system\Entity\Menu
  4. 10 core/modules/system/src/Plugin/migrate/source/Menu.php \Drupal\system\Plugin\migrate\source\Menu
  5. 8.9.x core/modules/system/src/Entity/Menu.php \Drupal\system\Entity\Menu
  6. 8.9.x core/modules/system/src/Plugin/migrate/source/Menu.php \Drupal\system\Plugin\migrate\source\Menu

Drupal 6/7 menu source from database.

For available configuration keys, refer to the parent classes.

Plugin annotation


@MigrateSource(
  id = "menu",
  source_module = "menu"
)

Hierarchy

Expanded class hierarchy of Menu

See also

\Drupal\migrate\Plugin\migrate\source\SqlBase

\Drupal\migrate\Plugin\migrate\source\SourcePluginBase

1 file declares its use of Menu
MenuTranslation.php in core/modules/system/src/Plugin/migrate/source/d7/MenuTranslation.php
70 string references to 'Menu'
BlockPluginId::transform in core/modules/block/src/Plugin/migrate/process/BlockPluginId.php
Set the block plugin id.
ConfigEntityMapper::getContextualLinkGroup in core/modules/config_translation/src/ConfigEntityMapper.php
Returns the name of the contextual link group to add contextual links to.
core.services.yml in core/core.services.yml
core/core.services.yml
d6_block.yml in core/modules/block/migrations/d6_block.yml
core/modules/block/migrations/d6_block.yml
d6_menu.yml in core/modules/system/migrations/d6_menu.yml
core/modules/system/migrations/d6_menu.yml

... See full list

File

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

Namespace

Drupal\system\Plugin\migrate\source
View source
class Menu extends DrupalSqlBase {
  
  /**
   * {@inheritdoc}
   */
  public function query() {
    return $this->select('menu_custom', 'm')
      ->fields('m');
  }
  
  /**
   * {@inheritdoc}
   */
  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;
  }
  
  /**
   * {@inheritdoc}
   */
  public function getIds() {
    $ids['menu_name']['type'] = 'string';
    return $ids;
  }

}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.