You are here

public function LinkIndex::addBinding in Drupal 7 to 8/9 Module Upgrader 8

Adds a binding to this index.

Parameters

\Drupal\drupalmoduleupgrader\Routing\LinkBinding\LinkBinding $binding:

File

src/Routing/LinkIndex.php, line 25

Class

LinkIndex
Represents a set of link bindings of a single type (i.e., menu links, local tasks, etc.)

Namespace

Drupal\drupalmoduleupgrader\Routing

Code

public function addBinding(LinkBinding $binding) {
  $id = $binding
    ->getIdentifier();
  if (isset($this->idiotBox[$id])) {
    $id .= '_' . $this->idiotBox[$id]++;
  }
  else {
    $this->idiotBox[$id] = 0;
  }
  $this
    ->set($binding
    ->getSource()
    ->getPath()
    ->__toString(), $binding);
  $binding
    ->onIndexed($id, $this);
}