You are here

public static function LayoutParagraphsComponent::isRootComponent in Layout Paragraphs 2.0.x

Static wrapper for isRoot().

Parameters

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

Return value

bool True if this item has no parent.

1 call to LayoutParagraphsComponent::isRootComponent()
LayoutParagraphsFormatter::getEntitiesToView in src/Plugin/Field/FieldFormatter/LayoutParagraphsFormatter.php
Returns the referenced entities for display.

File

src/LayoutParagraphsComponent.php, line 99

Class

LayoutParagraphsComponent
Provides a domain object for a single Layout Paragraphs Component.

Namespace

Drupal\layout_paragraphs

Code

public static function isRootComponent(Paragraph $paragraph) {
  $component = new static($paragraph);
  return $component
    ->isRoot();
}