public function model($name = '', $namespace = null)
    {
        if (null === $name) {
            $namespace = $this->namespace;
        }

        $namespace = $this->resolveNamespace($namespace);
        $model = $this->model = $this->createModelInstance($namespace, $name);

        return $model;
    }
public function model($name = '', $namespace = null)
    {
        if (null === $name) {
            $namespace = $this->namespace;
        }

        $namespace = $this->resolveNamespace($namespace);
        $model = $this->model = $this->createModelInstance($namespace, $name);

        return $model;
    }
public function model ( $ name = '' , $ namespace = null ) { if ( null === $ name ) { $ namespace = $ this -> namespace ; } $ namespace = $ this -> resolveNamespace ( $ namespace ) ; $ model = $ this -> model = $ this -> createModelInstance ( $ namespace , $ name ) ; return $ model ; }
create and return model instance

@param string $name
@param null $namespace
@return mixed
create and return model instance