You are here

public function JobExtendedForm::save in TMGMT Extension Suite 8

Overrides Drupal\Core\Entity\EntityForm::save().

Overrides JobForm::save

File

src/Form/JobExtendedForm.php, line 14

Class

JobExtendedForm

Namespace

Drupal\tmgmt_extension_suit\Form

Code

public function save(array $form, FormStateInterface $form_state) {

  // Everything below this line is only invoked if the 'Submit to provider'
  // button was clicked.
  if (isset($form['actions']['submit']) && $form_state
    ->getTriggeringElement()['#value'] == $form['actions']['submit']['#value']) {
    $translator_plugin = $this->entity
      ->getTranslatorPlugin();
    if ($translator_plugin instanceof ExtendedTranslatorPluginInterface) {

      // Log upload event.
      \Drupal::getContainer()
        ->get('logger.channel.tmgmt_extension_suit')
        ->info(t('File upload triggered (request translation). Job id: @job_id, file name: @name.', [
        '@name' => $translator_plugin
          ->getFileName($this->entity),
        '@job_id' => $this->entity
          ->id(),
      ]));
    }
  }
  parent::save($form, $form_state);
}