You are here

public function LayoutParagraphsSection::getComponentsForRegion in Layout Paragraphs 2.0.x

Get the components for a single region.

Parameters

string $region: The region name.

Return value

Drupal\layout_paragraphs\LayoutParagraphsComponent[] An array of components.

File

src/LayoutParagraphsSection.php, line 85

Class

LayoutParagraphsSection
Provides a domain object for a Layout Paragraphs Section.

Namespace

Drupal\layout_paragraphs

Code

public function getComponentsForRegion(string $region) {
  return array_filter($this
    ->getComponents(), function (LayoutParagraphsComponent $component) use ($region) {
    return $component
      ->getRegion() == $region;
  });
}