You are here

function lingotek_entity_type_alter in Lingotek Translation 3.4.x

Same name and namespace in other branches
  1. 8 lingotek.module \lingotek_entity_type_alter()
  2. 8.2 lingotek.module \lingotek_entity_type_alter()
  3. 4.0.x lingotek.module \lingotek_entity_type_alter()
  4. 3.0.x lingotek.module \lingotek_entity_type_alter()
  5. 3.1.x lingotek.module \lingotek_entity_type_alter()
  6. 3.2.x lingotek.module \lingotek_entity_type_alter()
  7. 3.3.x lingotek.module \lingotek_entity_type_alter()
  8. 3.5.x lingotek.module \lingotek_entity_type_alter()
  9. 3.6.x lingotek.module \lingotek_entity_type_alter()
  10. 3.7.x lingotek.module \lingotek_entity_type_alter()
  11. 3.8.x lingotek.module \lingotek_entity_type_alter()

Implements hook_entity_type_alter().

File

./lingotek.module, line 578
Implements Drupal-related hooks for the Lingotek Translation module.

Code

function lingotek_entity_type_alter(array &$entity_types) {

  // Provide defaults for lingotek translation info.

  /** @var $entity_types \Drupal\Core\Entity\EntityTypeInterface[] */
  foreach ($entity_types as $entity_type) {
    if ($entity_type
      ->isTranslatable()) {
      if (!$entity_type
        ->hasHandlerClass('lingotek')) {
        $entity_type
          ->setHandlerClass('lingotek', 'Drupal\\lingotek\\LingotekContentTranslationHandler');
      }
    }
  }
}