function ContentModerationConfigureEntityTypesForm::getTitle

Same name and namespace in other branches
  1. 9 core/modules/content_moderation/src/Form/ContentModerationConfigureEntityTypesForm.php \Drupal\content_moderation\Form\ContentModerationConfigureEntityTypesForm::getTitle()
  2. 10 core/modules/content_moderation/src/Form/ContentModerationConfigureEntityTypesForm.php \Drupal\content_moderation\Form\ContentModerationConfigureEntityTypesForm::getTitle()
  3. 11.x 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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.