You are here

public function ModerationStateWidget::processComponentInput in Lightning Scheduler 8

#process callback for the scheduler component's input element.

Parameters

array $element: The unprocessed element.

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

Return value

array The processed element.

File

src/Plugin/Field/FieldWidget/ModerationStateWidget.php, line 111

Class

ModerationStateWidget
Scheduler extension of Content Moderation's widget.

Namespace

Drupal\lightning_scheduler\Plugin\Field\FieldWidget

Code

public function processComponentInput(array $element, FormStateInterface $form_state) {
  $key = $element['#parents'];
  if ($form_state
    ->hasValue($key)) {
    $element['#default_value'] = $form_state
      ->getValue($key);
  }
  return $element;
}