interface InlineBlockUsageInterface

Same name in other branches
  1. 8.9.x core/modules/layout_builder/src/InlineBlockUsageInterface.php \Drupal\layout_builder\InlineBlockUsageInterface
  2. 10 core/modules/layout_builder/src/InlineBlockUsageInterface.php \Drupal\layout_builder\InlineBlockUsageInterface
  3. 11.x core/modules/layout_builder/src/InlineBlockUsageInterface.php \Drupal\layout_builder\InlineBlockUsageInterface

Defines an interface for tracking inline block usage.

Hierarchy

Expanded class hierarchy of InlineBlockUsageInterface

All classes that implement InlineBlockUsageInterface

1 file declares its use of InlineBlockUsageInterface
SetInlineBlockDependency.php in core/modules/layout_builder/src/EventSubscriber/SetInlineBlockDependency.php

File

core/modules/layout_builder/src/InlineBlockUsageInterface.php, line 10

Namespace

Drupal\layout_builder
View source
interface InlineBlockUsageInterface {
    
    /**
     * Adds a usage record.
     *
     * @param int $block_content_id
     *   The block content ID.
     * @param \Drupal\Core\Entity\EntityInterface $entity
     *   The layout entity.
     */
    public function addUsage($block_content_id, EntityInterface $entity);
    
    /**
     * Gets unused inline block IDs.
     *
     * @param int $limit
     *   The maximum number of block content entity IDs to return.
     *
     * @return int[]
     *   The entity IDs.
     */
    public function getUnused($limit = 100);
    
    /**
     * Remove usage record by layout entity.
     *
     * @param \Drupal\Core\Entity\EntityInterface $entity
     *   The layout entity.
     */
    public function removeByLayoutEntity(EntityInterface $entity);
    
    /**
     * Delete the inline blocks' the usage records.
     *
     * @param int[] $block_content_ids
     *   The block content entity IDs.
     */
    public function deleteUsage(array $block_content_ids);
    
    /**
     * Gets usage record for inline block by ID.
     *
     * @param int $block_content_id
     *   The block content entity ID.
     *
     * @return object|false
     *   The usage record with properties layout_entity_id and layout_entity_type
     *   or FALSE if there is no usage.
     */
    public function getUsage($block_content_id);

}

Members

Title Sort descending Modifiers Object type Summary Overrides
InlineBlockUsageInterface::addUsage public function Adds a usage record. 1
InlineBlockUsageInterface::deleteUsage public function Delete the inline blocks' the usage records. 1
InlineBlockUsageInterface::getUnused public function Gets unused inline block IDs. 1
InlineBlockUsageInterface::getUsage public function Gets usage record for inline block by ID. 1
InlineBlockUsageInterface::removeByLayoutEntity public function Remove usage record by layout entity. 1

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