class StateFlowTest in State Machine 7
Same name and namespace in other branches
- 7.3 modules/state_flow_entity/state_flow_entity.api.php \StateFlowTest
- 7.2 modules/state_flow/state_flow.api.php \StateFlowTest
Define a new workflow for a node type
Hierarchy
- class \StateMachine
- class \StateFlow
- class \StateFlowTest
- class \StateFlow
Expanded class hierarchy of StateFlowTest
1 string reference to 'StateFlowTest'
- hook_state_flow_plugins in modules/
state_flow/ state_flow.api.php - Implements hook_state_flow_plugins().
File
- modules/
state_flow/ state_flow.api.php, line 35 - Define a new StateMachine for the node
View source
class StateFlowTest extends StateFlow {
/**
* Override the init method to set the new states
*
* Add a to review state and "Review" event
*/
public function init() {
sefl::init();
$this
->add_state('review');
$this
->create_event('review', array(
'origin' => 'draft',
'target' => 'review',
));
// Initialize events
$this
->create_event('publish', array(
'origin' => 'review',
'target' => 'published',
));
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
StateFlow:: |
public | function | ||
StateFlow:: |
public | function |
Extending fire_event() from state_machine's base.inc to add uid and log
arguments. Overrides StateMachine:: |
|
StateFlow:: |
public | function |
Return an event instance by key, lazy-loading the instance if necessary. Overrides StateMachine:: |
|
StateFlow:: |
public | function | ||
StateFlow:: |
public | function | ||
StateFlow:: |
public | function | ||
StateFlow:: |
public | function | ||
StateFlow:: |
public | function |
Load the current state from the given state storage Overrides StateMachine:: |
|
StateFlow:: |
public | function | ||
StateFlow:: |
public | function | ||
StateFlow:: |
public | function |
Persist the current state to the object storage. Overrides StateMachine:: |
|
StateFlow:: |
public | function | ||
StateFlow:: |
public | function | ||
StateFlow:: |
public | function | ||
StateFlow:: |
public | function | ||
StateFlow:: |
public | function | ||
StateFlow:: |
public | function | ||
StateFlow:: |
public | function | ||
StateFlowTest:: |
public | function |
* Override the init method to set the new states
*
* Add a to review state and "Review" event Overrides StateFlow:: |
|
StateMachine:: |
protected | property | ||
StateMachine:: |
protected | property | ||
StateMachine:: |
protected | property | ||
StateMachine:: |
protected | property | ||
StateMachine:: |
protected | property | ||
StateMachine:: |
protected | function | Create a new event. This method does not actually create an event instance, it only stores the options array until an instance is requested from get_event(). | |
StateMachine:: |
protected | function | Create a new state. This method does not actually create a state instance, it only stores the options array until an instance is requested from get_state(). | |
StateMachine:: |
public | function | Returns an array of events that are valid for the current state. | |
StateMachine:: |
public | function | Returns the current state. | |
StateMachine:: |
protected | function | Return a state instance by key, lazy-loading the instance if necessary. | |
StateMachine:: |
protected | function | Method to be called when firing an event fails for any reason. | |
StateMachine:: |
protected | function | Set the current state to the state identified by the specified key. | |
StateMachine:: |
protected | function | Set the initial state for this machine. By default, the initial state is set the the first created state. | |
StateMachine:: |
public | function |