public function StateFlowEntity::fire_event in State Machine 7.3
Extending fire_event() from state_machine's base.inc.
Extending fire_event() from state_machine's base.inc to add uid and log arguments.
Parameters
string $key: The event name.
int $uid: The user id this event is fired for.
string $log: The log message for the history.
Return value
bool TRUE if successful, FALSE otherwise.
Overrides StateMachine::fire_event
See also
state_flow_entity_entity_presave()
File
- modules/
state_flow_entity/ plugins/ state_flow_entity.inc, line 528 - State Flow implementation of the State Machine class.
Class
- StateFlowEntity
- @file State Flow implementation of the State Machine class.
Code
public function fire_event($key, $uid = NULL, $log = '') {
if ($event = $this
->get_event($key)) {
$object = $this
->get_object();
// Set the event properties on the entity.
$object->event = $key;
$object->event_comment = $log;
$object->event_uid = $uid;
// Save the object, all subsequent handling is done using the entity API
// hooks and drafty.
entity_save($this
->get_entity_type(), $object);
return TRUE;
}
$this
->on_event_fail($event);
return FALSE;
}