class EntityTypeInfo implements ContainerInjectionInterface (View source)

internal  
 

Manipulates entity type information.

This class contains primarily bridged hooks for compile-time or cache-clear-time hooks. Runtime hooks should be placed in EntityOperations.

Properties

protected EntityTypeManagerInterface $entityTypeManager

The entity type manager service.

protected WorkspaceManagerInterface $workspaceManager

The workspace manager service.

Methods

__construct(EntityTypeManagerInterface $entity_type_manager, WorkspaceManagerInterface $workspace_manager)

Constructs a new EntityTypeInfo instance.

static 
create(ContainerInterface $container)

Instantiates a new instance of this class.

entityTypeBuild(array $entity_types)

Adds the "EntityWorkspaceConflict" constraint to eligible entity types.

entityTypeAlter(array $entity_types)

Removes the 'latest-version' link template provided by Content Moderation.

fieldInfoAlter(array[] $definitions)

Alters field plugin definitions.

entityBaseFieldInfo(EntityTypeInterface $entity_type)

Provides custom base field definitions for a content entity type.

Details

__construct(EntityTypeManagerInterface $entity_type_manager, WorkspaceManagerInterface $workspace_manager)

Constructs a new EntityTypeInfo instance.

Parameters

EntityTypeManagerInterface $entity_type_manager

The entity type manager service.

WorkspaceManagerInterface $workspace_manager

The workspace manager service.

static create(ContainerInterface $container)

Instantiates a new instance of this class.

This is a factory method that returns a new instance of this class. The factory should pass any needed dependencies into the constructor of this class, but not the container itself. Every call to this method must return a new instance of this class; that is, it may not implement a singleton.

Parameters

ContainerInterface $container

The service container this instance should use.

entityTypeBuild(array $entity_types)

Adds the "EntityWorkspaceConflict" constraint to eligible entity types.

Parameters

array $entity_types

An associative array of all entity type definitions, keyed by the entity type name. Passed by reference.

See also

hook_entity_type_build()

entityTypeAlter(array $entity_types)

Removes the 'latest-version' link template provided by Content Moderation.

Parameters

array $entity_types

An array of entity types.

See also

hook_entity_type_alter()

fieldInfoAlter(array[] $definitions)

Alters field plugin definitions.

Parameters

array[] $definitions

An array of field plugin definitions.

See also

hook_field_info_alter()

FieldDefinitionInterface[] entityBaseFieldInfo(EntityTypeInterface $entity_type)

Provides custom base field definitions for a content entity type.

Parameters

EntityTypeInterface $entity_type

The entity type definition.

Return Value

FieldDefinitionInterface[]

An array of field definitions, keyed by field name.

See also

hook_entity_base_field_info()