You are here

public function WorkflowTransitionInterface::executeAndUpdateEntity in Workflow 8

Executes a transition (change state of an entity), from OUTSIDE the entity.

Use $transition->executeAndUpdateEntity() to start a State Change from outside an entity, e.g., workflow_cron(). Use $transition->execute() to start a State Change from within an entity.

A Scheduled Transition ($transition->isScheduled() == TRUE) will be un-scheduled and saved in the history table. The entity will not be updated. If $transition->isScheduled() == FALSE, the Transition will be removed from the {workflow_transition_scheduled} table (if necessary), and added to {workflow_transition_history} table. Then the entity wil be updated to reflect the new status.

@usage $to_sid = $transition->->executeAndUpdateEntity($force);

Parameters

bool $force: If set to TRUE, workflow permissions will be ignored.

Return value

string The resulting WorkflowState id.

See also

workflow_execute_transition()

1 method overrides WorkflowTransitionInterface::executeAndUpdateEntity()
WorkflowTransition::executeAndUpdateEntity in src/Entity/WorkflowTransition.php
Executes a transition (change state of an entity), from OUTSIDE the entity.

File

src/Entity/WorkflowTransitionInterface.php, line 118

Class

WorkflowTransitionInterface
Defines a common interface for Workflow*Transition* objects.

Namespace

Drupal\workflow\Entity

Code

public function executeAndUpdateEntity($force = FALSE);