You are here

protected function LayoutParagraphsWidget::setLayoutSetting in Layout Paragraphs 1.0.x

Sets the layout settings for a given paragraph.

Parameters

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

string $name: The layout setting name.

mixed $value: The layout setting value.

2 calls to LayoutParagraphsWidget::setLayoutSetting()
LayoutParagraphsWidget::formElement in src/Plugin/Field/FieldWidget/LayoutParagraphsWidget.php
Returns the form for a single field widget.
LayoutParagraphsWidget::saveItemSubmit in src/Plugin/Field/FieldWidget/LayoutParagraphsWidget.php
Form submit handler - saves an item.

File

src/Plugin/Field/FieldWidget/LayoutParagraphsWidget.php, line 2166

Class

LayoutParagraphsWidget
Entity Reference with Layout field widget.

Namespace

Drupal\layout_paragraphs\Plugin\Field\FieldWidget

Code

protected function setLayoutSetting(ParagraphInterface &$paragraph, string $name, $value) {
  $settings = $this
    ->getLayoutSettings($paragraph);
  $settings[$name] = $value;
  $this
    ->setLayoutSettings($paragraph, $settings);
}