Implements hook_entity_presave()
function entity_test_entity_presave(EntityInterface $entity) { if (isset($GLOBALS['entity_test_throw_exception'])) { throw new Exception('Entity presave exception', 1); } }