ScheduledTransitionsViewsData.php in Scheduled Transitions 2.x
File
src/ScheduledTransitionsViewsData.php
View source
<?php
declare (strict_types=1);
namespace Drupal\scheduled_transitions;
use Drupal\views\EntityViewsData;
class ScheduledTransitionsViewsData extends EntityViewsData {
public function getViewsData() : array {
$data = parent::getViewsData();
$data['scheduled_transition']['entity_revision_link'] = [
'field' => [
'id' => 'scheduled_transitions_revision_link',
],
'title' => $this
->t('Revision link'),
'help' => $this
->t('Link to the scheduled entity revision.'),
];
$data['scheduled_transition']['state_from'] = [
'field' => [
'id' => 'scheduled_transitions_transition_from',
],
'title' => $this
->t('Previous State'),
'help' => $this
->t('The previous state of the content.'),
];
$data['scheduled_transition']['moderation_state']['title'] = $this
->t('New State');
$data['scheduled_transition']['moderation_state']['field']['id'] = 'scheduled_transitions_transition_to';
return $data;
}
}