class LayoutBuilderSampleEntityGenerator implements SampleEntityGeneratorInterface (View source)

Generates a sample entity for use by the Layout Builder.

Properties

protected SharedTempStoreFactory $tempStoreFactory

The shared tempstore factory.

protected EntityTypeManagerInterface $entityTypeManager

The entity type manager.

Methods

__construct(SharedTempStoreFactory $temp_store_factory, EntityTypeManagerInterface $entity_type_manager)

LayoutBuilderSampleEntityGenerator constructor.

get(string $entity_type_id, string $bundle_id)

Gets a sample entity for a given entity type and bundle.

$this
delete(string $entity_type_id, string $bundle_id)

Deletes a sample entity for a given entity type and bundle.

Details

__construct(SharedTempStoreFactory $temp_store_factory, EntityTypeManagerInterface $entity_type_manager)

LayoutBuilderSampleEntityGenerator constructor.

Parameters

SharedTempStoreFactory $temp_store_factory

The tempstore factory.

EntityTypeManagerInterface $entity_type_manager

The entity type manager.

EntityInterface get(string $entity_type_id, string $bundle_id)

Gets a sample entity for a given entity type and bundle.

Parameters

string $entity_type_id

The entity type ID.

string $bundle_id

The bundle ID.

Return Value

EntityInterface

An entity.

$this delete(string $entity_type_id, string $bundle_id)

Deletes a sample entity for a given entity type and bundle.

Parameters

string $entity_type_id

The entity type ID.

string $bundle_id

The bundle ID.

Return Value

$this