Simple Question About Format In Yii Guides

down vote favorite

It’s a simple question but since I am a beginner, it confuses me.

In the tutorials, for example: http://www.yiiframework.com/doc/guide/1.1/en/database.dao it references methods like this:

But in the specification http://www.yiiframework.com/doc/api/1.1/CDbConnection#createCommand-detail it says public CDbCommand createCommand(mixed $query=NULL)

As far as I know the :: are for static methods/properties.

I know I am missing something because they use this format everywhere.

Thanks!

I suppose because CDbConnection->createCommand() would be just as confusing as CDbConnection isn’t an object.

How is it that its not an object? You’re confusing a newbie bro :P

Aren’t all instantiated classes objects?

I probably didn’t explain that very well. CDbConnection is the class, not an instance of the class, so it wouldn’t make sense to treat it as an object.

It seems that the PHP documentation (here for example) uses the same format, so I’d guess this way has been chosen in Yii for consistency.