What is the relation or difference between ActiveRecord and model in YII ?
i was trying to log is_object(CActiveRecord::model('Project')); and was expecting false but it returned true;
Since the logging indicated that it’s an object, i thought it is representing a row in the table, but i couldn’t find any attributes that represent the coloumns.
Also http://www.yiiframework.com/doc/api/1.1/CActiveRecord#model-detail states that it’s returning an instance of CActiveRecord class , but i could not find any values of the table row in that object.
The answer is in your documentation link,
model()is a class level method, and it:Let’s say you do:
$model=CActiveRecord::model('Project');, then using that$modelyou can call all the class level methods of CActiveRecord, like:Edit:
Also this post in the forum says: (Difference between class level and static methods)