I couldn’t understand something , very well.
We can use
ModelName::model()->find() , ModelName::model()->findAll(), ModelName::model()->findByPk()
etc. for reading datas from DB. Also we can insert data to DB like this :
$user = new User;
$user->name = 'Test';
$user->save();
I understood, all of this. And using this. But today i read, Query Builder reference. But i don’t understand, why should i use
Yii::app()->db->createCommand()
, instead of above methods (using model classes) ?
UPDATE
I found a quote, i think this is answer of my question :
from http://www.yiiframework.com/doc/guide/1.1/en/database.ar