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;
    }