You are here

public function GlobalLinkTranslatorUi::reviewForm in GlobalLink Connect for Drupal 8

Same name and namespace in other branches
  1. 8.2 src/GlobalLinkTranslatorUi.php \Drupal\globallink\GlobalLinkTranslatorUi::reviewForm()

Form callback for the job item review form.

Overrides TranslatorPluginUiBase::reviewForm

File

src/GlobalLinkTranslatorUi.php, line 26
Contains Drupal\globallink\GlobalLinkTranslatorUi.

Class

GlobalLinkTranslatorUi
GlobalLink translator UI.

Namespace

Drupal\globallink

Code

public function reviewForm(array $form, FormStateInterface $form_state, JobItemInterface $item) {

  /** @var \Drupal\globallink\Plugin\tmgmt\Translator\GlobalLinkTranslator $translator_plugin */
  $translator_plugin = $item
    ->getTranslator()
    ->getPlugin();
  $translator_plugin
    ->setTranslator($item
    ->getTranslator());
  $mappings = $item
    ->getRemoteMappings();

  /** @var \Drupal\tmgmt\Entity\RemoteMapping $mapping */
  $mapping = array_shift($mappings);
  return $form;
}