You are here

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

Gets the layout settings for a paragraph.

Parameters

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

Return value

array The layout settings array.

8 calls to LayoutParagraphsWidget::getLayoutSettings()
LayoutParagraphsWidget::buildLayouts in src/Plugin/Field/FieldWidget/LayoutParagraphsWidget.php
Restructures $elements array into layout.
LayoutParagraphsWidget::entityForm in src/Plugin/Field/FieldWidget/LayoutParagraphsWidget.php
Builds an entity form for a paragraph item.
LayoutParagraphsWidget::formElement in src/Plugin/Field/FieldWidget/LayoutParagraphsWidget.php
Returns the form for a single field widget.
LayoutParagraphsWidget::hasChildren in src/Plugin/Field/FieldWidget/LayoutParagraphsWidget.php
Search $items for children of $parent.
LayoutParagraphsWidget::massageFormValues in src/Plugin/Field/FieldWidget/LayoutParagraphsWidget.php
Massages the form values into the format expected for field values.

... See full list

File

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

Class

LayoutParagraphsWidget
Entity Reference with Layout field widget.

Namespace

Drupal\layout_paragraphs\Plugin\Field\FieldWidget

Code

protected function getLayoutSettings(ParagraphInterface $paragraph) {
  $defaults = [
    'parent_uuid' => '',
    'layout' => '',
    'region' => '',
    'config' => [],
  ];
  $behavior_settings = $paragraph
    ->getAllBehaviorSettings();
  return ($behavior_settings['layout_paragraphs'] ?? []) + $defaults;
}