You are here

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

Returns true if the paragraph can be used as a layout section.

Parameters

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

Return value

bool True if paragraph is a layout section.

1 call to LayoutParagraphsWidget::isLayoutParagraph()
LayoutParagraphsWidget::entityForm in src/Plugin/Field/FieldWidget/LayoutParagraphsWidget.php
Builds an entity form for a paragraph item.

File

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

Class

LayoutParagraphsWidget
Entity Reference with Layout field widget.

Namespace

Drupal\layout_paragraphs\Plugin\Field\FieldWidget

Code

protected function isLayoutParagraph(ParagraphInterface &$paragraph) {
  $available_layouts = $this
    ->getAvailableLayouts($paragraph);
  return count($available_layouts) > 0;
}