You are here

protected function LingotekNotificationController::getProfile in Lingotek Translation 8

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

File

src/Controller/LingotekNotificationController.php, line 106

Class

LingotekNotificationController
Returns responses for lingotek module setup routes.

Namespace

Drupal\lingotek\Controller

Code

protected function getProfile($entity) {

  /** @var \Drupal\lingotek\LingotekConfigurationServiceInterface $configuration_service */
  $configuration_service = \Drupal::service('lingotek.configuration');
  $profile = NULL;
  if ($entity instanceof ContentEntityInterface) {
    $profile = $configuration_service
      ->getEntityProfile($entity, FALSE);
  }
  elseif ($entity instanceof ConfigEntityInterface) {
    $profile = $configuration_service
      ->getConfigEntityProfile($entity, FALSE);
  }
  return $profile;
}