/**
* Returns the views data.
*
* @return array
* The views data.
*/
public function getViewsData() { $data =
[];
$entity_types_with_moderation =
array_filter($this->entityTypeManager->
getDefinitions(),
function DEntityTypeInterface
$type) { return $this->moderationInformation->
isModeratedEntityType($type);
});
foreach ($entity_types_with_moderation as $entity_type) { $table =
$entity_type->
getDataTable() ?:
$entity_type->
getBaseTable();
$data[$table]['moderation_state'
] =
[ 'title' =>
t('Moderation state'
),
'field' =>
[ 'id' => 'moderation_state_field',
'default_formatter' => 'content_moderation_state',
'field_name' => 'moderation_state',
],