You are here

protected function CRMCorePermissions::permissionLabels in CRM Core 8.2

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

Parameters

\Drupal\Core\Entity\EntityTypeInterface $entity_info:

Return value

mixed

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 125
Contains \Drupal\crm_core\CRMCorePermissions.

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