Example #1
0
 public function find($id)
 {
     $id = (int) $id;
     $prog = false;
     $stmt = $this->pdo->prepare("SELECT * FROM programme WHERE programme_id=?;");
     $stmt->bindValue(1, $id);
     $stmt->execute();
     $res = $stmt->fetch(\PDO::FETCH_ASSOC);
     if ($res) {
         $prog = new ProgramDTO();
         $prog->hydrateSQL($res);
     }
     return $prog;
 }