You are here

public function TaxonomyMenu::delete in Taxonomy menu 8.3

Deletes an entity permanently.

Throws

\Drupal\Core\Entity\EntityStorageException In case of failures an exception is thrown.

Overrides EntityBase::delete

File

src/Entity/TaxonomyMenu.php, line 188

Class

TaxonomyMenu
Defines the TaxonomyMenu entity.

Namespace

Drupal\taxonomy_menu\Entity

Code

public function delete() {
  foreach (array_keys($this
    ->getLinks([], TRUE)) as $link_key) {
    $this
      ->getMenuLinkManager()
      ->removeDefinition($link_key, FALSE);
  }
  parent::delete();
}