You are here

protected function CalendarEventEmbeddedWidget::getElementParents in Opigno calendar event 8

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

Returns the parent element names for the specified subform.

Parameters

array $form: The parent form array.

int|null $delta: (optional) A subform item delta. Defaults to none.

Return value

string[] An array of element names.

2 calls to CalendarEventEmbeddedWidget::getElementParents()
CalendarEventEmbeddedWidget::alterForm in src/Form/CalendarEventEmbeddedWidget.php
Alters the parent form.
CalendarEventEmbeddedWidget::getItemValues in src/Form/CalendarEventEmbeddedWidget.php
Returns the submitted values for the specified subform item.

File

src/Form/CalendarEventEmbeddedWidget.php, line 409

Class

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

Namespace

Drupal\opigno_calendar_event\Form

Code

protected function getElementParents(array $form, $delta = NULL) {
  $parents = $form['#parents'];
  $parents[] = static::ELEMENT_NAME;
  if (isset($delta)) {
    $parents[] = $delta;
  }
  return $parents;
}