Posted 15 January 2010 - 07:40 AM
ON (CONCAT('sometext_',`t`.`id`) == `rel`.`itemId`)
Can i do this in the AR?
try with "on clause"
see this http://www.yiiframew...on-foreign-key/
Posted 18 January 2010 - 10:48 AM
You can put your relations function code here?
you have to put ' ' where is the column name
and use clause 'with' in the find method (not lazy loading)
in the model
'mySpecialRelation'=>array(self::BELONGS_TO,'TableRel','','on'=>'CONCAT(\'sometext_\',`t`.`id`) = `rel`.`itemId`','alias'=>'rel'),
in the controller
it's work on 1.0.x
This post has been edited by Horacio Segura: 18 January 2010 - 10:50 AM