Implements hook_views_data_alter().
See also
\Drupal\Tests\content_moderation\Kernel\ViewsModerationStateFilterTest
File
- core/
modules/ content_moderation/ tests/ modules/ content_moderation_test_views/ content_moderation_test_views.module, line 29 - Module file for the content moderation test views module.
Code
function content_moderation_test_views_views_data_alter(array &$data) {
if (isset($data['users_field_data'])) {
$data['users_field_data']['uid_revision_test'] = [
'help' => t('Relate the content revision to the user who created it.'),
'real field' => 'uid',
'relationship' => [
'title' => t('Content revision authored'),
'help' => t('Relate the content revision to the user who created it. This relationship will create one record for each content revision item created by the user.'),
'id' => 'standard',
'base' => 'node_field_revision',
'base field' => 'uid',
'field' => 'uid',
'label' => t('node revisions'),
],
];
}
}