iknow, that we have CDbCriteria. i was trying to solve my problems in many ways, e.g using addSearchCondition. but did you read my question? How can I prepare one composite condition chained with OR and add it into the main condition with AND?
thanks. And can we use addSearchCondition for instance? If yes, how to do it?
condition1-4 are the type of sql %name% LIKE ones, so I thought using addSearchCondition is the best way. If not, which one is?
This is my third project in Yii, and this time I want to use only its best features, and write the code as much as possible along with the framework philosophy.
For elegant written code there are the addCondition/addSearchCondition
Iif you check the source you will see that addSearchCondition call addCondition, and addCondition sets the condition property… so for the speed (a micromilisecond ) just set the condition property…
I realy don’t know how to get your need with addSearchCondition in other way than
$cr=new CDbCriteria();
$cr->addSearchCondition('condition1'...);
$cr->addSearchCondition('condition2 or condition3 or condition4',...);