Commit 3d98a53d authored by Mathieu Loiseau's avatar Mathieu Loiseau
Browse files

Nettoyer BD qd fichier manquant (pas score)

parent 19b62550
......@@ -112,7 +112,6 @@ class ItemFactory //a quick and dirty class…
$res = false;
break;
}
return true;
}
......@@ -166,11 +165,25 @@ class ItemFactory //a quick and dirty class…
}
public function get_recording($queryType, $parameter = NULL){
//also checks if the recording exists
if($this->generate_query($queryType,$parameter)){
$this->db->query($this->query);
$res = $this->db->affected_rows();
if($res == 1){
$res = $this->db->fetch_object();
//checks whether the file exists makes it invalid otherwise
if(!file_exists("enregistrements/".$res->cheminEnregistrement)){
//set recording to invalid
$tmp_query = "UPDATE `enregistrement` SET `validation` = 'invalid', `tpsEnregistrement`=CURRENT_TIMESTAMP WHERE `enregistrement`.`enregistrementID` = ".$res->enregistrementID;
$res = $this->db->query($tmp_query);
//recursion
if($res){
$this->get_recording($queryType, $parameter);
}
else{
throw new Exception("Error chain in : ".$this->query." (recording not found) <br />".$tmp_query);
}
}
}
}
else{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment