public function StateFlowTest::init in State Machine 7
Same name and namespace in other branches
- 7.2 modules/state_flow/state_flow.api.php \StateFlowTest::init()
* Override the init method to set the new states * * Add a to review state and "Review" event
Overrides StateFlow::init
File
- modules/
state_flow/ state_flow.api.php, line 41 - Define a new StateMachine for the node
Class
- StateFlowTest
- Define a new workflow for a node type
Code
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',
));
}