yiisoft/yii — Issue #445: Cannot use self::STAT with specific keys
Author: gauravmc
Created: 2012-03-03 18:02:57+00:00
State: open

With version 1.1.10, we have the ability to join AR models on a specific keys, and use something like,
```'jobs'=>array(self::HAS_MANY, 'Job', array('date' => 'target_date')),```
However, same cannot be done with self::STAT.

An error occurs in CStatElement.query function. The function tries to do a preg_match on the foreignKey to check whether it has round brackets in it. To choose between queryOneMany() and queryManyMany(). But now that we can provide an array in the ('fk'=>'pk') format, preg_match throws an error 'preg_match() expects parameter 2 to be string, array given'.

Just my understanding of the problem.