Hi, I have this:
$areasUsuarioActivo = UsuarioArea::model()->with('area')->find(
array(
'condition' => 'usuario_id = :usuario_id',
'select' => 'area.texto',
'params' => array('usuario_id' => Usuario::getActiveUserId())
)
);
and yii give me this error:
>>Active record "Usuarioarea" esta intentando de seleccionar una columna inválida "area.texto". Nota: >>La columna puede existir en la base o ser una expresion con alias.
If I comment the select the trace shows:
>> Querying SQL: SELECT t.usuario_id AS t0_c0, t.area_id AS t0_c1,
>> t.id AS t0_c2, area.id AS t1_c0, area.texto AS t1_c1,
>> area.orden AS t1_c2, area.publica AS t1_c3 FROM usuarioarea
>> t LEFT OUTER JOIN area area ON (t.area_id=area.id) WHERE
>> (usuario_id = :usuario_id). Bind with parameter :usuario_id=‘3’
It seems that all is ok, area.texto seems to be there, does someone see something wrong?
pd: if in the select I replace area.texto with area.id there is no error!