interface ContentTranslationManagerInterface (View source)

Provides an interface for common functionality for content translation.

Methods

getSupportedEntityTypes()

Gets the entity types that support content translation.

bool
isSupported(string $entity_type_id)

Checks whether an entity type supports translation.

getTranslationHandler(string $entity_type_id)

Returns an instance of the Content translation handler.

getTranslationMetadata(EntityInterface $translation)

Returns an instance of the Content translation metadata.

setEnabled(string $entity_type_id, string $bundle, bool $value)

Sets the value for translatability of the given entity type bundle.

isEnabled(string $entity_type_id, string $bundle = NULL)

Determines whether the given entity type is translatable.

Details

EntityTypeInterface[] getSupportedEntityTypes()

Gets the entity types that support content translation.

Return Value

EntityTypeInterface[]

An array of entity types that support content translation.

bool isSupported(string $entity_type_id)

Checks whether an entity type supports translation.

Parameters

string $entity_type_id

The entity type.

Return Value

bool

TRUE if an entity type is supported, FALSE otherwise.

ContentTranslationHandlerInterface getTranslationHandler(string $entity_type_id)

Returns an instance of the Content translation handler.

Parameters

string $entity_type_id

The type of the entity being translated.

Return Value

ContentTranslationHandlerInterface

An instance of the content translation handler.

ContentTranslationMetadataWrapperInterface getTranslationMetadata(EntityInterface $translation)

Returns an instance of the Content translation metadata.

Parameters

EntityInterface $translation

The entity translation whose metadata needs to be retrieved.

Return Value

ContentTranslationMetadataWrapperInterface

An instance of the content translation metadata.

setEnabled(string $entity_type_id, string $bundle, bool $value)

Sets the value for translatability of the given entity type bundle.

Parameters

string $entity_type_id

The entity type.

string $bundle

The bundle of the entity.

bool $value

The boolean value we need to save.

isEnabled(string $entity_type_id, string $bundle = NULL)

Determines whether the given entity type is translatable.

Parameters

string $entity_type_id

The type of the entity.

string $bundle

(optional) The bundle of the entity. If no bundle is provided, all the available bundles are checked.