Menu.php

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

Namespace

Drupal\system\Plugin\migrate\source

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;

/**
 * Menu source from database.
 *
 * @MigrateSource(
 *   id = "menu",
 *   source_module = "menu"
 * )
 */
class Menu extends DrupalSqlBase {
    
    /**
     * {@inheritdoc}
     */
    public function query() {
        return $this->select('menu_custom', 'm')
            ->fields('m');
    }
    
    /**
     * {@inheritdoc}
     */
    public function fields() {
        return [
            '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'),
        ];
    }
    
    /**
     * {@inheritdoc}
     */
    public function getIds() {
        $ids['menu_name']['type'] = 'string';
        return $ids;
    }

}

Classes

Title Deprecated Summary
Menu Menu source from database.

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