class ParagraphSummary in Thunder 6.2.x
Resolves the paragraphs summary.
Plugin annotation
@DataProducer(
id = "paragraph_summary",
name = @Translation("Paragraphs Summary"),
description = @Translation("Resolves the paragraphs summary."),
produces = @ContextDefinition("any",
label = @Translation("Summary")
),
consumes = {
"paragraph" = @ContextDefinition("entity",
label = @Translation("Root value")
)
}
)
Hierarchy
- class \Drupal\thunder_gqls\Plugin\GraphQL\DataProducer\ParagraphSummary extends \Drupal\graphql\Plugin\GraphQL\DataProducer\DataProducerPluginBase
Expanded class hierarchy of ParagraphSummary
File
- modules/
thunder_gqls/ src/ Plugin/ GraphQL/ DataProducer/ ParagraphSummary.php, line 25
Namespace
Drupal\thunder_gqls\Plugin\GraphQL\DataProducerView source
class ParagraphSummary extends DataProducerPluginBase {
/**
* Resolves the paragraphs summary.
*
* @param \Drupal\paragraphs\Entity\Paragraph $paragraph
* The entity.
*
* @return mixed
* The paragraphs summary.
*/
public function resolve(Paragraph $paragraph) {
return $paragraph
->getSummaryItems()['content'];
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ParagraphSummary:: |
public | function | Resolves the paragraphs summary. |