You are here

public function StateFlowEntity::object_is_new in State Machine 7.3

Returns TRUE if the entity is new.

Return value

bool TRUE if the entity is new.

4 calls to StateFlowEntity::object_is_new()
StateFlowEntity::entityPresave in modules/state_flow_entity/plugins/state_flow_entity.inc
Called by hook_entity_presave().
StateFlowEntity::get_active_revision in modules/state_flow_entity/plugins/state_flow_entity.inc
Get the active revision.
StateFlowEntity::isDraftRevision in modules/state_flow_entity/plugins/state_flow_entity.inc
Check if the current object is a draft revision.
StateFlowEntity::write_state in modules/state_flow_entity/plugins/state_flow_entity.inc
Update the current status record for the revision.

File

modules/state_flow_entity/plugins/state_flow_entity.inc, line 169
State Flow implementation of the State Machine class.

Class

StateFlowEntity
@file State Flow implementation of the State Machine class.

Code

public function object_is_new() {

  // If the object is available, and has and id and isn't marked as new it's
  // an existing one - otherwise it's new.
  if (($object = $this
    ->get_object()) && !empty($object->{$this
    ->get_entity_id_key()}) && empty($object->is_new)) {
    return FALSE;
  }
  return TRUE;
}