You are here

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

Returns an array of available layouts for a given paragraph.

Parameters

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

Return value

array An array of available layout plugins.

2 calls to LayoutParagraphsWidget::getAvailableLayouts()
LayoutParagraphsWidget::entityForm in src/Plugin/Field/FieldWidget/LayoutParagraphsWidget.php
Builds an entity form for a paragraph item.
LayoutParagraphsWidget::isLayoutParagraph in src/Plugin/Field/FieldWidget/LayoutParagraphsWidget.php
Returns true if the paragraph can be used as a layout section.

File

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

Class

LayoutParagraphsWidget
Entity Reference with Layout field widget.

Namespace

Drupal\layout_paragraphs\Plugin\Field\FieldWidget

Code

protected function getAvailableLayouts(ParagraphInterface &$paragraph) {
  $paragraphs_type = $paragraph
    ->getParagraphType();
  return $this
    ->getAvailableLayoutsByType($paragraphs_type);
}