You are here

public function MenuLinkBinding::build in Drupal 7 to 8/9 Module Upgrader 8

Builds the link definition.

Return value

array

Overrides LinkBinding::build

File

src/Routing/LinkBinding/MenuLinkBinding.php, line 13

Class

MenuLinkBinding
Represents a standard menu link.

Namespace

Drupal\drupalmoduleupgrader\Routing\LinkBinding

Code

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;
}