You are here

public function MiconForm::updateStatus in Micon 2.x

Same name and namespace in other branches
  1. 8 src/Form/MiconForm.php \Drupal\micon\Form\MiconForm::updateStatus()

Entity builder updating the micon status with the submitted value.

Parameters

string $entity_type_id: The entity type identifier.

\Drupal\micon\MiconInterface $micon: The micon updated with the submitted values.

array $form: The complete form array.

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

See also

\Drupal\micon\MiconForm::form()

File

src/Form/MiconForm.php, line 85

Class

MiconForm
Class MiconForm.

Namespace

Drupal\micon\Form

Code

public function updateStatus($entity_type_id, MiconInterface $micon, array $form, FormStateInterface $form_state) {
  $element = $form_state
    ->getTriggeringElement();
  if (isset($element['#published_status'])) {
    $micon
      ->setStatus($element['#published_status']);
  }
}