You are here

public function SimpleAccessGroup::delete in Simple Access 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/SimpleAccessGroup.php, line 128

Class

SimpleAccessGroup
Defines the SimpleAccessGroup configuration entity class.

Namespace

Drupal\simple_access\Entity

Code

public function delete() {

  // Remove all records relating to this access group.
  \Drupal::database()
    ->delete('simple_access_node_group')
    ->condition('gid', $this
    ->id())
    ->execute();
  parent::delete();
}