Hello again…
I have the following:
Table1
id number status idT2
1 123-010 a 1
2 124-154 b 1
3 125-458 c 2
4 128-548 a 3
5 126-558 b 4
Table2
id name
1 XX
2 YY
3 WW
4 ZZ
5 MM
in my Table2 model I have te following relation declaration
'tables1'=>array(self::HAS_MANY,'Table1','idT2');
now, in an action of my Table2Controller i have the following:
$t2 = $this->loadTable2(); $inCondition=Table2::model()->dbConnection->commandBuilder->createInCondition(Table2::model()->tableName(), 'status', array('a','b')); $criteria->condition = $inCondition; $t1s= $t2->tables1($criteria);
But alway $t1s is an empty array…
Anybody can help me with this?