protected function CalendarEventEmbeddedWidget::getItemFormObject in Opigno calendar event 8
Same name in this branch
- 8 src/CalendarEventEmbeddedWidget.php \Drupal\opigno_calendar_event\CalendarEventEmbeddedWidget::getItemFormObject()
- 8 src/Form/CalendarEventEmbeddedWidget.php \Drupal\opigno_calendar_event\Form\CalendarEventEmbeddedWidget::getItemFormObject()
Same name and namespace in other branches
- 3.x src/CalendarEventEmbeddedWidget.php \Drupal\opigno_calendar_event\CalendarEventEmbeddedWidget::getItemFormObject()
Returns a entity form object 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\ContentEntityFormInterface A Calendar event entity form object.
2 calls to CalendarEventEmbeddedWidget::getItemFormObject()
- CalendarEventEmbeddedWidget::submitForm in src/
CalendarEventEmbeddedWidget.php - Submit handler.
- CalendarEventEmbeddedWidget::validateForm in src/
CalendarEventEmbeddedWidget.php - Validation handler.
File
- src/
CalendarEventEmbeddedWidget.php, line 337
Class
- CalendarEventEmbeddedWidget
- Provides a widget to attach a calendar event to an entity.
Namespace
Drupal\opigno_calendar_eventCode
protected function getItemFormObject(array $form, FormStateInterface $form_state, $delta) {
$widget_state =& $this
->getWidgetState($form, $form_state);
$item_state =& $widget_state['items'][$delta];
if (!isset($item_state['form_object'])) {
/** @var \Drupal\Core\Entity\ContentEntityFormInterface $form_object */
$form_object = $this->entityTypeManager
->getFormObject(CalendarEventInterface::ENTITY_TYPE_ID, 'default');
$form_object
->setEntity($item_state['entity']);
$item_form_state = $this
->getItemFormState($form, $form_state, $delta);
$form_object
->setFormDisplay($item_state['form_display'], $item_form_state);
$item_state['form_object'] = $form_object;
}
return $item_state['form_object'];
}