You are here

class StateFlowTest in State Machine 7

Same name and namespace in other branches
  1. 7.3 modules/state_flow_entity/state_flow_entity.api.php \StateFlowTest
  2. 7.2 modules/state_flow/state_flow.api.php \StateFlowTest

Define a new workflow for a node type

Hierarchy

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

Namesort descending Modifiers Type Description Overrides
StateFlow::existing_revision public function
StateFlow::fire_event public function Extending fire_event() from state_machine's base.inc to add uid and log arguments. Overrides StateMachine::fire_event
StateFlow::get_event public function Return an event instance by key, lazy-loading the instance if necessary. Overrides StateMachine::get_event
StateFlow::get_latest_revision public function
StateFlow::get_object public function
StateFlow::get_states_options public function
StateFlow::latest_state public function
StateFlow::load public function Load the current state from the given state storage Overrides StateMachine::load
StateFlow::on_enter_published public function
StateFlow::on_exit_published public function
StateFlow::persist public function Persist the current state to the object storage. Overrides StateMachine::persist
StateFlow::revision_state public function
StateFlow::revision_state_record public function
StateFlow::set_node_revision public function
StateFlow::set_principle_revision public function
StateFlow::set_published public function
StateFlow::set_unpublished public function
StateFlow::write_history public function
StateFlowTest::init public function * Override the init method to set the new states * * Add a to review state and "Review" event Overrides StateFlow::init
StateMachine::$current protected property
StateMachine::$events protected property
StateMachine::$initial protected property
StateMachine::$object protected property
StateMachine::$states protected property
StateMachine::create_event 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::create_state 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::get_available_events public function Returns an array of events that are valid for the current state.
StateMachine::get_current_state public function Returns the current state.
StateMachine::get_state protected function Return a state instance by key, lazy-loading the instance if necessary.
StateMachine::on_event_fail protected function Method to be called when firing an event fails for any reason.
StateMachine::set_current_state protected function Set the current state to the state identified by the specified key.
StateMachine::set_initial_state protected function Set the initial state for this machine. By default, the initial state is set the the first created state.
StateMachine::__construct public function