一意のテーブルで 2 つのリクエストを伴うアクションがあります。要求の結果は異なる必要があります。
しかし、結果は私の 2 つの要求で同じであり、2 番目の要求からのものです。
// Récupération du (ou des) locataire(s) actuel(s) du logement
$this->locataires = Doctrine_Query::create()
->from('logement l')
->leftJoin('l.Bail b')
->leftJoin('b.Locataire')
->where('l.id = ?', $request->getParameter('id'))
->andWhere('(b.datefin >= ?', date('Y-m-d', time()))
->orWhere("b.datefin = '0000-00-00')")
->execute();
// Récupération du (ou des) locataire(s) précédent(s) du logement
$this->locatairesprec = Doctrine_Query::create()
->from('logement l')
->leftJoin('l.Bail b')
->leftJoin('b.Locataire')
->where('l.id = ?', $request->getParameter('id'))
->andWhere('b.datefin < ?', date('Y-m-d', time()))
->andWhere("b.datefin != '0000-00-00'")
->orderBy('datedeb')
->execute();