function scheduled_transitions_update_8005 in Scheduled Transitions 8
Same name and namespace in other branches
- 2.x scheduled_transitions.install \scheduled_transitions_update_8005()
Updates definitions with functionality necessary for rescheduling.
File
- ./
scheduled_transitions.install, line 69
Code
function scheduled_transitions_update_8005() : void {
$entityTypeId = 'scheduled_transition';
$definitionUpdateManager = \Drupal::entityDefinitionUpdateManager();
$entityType = $definitionUpdateManager
->getEntityType($entityTypeId);
$entityType
->setFormClass('reschedule', 'Drupal\\scheduled_transitions\\Form\\Entity\\ScheduledTransitionRescheduleForm');
$routeProviders = $entityType
->get('route_provider');
$routeProviders['html'] = 'Drupal\\scheduled_transitions\\Routing\\ScheduledTransitionRouteProvider';
$entityType
->set('route_provider', $routeProviders);
$entityType
->setLinkTemplate('reschedule-form', '/admin/scheduled-transition/{scheduled_transition}/reschedule');
$definitionUpdateManager
->updateEntityType($entityType);
}