have tables:
place (id, title, state);
movie (id, title, state);
schedule (place_id, movie_id, time);
use simple yii models:
place.relations:
'movies' => array( self::MANY_MANY, 'movie',
'schedule(place_id,movie_id)',
'condition' => 'time > now()' ),
use simple yii controller:
$tmp = new Place();
$res = $tmp->findAll();
var_dump( $res[0]->movies );
yii returns a full list with the out state status :(
How can I get movies with the condition movie.state = 1 ?
If I'm reading your relations correctly, this should work.
In any case, consult the documentation for more advanced query options :) http://www.yiiframework.com/doc/api/1.1/CActiveRecord#find-detail