public function ParagraphBlocksEntity::getSummary in Paragraph blocks 3.x
Same name and namespace in other branches
- 8.2 src/Entity/ParagraphBlocksEntity.php \Drupal\paragraph_blocks\Entity\ParagraphBlocksEntity::getSummary()
- 8 src/Entity/ParagraphBlocksEntity.php \Drupal\paragraph_blocks\Entity\ParagraphBlocksEntity::getSummary()
File
- src/
Entity/ ParagraphBlocksEntity.php, line 18
Class
- ParagraphBlocksEntity
- Extend the Paragraph entity.
Namespace
Drupal\paragraph_blocks\EntityCode
public function getSummary(array $options = []) {
// Get any field with title in the name.
$value = $this->admin_title
->getValue();
foreach ($this
->getFieldDefinitions() as $field_name => $field_definition) {
if (strpos($field_name, 'title') !== FALSE) {
$text = $this
->getTextSummary($field_name, $field_definition);
if (!empty($text)) {
return $text;
}
}
}
return parent::getSummary($options);
}