You are here

protected function LingotekNotificationController::getEntity in Lingotek Translation 8

Same name and namespace in other branches
  1. 8.2 src/Controller/LingotekNotificationController.php \Drupal\lingotek\Controller\LingotekNotificationController::getEntity()
  2. 4.0.x src/Controller/LingotekNotificationController.php \Drupal\lingotek\Controller\LingotekNotificationController::getEntity()
  3. 3.0.x src/Controller/LingotekNotificationController.php \Drupal\lingotek\Controller\LingotekNotificationController::getEntity()
  4. 3.1.x src/Controller/LingotekNotificationController.php \Drupal\lingotek\Controller\LingotekNotificationController::getEntity()
  5. 3.2.x src/Controller/LingotekNotificationController.php \Drupal\lingotek\Controller\LingotekNotificationController::getEntity()
  6. 3.3.x src/Controller/LingotekNotificationController.php \Drupal\lingotek\Controller\LingotekNotificationController::getEntity()
  7. 3.4.x src/Controller/LingotekNotificationController.php \Drupal\lingotek\Controller\LingotekNotificationController::getEntity()
  8. 3.5.x src/Controller/LingotekNotificationController.php \Drupal\lingotek\Controller\LingotekNotificationController::getEntity()
  9. 3.6.x src/Controller/LingotekNotificationController.php \Drupal\lingotek\Controller\LingotekNotificationController::getEntity()
  10. 3.7.x src/Controller/LingotekNotificationController.php \Drupal\lingotek\Controller\LingotekNotificationController::getEntity()
  11. 3.8.x src/Controller/LingotekNotificationController.php \Drupal\lingotek\Controller\LingotekNotificationController::getEntity()
1 call to LingotekNotificationController::getEntity()
LingotekNotificationController::endpoint in src/Controller/LingotekNotificationController.php

File

src/Controller/LingotekNotificationController.php, line 119

Class

LingotekNotificationController
Returns responses for lingotek module setup routes.

Namespace

Drupal\lingotek\Controller

Code

protected function getEntity($document_id) {

  /** @var \Drupal\lingotek\LingotekContentTranslationServiceInterface $translation_service */
  $translation_service = \Drupal::service('lingotek.content_translation');
  $entity = $translation_service
    ->loadByDocumentId($document_id);
  if ($entity === NULL) {

    /** @var \Drupal\lingotek\LingotekConfigTranslationServiceInterface $translation_service */
    $translation_service = \Drupal::service('lingotek.config_translation');
    $entity = $translation_service
      ->loadByDocumentId($document_id);
  }
  return $entity;
}