You are here

protected function FormsStepsProgressStepEditForm::copyFormValuesToEntity in Forms Steps 8

Copies top-level form values to entity properties.

This form can only change values for a step, which is part of forms_steps.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity the current form should operate upon.

array $form: A nested array of form elements comprising the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Overrides EntityForm::copyFormValuesToEntity

File

src/Form/FormsStepsProgressStepEditForm.php, line 147

Class

FormsStepsProgressStepEditForm
Class FormsStepsProgressStepEditForm.

Namespace

Drupal\forms_steps\Form

Code

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

  /** @var \Drupal\forms_steps\FormsStepsInterface $entity */
  $values = $form_state
    ->getValues();
  $entity
    ->setProgressStepLabel($values['id'], $values['label']);
  $entity
    ->setProgressStepActiveRoutes($values['id'], $values['routes']);
  $entity
    ->setProgressStepLink($values['id'], $values['link']);
  $entity
    ->setProgressStepLinkVisibility($values['id'], $values['link_visibility']);
}