I am trying to use a query with a calculated field in a Yii Relationship definition but all I get is errors.
Here is my query: $me = new CDbExpression('CONCAT_WS(\', \', last_name, first_name) AS the_name');
Here is my relation: 'author' => array(self::BELONGS_TO, 'Author', 'auth_id', 'select'=>$me),
My problem seems to be that CDbExpression is expecting a parameter but the query requires no parameters!?!?!?
I'm getting an Error 500 "trim() expects parameter 1 to be string, array given" (because I have no parameter!?!).
If I add a fake parameter: $me = new CDbExpression('CONCAT_WS(\', \', last_name, first_name) AS the_name',array('test'=>'test')); I get the same error message.
What am I doing wrong?