class ParagraphBlocksEntity in Paragraph blocks 3.x
Same name and namespace in other branches
- 8.2 src/Entity/ParagraphBlocksEntity.php \Drupal\paragraph_blocks\Entity\ParagraphBlocksEntity
- 8 src/Entity/ParagraphBlocksEntity.php \Drupal\paragraph_blocks\Entity\ParagraphBlocksEntity
Extend the Paragraph entity.
Hierarchy
- class \Drupal\paragraph_blocks\Entity\ParagraphBlocksEntity extends \Drupal\paragraphs\Entity\Paragraph uses StringTranslationTrait
Expanded class hierarchy of ParagraphBlocksEntity
1 file declares its use of ParagraphBlocksEntity
File
- src/
Entity/ ParagraphBlocksEntity.php, line 11
Namespace
Drupal\paragraph_blocks\EntityView source
class ParagraphBlocksEntity extends Paragraph {
use StringTranslationTrait;
/**
* {@inheritdoc}
*/
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);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ParagraphBlocksEntity:: |
public | function | ||
StringTranslationTrait:: |
protected | property | The string translation service. | 4 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. |