function content_moderation_test_views_views_data_alter

Same name and namespace in other branches
  1. 10 core/modules/content_moderation/tests/modules/content_moderation_test_views/content_moderation_test_views.module \content_moderation_test_views_views_data_alter()

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

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'),
            ],
        ];
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.