/** * Inject the <b>StateMachine</b> into the PureMVC apparatus. * * Creates the <b>StateMachine</b> instance, registers all the states * and registers the <b>StateMachine</b> with the <b>IFacade</b>. * * @return void */ public function inject() { // Create the StateMachine $stateMachine = new StateMachine(); // Register all the states with the StateMachine foreach ($this->getStates() as $state) { $stateMachine->registerState($state, $this->isInitial($state->name)); } // Register the StateMachine with the facade $this->facade()->registerMediator($stateMachine); }