CDbCriteria::_paramCount has to be static

I propose to declare CDbCriteria::_paramCount property as static.

With current non static declaration i see no way to merge two criterias correctly.

Imagine we have two criterias whose conditions was added by "addXXXCondition" methods and we need to merge them. But there is no way to do it correctly atm. Parameters will override each other, because $_paramCount starts with 0 in both criterias.

CDbCriteria in trunk is able to merge parameters.

Wow, pregs… it seems to be a bit heavy…

My criterias have hundreds of parameters… :(

No chance to make static param counter? It is easier, isn’t it?

So you’ve tried it with static param and it works fine? What about using multiple criterias during a single request?

Yep. As a workaround i made a copy of CDbCriteria and changed paramCount declaration and all paramCount calls to static notation. It works.

All criterias will have common paramCount numeration. This numeration is used only with autogenerated param names. I see no problem here.

OK. Will check it. Maybe it will be in 1.1.2.

It would be nice, thanks!

Implemented it. Please test.

http://code.google.com/p/yii/source/detail?r=2065

It works fine :)

Thanks!