You are here

function workflow_entity_presave in Workflow 8

Implements hook_entity_presave().

Parameters

\Drupal\Core\Entity\EntityInterface $entity: An EntityInterface object.

File

./workflow.module, line 185
Support workflows made up of arbitrary states.

Code

function workflow_entity_presave(EntityInterface $entity) {
  if (!$entity
    ->isNew()) {

    // Avoid a double call by hook_entity_presave and hook_entity_insert.
    _workflow_execute_transitions($entity);
  }
}