class Menu in Simple XML sitemap 8
Menu class.
Plugin annotation
@LinkGenerator(
id = "menu"
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\simplesitemap\LinkGeneratorBase implements LinkGeneratorInterface
- class \Drupal\simplesitemap\Plugin\LinkGenerator\Menu
- class \Drupal\simplesitemap\LinkGeneratorBase implements LinkGeneratorInterface
Expanded class hierarchy of Menu
File
- src/
Plugin/ LinkGenerator/ Menu.php, line 21 - Contains \Drupal\simplesitemap\LinkGenerator\Menu.
Namespace
Drupal\simplesitemap\Plugin\LinkGeneratorView source
class Menu extends LinkGeneratorBase {
/**
* {@inheritdoc}
*/
function get_paths($bundle) {
$routes = db_query("SELECT mlid, route_name, route_parameters, options FROM {menu_tree} WHERE menu_name = :menu_name and enabled = 1", array(
':menu_name' => $bundle,
))
->fetchAllAssoc('mlid');
$paths = array();
foreach ($routes as $id => $entity) {
if (empty($entity->route_name)) {
continue;
}
//todo: There may be a better way to do this.
$options = !empty($options = unserialize($entity->options)) ? $options : array();
$route_parameters = !empty($route_parameters = unserialize($entity->route_parameters)) ? array(
key($route_parameters) => $route_parameters[key($route_parameters)],
) : array();
$paths[$id]['path_data'] = $this
->get_multilang_urls_from_route($entity->route_name, $route_parameters, $options);
//todo: Implement lastmod for menu items.
}
return $paths;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
LinkGeneratorBase:: |
private | property | ||
LinkGeneratorBase:: |
private | property | ||
LinkGeneratorBase:: |
protected | property | ||
LinkGeneratorBase:: |
private | property | ||
LinkGeneratorBase:: |
protected | property | ||
LinkGeneratorBase:: |
protected | function | Checks if anonymous users have access to a given path. | |
LinkGeneratorBase:: |
constant | |||
LinkGeneratorBase:: |
public | function |
Overrides LinkGeneratorInterface:: |
|
LinkGeneratorBase:: |
protected | function | Wrapper function for Drupal\Core\Url::fromRoute. Returns url data for every language. | |
LinkGeneratorBase:: |
protected | function | Wrapper function for Drupal\Core\Url::fromUserInput. Returns url data for every language. | |
LinkGeneratorBase:: |
constant | |||
LinkGeneratorBase:: |
constant | |||
LinkGeneratorBase:: |
protected | function | Logs and displays an error. | |
LinkGeneratorBase:: |
function |
Constructs a \Drupal\Component\Plugin\PluginBase object. Overrides PluginBase:: |
||
Menu:: |
function |
Returns an array of all urls and their data of a bundle. Overrides LinkGeneratorBase:: |
||
PluginBase:: |
protected | property | Configuration information passed into the plugin. | 1 |
PluginBase:: |
protected | property | The plugin implementation definition. | 1 |
PluginBase:: |
protected | property | The plugin_id. | |
PluginBase:: |
constant | A string which is used to separate base plugin IDs from the derivative ID. | ||
PluginBase:: |
public | function |
Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the definition of the plugin implementation. Overrides PluginInspectionInterface:: |
3 |
PluginBase:: |
public | function |
Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface:: |
|
PluginBase:: |
public | function | Determines if the plugin is configurable. |