function InlineBlockUsage::getUsage
Gets usage record for inline block by ID.
Parameters
int $block_content_id: The block content entity ID.
Return value
object The usage record with properties layout_entity_id and layout_entity_type.
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_builderCode
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.
