You are here

protected function MultigraphForm::copyFormValuesToEntity in Monitoring 8

@inheritDoc

Overrides EntityForm::copyFormValuesToEntity

File

modules/multigraph/src/Form/MultigraphForm.php, line 258
Contains \Drupal\monitoring_multigraph\Form\MultigraphForm.

Class

MultigraphForm
Multigraph settings form controller.

Namespace

Drupal\monitoring_multigraph\Form

Code

protected function copyFormValuesToEntity(EntityInterface $entity, array $form, FormStateInterface $form_state) {

  // Unset an empty sensors key or the sensors array is overwritten with an
  // empty string.
  if (!$form_state
    ->getValue('sensors')) {
    $form_state
      ->unsetValue('sensors');
  }
  parent::copyFormValuesToEntity($entity, $form, $form_state);
}