You are here

private function ScheduledPublishCron::updateNode in Scheduled Publish 8

1 call to ScheduledPublishCron::updateNode()
ScheduledPublishCron::updateNodeField in src/Service/ScheduledPublishCron.php

File

src/Service/ScheduledPublishCron.php, line 114

Class

ScheduledPublishCron
Class ScheduledPublishCron

Namespace

Drupal\scheduled_publish\Service

Code

private function updateNode(Node $node, string $moderationState, string $scheduledPublishField) : void {
  $node
    ->set($scheduledPublishField, NULL);
  $node
    ->set('moderation_state', $moderationState);
  $node
    ->save();
}