You are here

public function InlineBlockUsage::getUnused in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/layout_builder/src/InlineBlockUsage.php \Drupal\layout_builder\InlineBlockUsage::getUnused()
  2. 9 core/modules/layout_builder/src/InlineBlockUsage.php \Drupal\layout_builder\InlineBlockUsage::getUnused()

File

core/modules/layout_builder/src/InlineBlockUsage.php, line 45

Class

InlineBlockUsage
Service class to track inline block usage.

Namespace

Drupal\layout_builder

Code

public function getUnused($limit = 100) {
  $query = $this->database
    ->select('inline_block_usage', 't');
  $query
    ->fields('t', [
    'block_content_id',
  ]);
  $query
    ->isNull('layout_entity_id');
  $query
    ->isNull('layout_entity_type');
  return $query
    ->range(0, $limit)
    ->execute()
    ->fetchCol();
}