You are here

public function ModerationStateWidget::processComponentInput in Lightning Workflow 8.2

Same name and namespace in other branches
  1. 8.3 modules/lightning_scheduler/src/Plugin/Field/FieldWidget/ModerationStateWidget.php \Drupal\lightning_scheduler\Plugin\Field\FieldWidget\ModerationStateWidget::processComponentInput()

#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

modules/lightning_scheduler/src/Plugin/Field/FieldWidget/ModerationStateWidget.php, line 176

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;
}