Hi,
In my AppController I do:
App::import('Model', 'Season');
$season = new Season();
$aktuelleSaison = $season->field('id', array('Season.is_aktuell'=> 1 ));
$teams = $season->Team->find('list', array('conditions', array('Team.season_id' => 11)));
debug($teams);
Of course the season hasMany Team. The Problem is: The fired Query is:
SELECT `Team`.`id`, `Team`.`name` FROM `teams` AS `Team` WHERE 1 = 1
Where is the conditions gone???
[solved] -> Syntax!!! There is a => not an , (i go home now!)
$teams = $season->Team->find('list', array('conditions' => array('Team.season_id' => $aktuelleSaison)));