You are here

public function MenuPositionRule::postSave in Menu Position 8

Rebuild routes to create menu links.

Overrides EntityBase::postSave

File

src/Entity/MenuPositionRule.php, line 361

Class

MenuPositionRule
Defines the MenuPositionRule entity.

Namespace

Drupal\menu_position\Entity

Code

public function postSave(EntityStorageInterface $storage, $update = TRUE) {
  parent::postSave($storage, $update);
  if ($this
    ->isSyncing()) {

    // Rebuild menu position links when new rule is created.
    \Drupal::service('router.builder')
      ->setRebuildNeeded();
  }
}