You are here

public function MenuLinkItem::delete in Menu Link (Field) 8

Same name and namespace in other branches
  1. 2.0.x src/Plugin/Field/FieldType/MenuLinkItem.php \Drupal\menu_link\Plugin\Field\FieldType\MenuLinkItem::delete()

Defines custom delete behavior for field values.

This method is called during the process of deleting an entity, just before values are deleted from storage.

Overrides FieldItemBase::delete

File

src/Plugin/Field/FieldType/MenuLinkItem.php, line 215

Class

MenuLinkItem
Defines a menu link field type which stores the link, parent and menu.

Namespace

Drupal\menu_link\Plugin\Field\FieldType

Code

public function delete() {
  parent::delete();
  $plugin_id = $this
    ->getMenuPluginId();
  if ($this->menuPluginManager
    ->hasDefinition($plugin_id)) {
    $this->menuPluginManager
      ->removeDefinition($plugin_id, FALSE);
  }
}