You are here

public function Entity::delete in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Entity/Entity.php \Drupal\Core\Entity\Entity::delete()

Deletes an entity permanently.

Throws

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

Overrides EntityInterface::delete

2 calls to Entity::delete()
BlockContent::delete in core/modules/block_content/src/Entity/BlockContent.php
Deletes an entity permanently.
TaxonomyMenu::delete in modules/taxonomy_menu/src/Entity/TaxonomyMenu.php
Deletes an entity permanently.
2 methods override Entity::delete()
BlockContent::delete in core/modules/block_content/src/Entity/BlockContent.php
Deletes an entity permanently.
TaxonomyMenu::delete in modules/taxonomy_menu/src/Entity/TaxonomyMenu.php
Deletes an entity permanently.

File

core/lib/Drupal/Core/Entity/Entity.php, line 374
Contains \Drupal\Core\Entity\Entity.

Class

Entity
Defines a base entity class.

Namespace

Drupal\Core\Entity

Code

public function delete() {
  if (!$this
    ->isNew()) {
    $this
      ->entityManager()
      ->getStorage($this->entityTypeId)
      ->delete(array(
      $this
        ->id() => $this,
    ));
  }
}