bleu
(Zend W)
September 22, 2011, 10:52am
1
I would like to know how I can create models based on DAO and Query builder instead of Active Records.
I believe the controllers and view files will also be different for them.
I would like to create a complete application or at least a part of my application in Dao or Query builder as it has to return huge amounts of data
How can I go about achieving this,
Is there a tutorial or complete example anywhere, I have bits and pieces here and there but have not been able to put it together/
I am very new to yii and new to mvc as well
mikl
(Mike)
September 22, 2011, 3:36pm
2
You can always start with creating ActiveRecords for all your tables. That way you have easy, generic access to all your database tables through the convenient AR methods. Then you can spice up these models with extra methods. For example:
public function queryExtremelyComplexData($param)
{
return Yii::app()->db->createCommand(/* extremely complex SQL */)->queryAll();
}
This way you get the best of both worlds.
bleu
(Zend W)
September 23, 2011, 8:25am
3
You can always start with creating ActiveRecords for all your tables. That way you have easy, generic access to all your database tables through the convenient AR methods. Then you can spice up these models with extra methods. For example:
public function queryExtremelyComplexData($param)
{
return Yii::app()->db->createCommand(/* extremely complex SQL */)->queryAll();
}
This way you get the best of both worlds.
Yes that is a good idea,
Is there any demo or tutorial where both Dao or Query builder are used alongwith Ar
bleu
(Zend W)
September 26, 2011, 4:34am
4
Any other ideas are also welcome