function InlineBlockUsage::addUsage
Adds a usage record.
Parameters
int $block_content_id: The block content ID.
\Drupal\Core\Entity\EntityInterface $entity: The layout entity.
Overrides InlineBlockUsageInterface::addUsage
File
- 
              core/
modules/ layout_builder/ src/ InlineBlockUsage.php, line 33  
Class
- InlineBlockUsage
 - Service class to track inline block usage.
 
Namespace
Drupal\layout_builderCode
public function addUsage($block_content_id, EntityInterface $entity) {
  $this->database
    ->merge('inline_block_usage')
    ->keys([
    'block_content_id' => $block_content_id,
    'layout_entity_id' => $entity->id(),
    'layout_entity_type' => $entity->getEntityTypeId(),
  ])
    ->execute();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.