You are here

public function Menu::viewsData in Workbench Access 8

Adds views data for the plugin.

Parameters

array $data: Views data.

\Drupal\workbench_access\Entity\AccessSchemeInterface $scheme: Access scheme that wraps this plugin.

Overrides AccessControlHierarchyBase::viewsData

File

src/Plugin/AccessControlHierarchy/Menu.php, line 240

Class

Menu
Defines a hierarchy based on a Menu.

Namespace

Drupal\workbench_access\Plugin\AccessControlHierarchy

Code

public function viewsData(array &$data, AccessSchemeInterface $scheme) {
  $data['node']['workbench_access_section'] = [
    'title' => t('Workbench Section @name', [
      '@name' => $scheme
        ->label(),
    ]),
    'help' => t('The sections to which this content belongs in the @name scheme.', [
      '@name' => $scheme
        ->label(),
    ]),
    'field' => [
      'scheme' => $scheme
        ->id(),
      'id' => 'workbench_access_section',
    ],
    'filter' => [
      'scheme' => $scheme
        ->id(),
      'field' => 'nid',
      'id' => 'workbench_access_section',
    ],
  ];
}