class MenuLinkBinding in Drupal 7 to 8/9 Module Upgrader 8
Represents a standard menu link.
Hierarchy
- class \Drupal\drupalmoduleupgrader\Routing\LinkBinding\LinkBinding
- class \Drupal\drupalmoduleupgrader\Routing\LinkBinding\MenuLinkBinding
Expanded class hierarchy of MenuLinkBinding
File
- src/
Routing/ LinkBinding/ MenuLinkBinding.php, line 8
Namespace
Drupal\drupalmoduleupgrader\Routing\LinkBindingView source
class MenuLinkBinding extends LinkBinding {
/**
* {@inheritdoc}
*/
public function build() {
$link = parent::build();
$source = $this
->getSource();
if ($source
->containsKey('description')) {
$link['description'] = $source['description'];
}
$destination = $this
->getDestination();
if ($destination
->hasParent()) {
$link['parent'] = $destination
->getParent()
->getIdentifier();
}
return $link;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
LinkBinding:: |
protected | property | ||
LinkBinding:: |
protected | property | The link ID. | |
LinkBinding:: |
protected | property | Index of all other links of this type. | |
LinkBinding:: |
protected | property | ||
LinkBinding:: |
public | function | Returns the Drupal 8 route in this binding. | |
LinkBinding:: |
public | function | Returns the link's plugin ID. | |
LinkBinding:: |
public | function | Returns the Drupal 7 route in this binding. | |
LinkBinding:: |
public | function | React when the binding is added to an index. | |
LinkBinding:: |
public | function | Constructs a LinkBinding object. | 1 |
MenuLinkBinding:: |
public | function |
Builds the link definition. Overrides LinkBinding:: |