Error message

Warning: count(): Parameter must be an array or an object that implements Countable in _api_make_match_member_link() (line 1230 of /home/projects/api/www/sites/all/modules/api/api.formatting.inc).

public function TranslatorForm::save

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

File

src/Form/TranslatorForm.php, line 243

Class

TranslatorForm
Form controller for the translator edit forms.

Namespace

Drupal\tmgmt\Form

Code

public function save(array $form, FormStateInterface $form_state) {
  $entity = $this->entity;
  $status = $entity
    ->save();
  if ($status === SAVED_UPDATED) {
    \Drupal::messenger()
      ->addStatus($this
      ->t('%label configuration has been updated.', array(
      '%label' => $entity
        ->label(),
    )));
  }
  else {
    \Drupal::messenger()
      ->addStatus($this
      ->t('%label configuration has been created.', array(
      '%label' => $entity
        ->label(),
    )));
  }
  $form_state
    ->setRedirect('entity.tmgmt_translator.collection');
}