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\EntityCode
public function setState(WorkflowInterface $workflow, string $state) {
$this->workflow = $workflow
->id();
$this->moderation_state = $state;
return $this;
}