Skip to content
Snippets Groups Projects
Commit 794d96e3 authored by John Voskuilen's avatar John Voskuilen
Browse files

Issue #3507882: Introduce Hook classes - views.inc

parent b35f7db4
No related branches found
No related tags found
No related merge requests found
Pipeline #448793 passed with warnings
......@@ -14,6 +14,7 @@ use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\Url;
use Drupal\field\Entity\FieldStorageConfig;
use Drupal\field\FieldStorageConfigInterface;
use Drupal\user\Entity\User;
use Drupal\workflow\Entity\Workflow;
use Drupal\workflow\Entity\WorkflowConfigTransitionInterface;
......@@ -22,6 +23,7 @@ use Drupal\workflow\Entity\WorkflowTargetEntity;
use Drupal\workflow\Entity\WorkflowTransitionInterface;
use Drupal\workflow\Hook\WorkflowEntityHooks;
use Drupal\workflow\Hook\WorkflowHooks;
use Drupal\workflow\Hook\WorkflowViewsHooks;
use Drupal\workflow\Entity\WorkflowRole;
require_once __DIR__ . '/workflow.devel.inc';
......@@ -86,6 +88,22 @@ function workflow_theme() {
return \Drupal::service(WorkflowHooks::class)->theme();
}
/**
* Implements hook_field_views_data().
*/
#[LegacyHook]
function workflow_field_views_data(FieldStorageConfigInterface $field) {
return \Drupal::service(WorkflowViewsHooks::class)->fieldViewsData($field);
}
/**
* Implements hook_views_data_alter().
*/
#[LegacyHook]
function workflow_views_data_alter(array &$data) {
\Drupal::service(WorkflowViewsHooks::class)->viewsDataAlter($data);
}
/**
* Business related functions, the API.
*/
......
......
<?php
/**
* @file
* Provide Views data for workflow.module.
*
* @ingroup views_module_handlers
*/
use Drupal\Core\Hook\Attribute\LegacyHook;
use Drupal\field\FieldStorageConfigInterface;
use Drupal\workflow\Hook\WorkflowViewsHooks;
/**
* Implements hook_field_views_data().
*/
#[LegacyHook]
function workflow_field_views_data(FieldStorageConfigInterface $field) {
return \Drupal::service(WorkflowViewsHooks::class)->fieldViewsData($field);
}
/**
* Implements hook_views_data_alter().
*/
#[LegacyHook]
function workflow_views_data_alter(array &$data) {
\Drupal::service(WorkflowViewsHooks::class)->viewsDataAlter($data);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment