/** * Destructor * Close db connection */ public function __destruct() { if ($this->db) { $this->db->close(); } }