Example #1
0
 function findLastAlbum()
 {
     $t = new Activites();
     $db = $t->getAdapter();
     $s = $this->select()->setIntegrityCheck(false)->distinct()->from('activite')->join('participation', 'participation.activite = activite.id', array())->joinLeft(array('fille' => 'unite'), $db->quoteInto('fille.parent = ?', $this->id), array())->joinLeft(array('petitefille' => 'unite'), 'petitefille.parent = fille.id', array())->join('photo', 'photo.activite = activite.id', array())->where('participation.unite IN (?, fille.id, petitefille.id)', $this->id)->order('fin DESC');
     return $t->fetchFirst($s);
 }