Exemple #1
0
 function findCandidats($annee)
 {
     $t = new Individus();
     $db = $t->getAdapter();
     $s = $t->select()->setIntegrityCheck(false)->distinct()->from('individu')->join('unite_type', $db->quoteInto("unite_type.id = ?\n", intval($this->type)), array())->joinLeft('appartenance', $db->quoteInto('appartenance.individu = individu.id AND appartenance.unite = ?', $this->id) . ' AND ' . '(' . ('appartenance.fin IS NULL AND ' . $db->quoteInto("appartenance.debut < ?", Strass_Controller_Action_Helper_Annee::dateFin($annee))) . ')', array())->where('appartenance.id IS NULL')->where("unite_type.sexe IN ('m', individu.sexe)\n")->where("individu.naissance\n")->where("unite_type.age_min <= ? - individu.naissance - 1\n", $annee . '-8-01')->where("? - individu.naissance - 1 <= unite_type.age_max\n", $annee . '-8-01')->order('individu.nom', 'individu.prenom');
     return $t->fetchAll($s);
 }
Exemple #2
0
 function findIndividus()
 {
     $t = new Individus();
     $s = $t->select()->where('slug LIKE ?', wtk_strtoid($this->getFullname()) . '%');
     return $t->fetchAll($s)->current();
 }