You are here

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

Returns the component with matching uuid.

Parameters

string $uuid: The uuid to search for.

Return value

LayoutParagraphsComponent The component.

4 calls to LayoutParagraphsLayout::getComponentByUuid()
LayoutParagraphsLayout::deleteComponent in src/LayoutParagraphsLayout.php
Delete a component.
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.
LayoutParagraphsLayout::reorderComponents in src/LayoutParagraphsLayout.php
Reorder components.

File

src/LayoutParagraphsLayout.php, line 200

Class

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

Namespace

Drupal\layout_paragraphs

Code

public function getComponentByUuid($uuid) {
  foreach ($this
    ->getEntities() as $entity) {
    if ($entity
      ->uuid() == $uuid) {
      return $this
        ->getComponent($entity);
    }
  }
}