You are here

public function LayoutParagraphsLayout::getComponent in Layout Paragraphs 2.0.x

Wraps the paragraph in the component class.

Parameters

Drupal\paragraphs\Entity\Paragraph $paragraph: The paragraph entity.

Return value

LayoutParagraphsComponent|LayoutParagraphsSection The component.

4 calls to LayoutParagraphsLayout::getComponent()
LayoutParagraphsLayout::getComponentByUuid in src/LayoutParagraphsLayout.php
Returns the component with matching uuid.
LayoutParagraphsLayout::getComponents in src/LayoutParagraphsLayout.php
Returns a list of all components for this collection.
LayoutParagraphsLayout::insertIntoRegion in src/LayoutParagraphsLayout.php
Insert a paragraph component before an existing component.
LayoutParagraphsLayout::insertSiblingComponent in src/LayoutParagraphsLayout.php
Insert an new item adjacent to $sibling.

File

src/LayoutParagraphsLayout.php, line 187

Class

LayoutParagraphsLayout
Provides a domain object for a complete Layout Paragraphs Layout.

Namespace

Drupal\layout_paragraphs

Code

public function getComponent(Paragraph $paragraph) {
  return new LayoutParagraphsComponent($paragraph);
}