You are here

public function ParagraphsViewmodeBehavior::submitBehaviorForm in Paragraphs View Modes 8

Submit the values taken from the form to store the values.

This method is responsible for submitting the data and saving it in the paragraphs entity.

Parameters

\Drupal\paragraphs\ParagraphInterface $paragraph: The paragraph.

array $form: An associative array containing the initial structure of the plugin form.

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

Overrides ParagraphsBehaviorBase::submitBehaviorForm

File

src/Plugin/paragraphs/Behavior/ParagraphsViewmodeBehavior.php, line 163

Class

ParagraphsViewmodeBehavior
Class ParagraphsViewmodeBehavior.

Namespace

Drupal\paragraphs_viewmode\Plugin\paragraphs\Behavior

Code

public function submitBehaviorForm(ParagraphInterface $paragraph, array &$form, FormStateInterface $form_state) {
  $paragraph
    ->setBehaviorSettings($this->pluginId, [
    'view_mode',
    $form_state
      ->getValue('view_mode'),
  ]);
  parent::submitBehaviorForm($paragraph, $form, $form_state);
}