You are here

public function ContentModerationConfigureEntityTypesForm::getTitle in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/content_moderation/src/Form/ContentModerationConfigureEntityTypesForm.php \Drupal\content_moderation\Form\ContentModerationConfigureEntityTypesForm::getTitle()

Route title callback.

1 string reference to 'ContentModerationConfigureEntityTypesForm::getTitle'
content_moderation.routing.yml in core/modules/content_moderation/content_moderation.routing.yml
core/modules/content_moderation/content_moderation.routing.yml

File

core/modules/content_moderation/src/Form/ContentModerationConfigureEntityTypesForm.php, line 221

Class

ContentModerationConfigureEntityTypesForm
The form for editing entity types associated with a workflow.

Namespace

Drupal\content_moderation\Form

Code

public function getTitle(WorkflowInterface $workflow = NULL, $entity_type_id) {
  $this->entityType = $this->entityTypeManager
    ->getDefinition($entity_type_id);
  $title = $this
    ->t('Select the @entity_type types for the @workflow workflow', [
    '@entity_type' => $this->entityType
      ->getLabel(),
    '@workflow' => $workflow
      ->label(),
  ]);
  if ($bundle_entity_type_id = $this->entityType
    ->getBundleEntityType()) {
    $title = $this
      ->t('Select the @entity_type_plural_label for the @workflow workflow', [
      '@entity_type_plural_label' => $this->entityTypeManager
        ->getDefinition($bundle_entity_type_id)
        ->getPluralLabel(),
      '@workflow' => $workflow
        ->label(),
    ]);
  }
  return $title;
}