Drupal 8  8.0.2
ContentTranslationManager Class Reference
Inheritance diagram for ContentTranslationManager:

Public Member Functions

 __construct (EntityManagerInterface $manager, ContentTranslationUpdatesManager $updates_manager)
 
 getTranslationHandler ($entity_type_id)
 
 getTranslationMetadata (EntityInterface $translation)
 
 isSupported ($entity_type_id)
 
 getSupportedEntityTypes ()
 
 setEnabled ($entity_type_id, $bundle, $value)
 
 isEnabled ($entity_type_id, $bundle=NULL)
 

Protected Member Functions

 loadContentLanguageSettings ($entity_type_id, $bundle)
 

Protected Attributes

 $entityManager
 
 $updatesManager
 

Detailed Description

Provides common functionality for content translation.

Constructor & Destructor Documentation

__construct ( EntityManagerInterface  $manager,
ContentTranslationUpdatesManager  $updates_manager 
)

Constructs a ContentTranslationManageAccessCheck object.

Parameters
\Drupal\Core\Entity\EntityManagerInterface$managerThe entity type manager.
\Drupal\content_translation\ContentTranslationUpdatesManager$updates_managerThe updates manager.

References Drupal\entityManager().

Here is the call graph for this function:

Member Function Documentation

getSupportedEntityTypes ( )

{Gets the entity types that support content translation.

Returns
[] An array of entity types that support content translation.
}

Implements ContentTranslationManagerInterface.

References Drupal\entityManager(), and ContentTranslationManager\isSupported().

Here is the call graph for this function:

getTranslationHandler (   $entity_type_id)

{Returns an instance of the Content translation handler.

Parameters
string$entity_type_idThe type of the entity being translated.
Returns
An instance of the content translation handler.
}

Implements ContentTranslationManagerInterface.

References Drupal\entityManager().

Referenced by ContentTranslationManager\getTranslationMetadata().

Here is the call graph for this function:

Here is the caller graph for this function:

getTranslationMetadata ( EntityInterface  $translation)

{Returns an instance of the Content translation metadata.

Parameters
\Drupal\Core\Entity\EntityInterface$translationThe entity translation whose metadata needs to be retrieved.
Returns
An instance of the content translation metadata.
}

Implements ContentTranslationManagerInterface.

References EntityInterface\getEntityType(), and ContentTranslationManager\getTranslationHandler().

Here is the call graph for this function:

isEnabled (   $entity_type_id,
  $bundle = NULL 
)

{Determines whether the given entity type is translatable.

Parameters
string$entity_type_idThe type of the entity.
string$bundle(optional) The bundle of the entity. If no bundle is provided, all the available bundles are checked.
Returns
bool TRUE if the specified bundle is translatable. If no bundle is provided returns TRUE if at least one of the entity bundles is translatable.
}

Implements ContentTranslationManagerInterface.

References Drupal\entityManager(), ContentTranslationManager\isSupported(), and ContentTranslationManager\loadContentLanguageSettings().

Here is the call graph for this function:

isSupported (   $entity_type_id)

{Checks whether an entity type supports translation.

Parameters
string$entity_type_idThe entity type.
Returns
bool TRUE if an entity type is supported, FALSE otherwise.
}

Implements ContentTranslationManagerInterface.

References Drupal\entityManager().

Referenced by ContentTranslationManager\getSupportedEntityTypes(), and ContentTranslationManager\isEnabled().

Here is the call graph for this function:

Here is the caller graph for this function:

loadContentLanguageSettings (   $entity_type_id,
  $bundle 
)
protected

Loads a content language config entity based on the entity type and bundle.

Parameters
string$entity_type_idID of the entity type.
string$bundleBundle name.
Returns
The content language config entity if one exists. Otherwise, returns default values.

References Drupal\entityManager().

Referenced by ContentTranslationManager\isEnabled(), and ContentTranslationManager\setEnabled().

Here is the call graph for this function:

Here is the caller graph for this function:

setEnabled (   $entity_type_id,
  $bundle,
  $value 
)

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

Parameters
string$entity_type_idThe entity type.
string$bundleThe bundle of the entity.
bool$valueThe boolean value we need to save.
}

Implements ContentTranslationManagerInterface.

References Drupal\entityManager(), and ContentTranslationManager\loadContentLanguageSettings().

Here is the call graph for this function:


The documentation for this class was generated from the following file: