izzum\statemachine\SimpleTestFactory::createLoader PHP 메소드

createLoader() 보호된 메소드

protected createLoader ( )
    protected function createLoader()
    {
        //this is only for the tests.
        //normally you'd create a specific loader, which would get the data
        //from a backend somewhere.
        // 6 transitions, 5 states
        $transitions = array();
        $new = new State('new', \izzum\statemachine\State::TYPE_INITIAL);
        $a = new State('a');
        $b = new State('b');
        $c = new State('c');
        $done = new State('done', \izzum\statemachine\State::TYPE_FINAL);
        $transitions[] = new Transition($new, $a, null, 'izzum\\rules\\TrueRule', 'izzum\\command\\NullCommand');
        //can never go, a false rule
        $transitions[] = new Transition($a, $done, null, 'izzum\\rules\\FalseRule', 'izzum\\command\\NullCommand');
        $transitions[] = new Transition($a, $b, null, 'izzum\\rules\\TrueRule', 'izzum\\command\\NullCommand');
        //can never go, a false rule
        $transitions[] = new Transition($b, $c, null, 'izzum\\rules\\FalseRule', 'izzum\\command\\NullCommand');
        $transitions[] = new Transition($c, $done, null, 'izzum\\rules\\TrueRule', 'izzum\\command\\NullCommand');
        $transitions[] = new Transition($b, $done, null, 'izzum\\rules\\TrueRule', 'izzum\\command\\NullCommand');
        return new loader\LoaderArray($transitions);
    }