When using CDbCriteria combined with ‘with’ for other CDbCriteria and their own params, it would be nice to be able to define the PARAM_PREFIX for each given criteria.
Currently, if I have two CDbCriteria’s with separate params using the ‘with’ function, it simply does not work since the param names are the same on both CDbCriteria’s (i.e. :ycp0, :ycp1, etc).
Criteria 1:
$criteria1 = new CDBCriteria;
$criteria1->alias=$tableAlias1;
$criteria1->compare('COLUMN1', $value1, TRUE);
$criteria1->select=$selectColumns1;
Criteria 2:
$criteria2 = new CDBCriteria;
$criteria2->alias=$tableAlias2;
$criteria2->compare('COLUMN1', $value2, TRUE);
$criteria2->select=$selectColumns2;
$criteria2->with = $criteria1;
If one could supply the prefix initially, I think it could be highly useful.
$criteria1->param_prefix=':one';
$criteria2->param_prefix=':two';