You are here

protected function CalendarEventEmbeddedWidget::getItemFormDisplay in Opigno calendar event 3.x

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

Returns the form display for the specified 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

\Drupal\Core\Entity\Display\EntityFormDisplayInterface An entity form display object.

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

File

src/CalendarEventEmbeddedWidget.php, line 312

Class

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

Namespace

Drupal\opigno_calendar_event

Code

protected function getItemFormDisplay(array $form, FormStateInterface $form_state, $delta) {
  $widget_state =& $this
    ->getWidgetState($form, $form_state);
  $item_state =& $widget_state['items'][$delta];
  if (!isset($item_state['form_display'])) {
    $entity = $widget_state['items'][$delta]['entity'];
    $widget_state['items'][$delta]['form_display'] = EntityFormDisplay::collectRenderDisplay($entity, 'embedded_widget');
  }
  return $item_state['form_display'];
}