You are here

public function FieldPermissionsController::buildHeader in Field Permissions 8

Same name and namespace in other branches
  1. 8.2 src/Controller/FieldPermissionsController.php \Drupal\field_permissions\Controller\FieldPermissionsController::buildHeader()

Build the table header for the report.

1 call to FieldPermissionsController::buildHeader()
FieldPermissionsController::content in src/Controller/FieldPermissionsController.php
Content to page report all field permissions settings.

File

src/Controller/FieldPermissionsController.php, line 91

Class

FieldPermissionsController
Define FieldPermissionsController.

Namespace

Drupal\field_permissions\Controller

Code

public function buildHeader() {
  $headers = [
    $this
      ->t('Field name'),
    $this
      ->t('Field type'),
    $this
      ->t('Entity type'),
    $this
      ->t('Used in'),
  ];
  $permissions_list = $this->fieldPermissions
    ->getList();
  foreach ($permissions_list as $permission_type => $permission_info) {
    $headers[] = [
      'data' => $permission_info['label'],
      'class' => 'field-permissions-header',
    ];
  }
  return $headers;
}