You are here

public function CalendarEventEmbeddedWidget::getItemState in Opigno calendar event 8

Same name in this branch
  1. 8 src/CalendarEventEmbeddedWidget.php \Drupal\opigno_calendar_event\CalendarEventEmbeddedWidget::getItemState()
  2. 8 src/Form/CalendarEventEmbeddedWidget.php \Drupal\opigno_calendar_event\Form\CalendarEventEmbeddedWidget::getItemState()
Same name and namespace in other branches
  1. 3.x src/Form/CalendarEventEmbeddedWidget.php \Drupal\opigno_calendar_event\Form\CalendarEventEmbeddedWidget::getItemState()

Returns the state of an individual subform item.

Parameters

array $form: The parent form array.

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

int $delta: The item delta.

Return value

array An associative array of widget state data.

1 call to CalendarEventEmbeddedWidget::getItemState()
CalendarEventEmbeddedWidget::alterForm in src/Form/CalendarEventEmbeddedWidget.php
Alters the parent form.

File

src/Form/CalendarEventEmbeddedWidget.php, line 293

Class

CalendarEventEmbeddedWidget
Provides a widget to attach a calendar event to an entity.

Namespace

Drupal\opigno_calendar_event\Form

Code

public function &getItemState(array $form, FormStateInterface $form_state, $delta) {
  $widget_state =& $this
    ->getWidgetState($form, $form_state);
  if (!isset($widget_state['items'][$delta])) {
    $widget_state['items'][$delta] = [];
  }
  return $widget_state['items'][$delta];
}