public function update(ProgramDTO $prog) { // if id = -1, there is nothing to do if (-1 === $prog->getProgramId()) { return; } $stmt = $this->pdo->prepare("UPDATE programme SET nom_programme = ?, duree = ?, realisateur_id = ?,type_id = ? WHERE programme_id = ?;"); $stmt->bindValue(1, $prog->getProgramName()); $stmt->bindValue(2, $prog->getDuration()); $stmt->bindValue(3, $prog->getDirectorId()); $stmt->bindValue(4, $prog->getTypeId()); $stmt->bindValue(5, $prog->getProgramId()); $stmt->execute(); }