You are here

protected function LingotekConfigManagementForm::getMetadataJobId in Lingotek Translation 3.4.x

Same name and namespace in other branches
  1. 8.2 src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getMetadataJobId()
  2. 4.0.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getMetadataJobId()
  3. 3.0.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getMetadataJobId()
  4. 3.1.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getMetadataJobId()
  5. 3.2.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getMetadataJobId()
  6. 3.3.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getMetadataJobId()
  7. 3.5.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getMetadataJobId()
  8. 3.6.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getMetadataJobId()
  9. 3.7.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getMetadataJobId()
  10. 3.8.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getMetadataJobId()
1 call to LingotekConfigManagementForm::getMetadataJobId()
LingotekConfigManagementForm::buildForm in src/Form/LingotekConfigManagementForm.php
Form constructor.

File

src/Form/LingotekConfigManagementForm.php, line 1779

Class

LingotekConfigManagementForm
Form for bulk management of content.

Namespace

Drupal\lingotek\Form

Code

protected function getMetadataJobId($mapper) {
  $job_id = NULL;
  $metadata = NULL;
  if ($mapper instanceof ConfigEntityMapper) {
    $entity = $mapper
      ->getEntity();
    $metadata = LingotekConfigMetadata::loadByConfigName($entity
      ->getEntityTypeId() . '.' . $entity
      ->id());
  }
  elseif ($mapper instanceof ConfigMapperInterface) {
    $config_names = $mapper
      ->getConfigNames();
    if ($config_names) {
      $config_name = reset($config_names);
      $metadata = LingotekConfigMetadata::loadByConfigName($config_name);
    }
  }
  if ($metadata !== NULL) {
    $job_id = $metadata
      ->getJobId();
  }
  return $job_id;
}