16,6 → 16,7 |
class AlerteMailADeterminer { |
|
private $conteneur; |
private $testeurCourriel = null; |
|
private $observations_concernees = array(); |
|
25,6 → 26,7 |
|
public function executer() { |
try { |
$this->verifierModeUtilisation(); |
$observations = $this->chargerObsADeterminer(); |
if (!empty($observations)) { |
$this->formaterObservations($observations); |
36,6 → 38,18 |
} |
} |
|
private function verifierModeUtilisation() { |
$testeurCourriel = $this->conteneur->getParametre('t'); |
if ($testeurCourriel) { |
if (filter_var($testeurCourriel, FILTER_VALIDATE_EMAIL)) { |
$this->testeurCourriel = $testeurCourriel; |
} else { |
$msg = "Veuillez indiquer une adresse de courriel valide à la suite du paramètre «-t»."; |
new Exception($msg); |
} |
} |
} |
|
protected function chargerObsADeterminer() { |
//TODO: optimiser la requête si beaucoup de mails sont envoyés |
$requete = "SELECT * ". |