You are here

public function InviteType::delete in Invite 8

Deletes an entity permanently.

Throws

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

Overrides EntityBase::delete

File

src/Entity/InviteType.php, line 145

Class

InviteType
Defines the Invite type entity.

Namespace

Drupal\invite\Entity

Code

public function delete() {

  // Remove invite_sender records.
  InviteSender::load($this
    ->get('id'))
    ->delete();

  // Reload blocks.
  \Drupal::service('plugin.manager.block')
    ->clearCachedDefinitions();
  parent::delete();
}