You are here

public function BlockEntityStorage::deleteBlocksForEntityType in Field as Block 8.2

Delete all blocks for an entity type.

Parameters

string $entity_type: The entity type.

File

src/BlockEntityStorage.php, line 108

Class

BlockEntityStorage
Class BlockEntityStorage.

Namespace

Drupal\fieldblock

Code

public function deleteBlocksForEntityType($entity_type) {
  $blocks = $this
    ->loadByProperties([
    'plugin' => "fieldblock:{$entity_type}",
  ]);
  $this
    ->delete($blocks);
}