You are here

private function ParagraphDeleteForm::getInfoItem in Paragraphs table 8

2 calls to ParagraphDeleteForm::getInfoItem()
ParagraphDeleteForm::getDeletionMessage in src/Form/ParagraphDeleteForm.php
ParagraphDeleteForm::getQuestion in src/Form/ParagraphDeleteForm.php
Returns the question to ask the user.

File

src/Form/ParagraphDeleteForm.php, line 21

Class

ParagraphDeleteForm
Provides a form for deleting a paragraph from a node.

Namespace

Drupal\paragraphs_table\Form

Code

private function getInfoItem() {
  $field_name = $this->entity
    ->get('parent_field_name')->value;
  $host = $this->entity
    ->getParentEntity();
  $entity_type = $host
    ->getEntityTypeId();
  $bundle = $host
    ->bundle();
  $entityFieldManager = \Drupal::service('entity_field.manager')
    ->getFieldDefinitions($entity_type, $bundle);
  return [
    '%type' => $entityFieldManager[$field_name]
      ->getLabel(),
    '%id' => $this->entity
      ->id(),
  ];
}