interface InlineBlockUsageInterface (View source)

Defines an interface for tracking inline block usage.

Methods

addUsage(int $block_content_id, EntityInterface $entity)

Adds a usage record.

int[]
getUnused(int $limit = 100)

Gets unused inline block IDs.

removeByLayoutEntity(EntityInterface $entity)

Remove usage record by layout entity.

deleteUsage(array $block_content_ids)

Delete the inline blocks' the usage records.

object
getUsage(int $block_content_id)

Gets usage record for inline block by ID.

Details

addUsage(int $block_content_id, EntityInterface $entity)

Adds a usage record.

Parameters

int $block_content_id

The block content ID.

EntityInterface $entity

The layout entity.

int[] getUnused(int $limit = 100)

Gets unused inline block IDs.

Parameters

int $limit

The maximum number of block content entity IDs to return.

Return Value

int[]

The entity IDs.

removeByLayoutEntity(EntityInterface $entity)

Remove usage record by layout entity.

Parameters

EntityInterface $entity

The layout entity.

deleteUsage(array $block_content_ids)

Delete the inline blocks' the usage records.

Parameters

array $block_content_ids

The block content entity IDs.

object getUsage(int $block_content_id)

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.