Here is a patch that addsYou can extend the entity with a custom entity alter forclass and set it as the label: https://www.drupal.org/project/paragraphs/issues/2900538class to use for that entity type.
The attached patch will allow developers to implement hook_paragraph_label_alter().
It can then be usedExtend the Paragraph entity class and override the label()
method like this:
functionclass hook_paragraph_label_alter(stringParagraphExt &$label,extends Paragraph $paragraph{
function label() {
$label = "Thisreturn is"your alabel";
new label";}
}
Then set it as the class to use in hook_entity_type_alter
like:
function hook_entity_type_alter(array &$entity_types) {
$entity_types['paragraph']->setClass(ParagraphExt::class);
}