pdo->prepare("INSERT INTO Formation (labelFormation, isInternal) VALUE (:label,:isInternal);"); $st->execute([ "label" => $label, "isInternal" => $isInternal? 1 : 0 ]); return $this->pdo->lastInsertId(); } public function exists(string $label) : int{ $st = $this->pdo->prepare("SELECT idFormation FROM Formation WHERE labelFormation = :label"); $st->execute([ "label" => $label ]); return $st->fetch()["idFormation"]?: 0; } public function delete(int $id) : bool{ $st = $this->pdo->prepare("DELETE FROM Formation WHERE idFormation = :id"); return $st->execute([ "id" => $id ]); } }