function InlineBlockUsage::getUsage

Same name in other branches
  1. 8.9.x core/modules/layout_builder/src/InlineBlockUsage.php \Drupal\layout_builder\InlineBlockUsage::getUsage()
  2. 10 core/modules/layout_builder/src/InlineBlockUsage.php \Drupal\layout_builder\InlineBlockUsage::getUsage()
  3. 11.x core/modules/layout_builder/src/InlineBlockUsage.php \Drupal\layout_builder\InlineBlockUsage::getUsage()

Overrides InlineBlockUsageInterface::getUsage

File

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

Class

InlineBlockUsage
Service class to track inline block usage.

Namespace

Drupal\layout_builder

Code

public function getUsage($block_content_id) {
    $query = $this->database
        ->select('inline_block_usage');
    $query->condition('block_content_id', $block_content_id);
    $query->fields('inline_block_usage', [
        'layout_entity_id',
        'layout_entity_type',
    ]);
    $query->range(0, 1);
    return $query->execute()
        ->fetchObject();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.