public function Paragraph::getSummary

Returns a short summary for the Paragraph.

Parameters

array $options: (optional) Array of additional options, with the following elements:

  • 'show_behavior_summary': Whether the summary should contain the behavior settings. Defaults to TRUE to show behavior settings in the summary.
  • 'depth_limit': Depth limit of how many nested paragraph summaries are allowed. Defaults to 1 to show nested paragraphs only on top level.

Return value

string The template based summary.

Overrides ParagraphInterface::getSummary

1 call to Paragraph::getSummary()
Paragraph::label in paragraphs/src/Entity/Paragraph.php

File

paragraphs/src/Entity/Paragraph.php, line 437

Class

Paragraph
Defines the Paragraph entity.

Namespace

Drupal\paragraphs\Entity

Code

public function getSummary(array $options = []) {
  $summary_items = $this
    ->getSummaryItems($options);
  $summary = [
    '#theme' => 'paragraphs_summary',
    '#summary' => $summary_items,
    '#expanded' => isset($options['expanded']) ? $options['expanded'] : FALSE,
  ];
  return \Drupal::service('renderer')
    ->renderPlain($summary);
}