You are here

public function BusinessRulesItemBase::delete in Business Rules 8

Same name and namespace in other branches
  1. 2.x src/Entity/BusinessRulesItemBase.php \Drupal\business_rules\Entity\BusinessRulesItemBase::delete()

Deletes an entity permanently.

Throws

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

Overrides EntityBase::delete

File

src/Entity/BusinessRulesItemBase.php, line 319

Class

BusinessRulesItemBase
Class Item.

Namespace

Drupal\business_rules\Entity

Code

public function delete() {
  parent::delete();
  if (!$this
    ->isNew()) {

    // Dispatch an event about the item deletion.
    $event = new BusinessRulesEvent($this);
    $this->eventDispatcher
      ->dispatch('business_rules.item_pos_delete', $event);
  }
}