You are here

function _workflow_get_entity_id in Workflow 7

Helper function. Replacement for entity_id(), in case Entity module is not enabled.

3 calls to _workflow_get_entity_id()
WorkflowItem::getCurrentState in includes/Field/WorkflowItem.php
WorkflowItem::update in includes/Field/WorkflowItem.php
Implements hook_field_update() -> FieldItemInterface::update()
WorkflowState::getOptions in includes/Entity/WorkflowState.php
Returns the allowed values for the current state.

File

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

Code

function _workflow_get_entity_id($entity_type, $entity) {
  return $entity_id = $entity_type == 'node' ? isset($entity->nid) ? $entity->nid : 0 : entity_id($entity_type, $entity);
}