Due to the change of normal entities to ConfigEntities, the following is changed in WorkflowState.
- The constant WORKFLOW_CREATION is renamed to WORKFLOW_CREATION_STATE;
D7: define('WORKFLOW_CREATION', 1);
D8: define('WORKFLOW_CREATION_STATE', 1);
Determination if a state is the CREATION state, is done via
return $state->sysid == WORKFLOW_CREATION_STATE;
- In WorkflowState, the variables $state->sid and $state->name are removed. Use $state->id() instead.
- In WorkflowState, the variable $state->state contains the human-readable name, and is renamed to $state->label. Fetch via $state->label();
- The following functions are deprecated/removed/renamed:
- workflow_state_load_single($sid) ==> WorkflowState::load($sid)
- workflow_state_load_multiple($wid) ==> WorkflowState::loadMultiple($ids = array(), $wid, $reset)
- WorkflowState::getStates($wid) ==> WorkflowState::loadMultiple($ids = array(), $wid, $reset)
- etc..
- The function parameter $entity_type has been removed from most function calls, since this can be fetched in D8 via $entity->getEntityTypeId().
- In WorkflowTransition, the variables $transition->sid and $transition->new_sid are renamed to $from_sid and to_sid for better consistancy.
- The custom 'delete' hooks are removed. Use hook_entity_predelete(EntityInterface) and hook_entity_delete(EntityInterface) instead. See documentation in workflow.api.php