You are here

public function StateFlowEntity::on_exit_scheduled in State Machine 7.3

Remove scheduled events if the new state isn't scheduled.

1 call to StateFlowEntity::on_exit_scheduled()
StateFlowNode::on_exit_scheduled in modules/state_flow/plugins/state_flow_node.inc
Handle unpublishing / publishing.
1 method overrides StateFlowEntity::on_exit_scheduled()
StateFlowNode::on_exit_scheduled in modules/state_flow/plugins/state_flow_node.inc
Handle unpublishing / publishing.

File

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

Class

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

Code

public function on_exit_scheduled() {
  $event = $this
    ->get_event($this
    ->get_history_entity()->event);
  if (module_exists('state_flow_schedule') && $event
    ->get_option('target') !== 'schedule') {
    db_query('
        DELETE FROM state_flow_schedule
        WHERE entity_type = :entity_type
        AND entity_id = :entity_id
        AND revision_id = :revision_id', array(
      ':entity_type' => $this
        ->get_entity_type(),
      ':entity_id' => $this->object->{$this
        ->get_entity_id_key()},
      ':revision_id' => $this->object->{$this
        ->get_revision_key()},
    ));
  }
}