You are here

public function ContentEntity::submitInlineForm in Commerce Core 8.2

Submits the inline form.

Parameters

array $inline_form: The inline form, containing the following basic properties:

  • #parents: Identifies the location of the field values in $form_state.

\Drupal\Core\Form\FormStateInterface $form_state: The form state of the complete form.

Overrides InlineFormBase::submitInlineForm

File

src/Plugin/Commerce/InlineForm/ContentEntity.php, line 73

Class

ContentEntity
Provides an inline form for managing a content entity.

Namespace

Drupal\commerce\Plugin\Commerce\InlineForm

Code

public function submitInlineForm(array &$inline_form, FormStateInterface $form_state) {
  parent::submitInlineForm($inline_form, $form_state);
  assert($this->entity instanceof ContentEntityInterface);
  $form_display = EntityFormDisplay::collectRenderDisplay($this->entity, $this->configuration['form_mode']);
  $form_display
    ->extractFormValues($this->entity, $inline_form, $form_state);
  if ($this->entity
    ->isTranslatable()) {
    $this
      ->updateLangcode($this->entity, $inline_form, $form_state);
  }
  if (empty($this->configuration['skip_save'])) {
    $this->entity
      ->save();
  }
}