findAll() question

Please, how can I do this using tb_broadcast::model()->findAll()?

I don’t know how to join the two tables :s



		->from('tb_broadcast as B, tb_spot as S')

		->where('B.id_spot=S.id_spot AND B.fc_delete IS NULL')



Assuming relation to tb_spot is defined like this in tb_broadcast class (as you just told me on irc):

'idSpot' => array(self::BELONGS_TO, 'Spot', 'id_spot')

$rs = tb_broadcast::model()->with('idSpot')->together()->findAll();

// now access attributes like this:

foreach($rs as $<img src='' class='bbc_emoticon' alt='B)' /> {

    echo $b->id_broadcast;

    echo $b->id_channel;

    echo $b->id_spot;

    echo $b->idSpot->id_tp_spot; // you can access the relations attribute via the defined relation


OK, thx!