You are here

public function Role::buildLabel in Commerce License 8.2

Builds a label for the given license.

Parameters

\Drupal\commerce_license\Entity\LicenseInterface $license: The license.

Return value

string The label.

Overrides LicenseTypeInterface::buildLabel

File

src/Plugin/Commerce/LicenseType/Role.php, line 28

Class

Role
Provides a license type which grants one or more roles.

Namespace

Drupal\commerce_license\Plugin\Commerce\LicenseType

Code

public function buildLabel(LicenseInterface $license) {
  $args = [
    '@role' => $license->license_role->entity
      ->label(),
  ];
  return $this
    ->t('@role role license', $args);
}