You are here

function hook_entity_predelete in Workflow 8

Hooks defined by core Entity: hook_entity_CRUD.

Instead of using hook_entity_OPERATION, better use hook_ENTITY_TYPE_OPERATION.

See also

hook_entity_create(), hook_entity_update(), etc.

hook_ENTITY_TYPE_create(), hook_ENTITY_TYPE_update(), etc.

1 call to hook_entity_predelete()
workflow_devel_entity_predelete in modules/workflow_devel/workflow_devel.module
@inheritdoc
1 function implements hook_entity_predelete()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

workflow_devel_entity_predelete in modules/workflow_devel/workflow_devel.module
@inheritdoc

File

./workflow.api.php, line 433
Hooks provided by the workflow module.

Code

function hook_entity_predelete(EntityInterface $entity) {
  if (substr($entity
    ->getEntityTypeId(), 0, 8) == 'workflow') {

    // workflow_debug(__FILE__, __FUNCTION__, __LINE__, 'pre-delete', $entity->getEntityTypeId());
  }
  switch ($entity
    ->getEntityTypeId()) {
    case 'workflow_config_transition':
    case 'workflow_state':
    case 'workflow_type':

      // Better use hook_ENTITY_TYPE_OPERATION.
      // E.g., hook_workflow_type_predelete.
      break;
  }
}