You are here

protected function CRMCorePermissions::permissionLabels in CRM Core 8.3

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

Get labels for permissions.

Parameters

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

Return value

array Labels array with 'singular' and 'plural' keys.

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 124

Class

CRMCorePermissions
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;
}