public function LayoutParagraphsLayout::getEntities in Layout Paragraphs 2.0.x
Returns a list of all paragraph entities associated with this collection.
Return value
\Drupal\paragraphs\Entity\Paragraph[] An array of paragraph entities.
2 calls to LayoutParagraphsLayout::getEntities()
- 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.
File
- src/
LayoutParagraphsLayout.php, line 263
Class
- LayoutParagraphsLayout
- Provides a domain object for a complete Layout Paragraphs Layout.
Namespace
Drupal\layout_paragraphsCode
public function getEntities() {
$items = [];
foreach ($this->paragraphsReferenceField as $field_item) {
if ($field_item->entity) {
$items[] = $field_item->entity;
}
}
return $items;
}