You are here

public function ScheduledTransition::setState in Scheduled Transitions 2.x

Set the new workflow and state for this scheduled transition.

Parameters

\Drupal\workflows\WorkflowInterface $workflow: The workflow.

string $state: The state ID.

Return value

static Returns entity for chaining.

Overrides ScheduledTransitionInterface::setState

File

src/Entity/ScheduledTransition.php, line 220

Class

ScheduledTransition
Scheduled Transition entity.

Namespace

Drupal\scheduled_transitions\Entity

Code

public function setState(WorkflowInterface $workflow, string $state) {
  $this->workflow = $workflow
    ->id();
  $this->moderation_state = $state;
  return $this;
}