src/Wizard/WizardTrait.php
protected function flow($step)
    {
        // Carregar id do flow
        $flow = router()->current()->parameter('flow');
        if (is_null($flow)) {
            error('Flow not information');
        }

        // Carregar model
        $this->model = call_user_func_array([$this->modelName, 'find'], [$flow]);
        if (is_null($this->model)) {
            error('Flow "%s" not found', $flow);
        }

        // Carregar step
        $step = is_null($step) ? $this->model->steps->firstId() : $step;
        if (! $this->model->steps->exists($step)) {
            error('Step "%s" not found', $step);
        }

        $this->model->steps->setCurrent($step);

        return $this->model->steps->current();
    }
protected function flow($step)
    {
        // Carregar id do flow
        $flow = router()->current()->parameter('flow');
        if (is_null($flow)) {
            error('Flow not information');
        }

        // Carregar model
        $this->model = call_user_func_array([$this->modelName, 'find'], [$flow]);
        if (is_null($this->model)) {
            error('Flow "%s" not found', $flow);
        }

        // Carregar step
        $step = is_null($step) ? $this->model->steps->firstId() : $step;
        if (! $this->model->steps->exists($step)) {
            error('Step "%s" not found', $step);
        }

        $this->model->steps->setCurrent($step);

        return $this->model->steps->current();
    }
protected function flow ( $ step ) { // Carregar id do flow $ flow = router ( ) -> current ( ) -> parameter ( 'flow' ) ; if ( is_null ( $ flow ) ) { error ( 'Flow not information' ) ; } // Carregar model $ this -> model = call_user_func_array ( [ $ this -> modelName , 'find' ] , [ $ flow ] ) ; if ( is_null ( $ this -> model ) ) { error ( 'Flow "%s" not found' , $ flow ) ; } // Carregar step $ step = is_null ( $ step ) ? $ this -> model -> steps -> firstId ( ) : $ step ; if ( ! $ this -> model -> steps -> exists ( $ step ) ) { error ( 'Step "%s" not found' , $ step ) ; } $ this -> model -> steps -> setCurrent ( $ step ) ; return $ this -> model -> steps -> current ( ) ; }
Define com step atual e retornal o objeto.
@param string $step
@return Step
Define com step atual e retornal o objeto .