You are here

public function ConsentAgreementController::revisionPageTitle in General Data Protection Regulation 8.2

Same name and namespace in other branches
  1. 8 modules/gdpr_consent/src/Controller/ConsentAgreementController.php \Drupal\gdpr_consent\Controller\ConsentAgreementController::revisionPageTitle()
  2. 3.0.x modules/gdpr_consent/src/Controller/ConsentAgreementController.php \Drupal\gdpr_consent\Controller\ConsentAgreementController::revisionPageTitle()

Page title callback for a Consent Agreement revision.

Parameters

int $gdpr_consent_agreement_revision: The Consent Agreement revision ID.

Return value

string The page title.

Throws

\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException

File

modules/gdpr_consent/src/Controller/ConsentAgreementController.php, line 110

Class

ConsentAgreementController
Class ConsentAgreementController.

Namespace

Drupal\gdpr_consent\Controller

Code

public function revisionPageTitle($gdpr_consent_agreement_revision) {
  $gdprConsentAgreement = $this->entityTypeManager
    ->getStorage('gdpr_consent_agreement')
    ->loadRevision($gdpr_consent_agreement_revision);
  return $this
    ->t('Revision of %title from %date', [
    '%title' => $gdprConsentAgreement
      ->label(),
    '%date' => $this->dateFormatter
      ->format($gdprConsentAgreement
      ->getRevisionCreationTime()),
  ]);
}