YIiMongoDBSuite class name must be valid

Hello everyone!

I’m quite new to yii framework.

Last time around I tried using YiiMongoDBSuite extensions.

It works fine when I tried to insert data.

However, when I tried to retrieve data using : Usermongo::model()->find()

I got this error : Fatal error: Class name must be a valid object or a string in D:\xampp\htdocs\test\protected\extensions\YiiMongoDbSuite\EMongoDocument.php on line 1308

I tried using the instance, $user->find(), but it shows something like :

[personal_no] =>

[login] =>

empty value !

I also tried gii crud generator and it shows the same error :

Fatal error: Class name must be a valid object or a string in D:\xampp\htdocs\test\protected\extensions\YiiMongoDbSuite\EMongoDocument.php on line 1308

Is it some problem with configuration or PHP version ?

I am so lost, please help…

regards,

Brian

This means, that you don’t have a model with the classname ‘Usermongo’ or the class can not be found (maybe you have to Yii::import …)

What is the classname of your user model?

Is it really Usermongo?

If the model classname is ‘User’ you should call:


User::model()->find();

It is solved.

I think I copied wrong tutorial.

The problem is this :




public static function model($className=__CLASS__)

    {

        return parent::model($classname);

    }



The spelling of $classname in the return statement is incorrect.

Thanks for your reply.

regards,

Brian