You are here

protected function CRMCorePermissions::permissionLabels in CRM Core 8

Same name and namespace in other branches
  1. 8.3 src/CRMCorePermissions.php \Drupal\crm_core\CRMCorePermissions::permissionLabels()
  2. 8.2 src/CRMCorePermissions.php \Drupal\crm_core\CRMCorePermissions::permissionLabels()

Permission labels.

Parameters

\Drupal\Core\Entity\EntityTypeInterface $entity_info: Entity info.

Return value

mixed Labels.

2 calls to CRMCorePermissions::permissionLabels()
CRMCorePermissions::bundlePermissions in src/CRMCorePermissions.php
Define per-bundle permissions.
CRMCorePermissions::entityTypePermissions in src/CRMCorePermissions.php
Return permission names for a given CRM Core entity type.

File

src/CRMCorePermissions.php, line 122

Class

CRMCorePermissions
Defines a class containing permission callbacks.

Namespace

Drupal\crm_core

Code

protected function permissionLabels(EntityTypeInterface $entity_info) {
  $labels = $entity_info
    ->get("permission_labels");
  if (!isset($labels['singular'])) {
    $labels['singular'] = $entity_info
      ->getLabel();
  }
  if (!isset($labels['plural'])) {
    $labels['plural'] = $entity_info
      ->getLabel();
  }
  return $labels;
}