public static function addStudent(Student $student, array $contact)
 {
     try {
         $conn = connection::getConnectionObject();
         $con = $conn->getConnection();
         $con->autocommit(false);
         $sql = $con->prepare("INSERT INTO Student VALUES (?,?,?,?,?,? )");
         $studentId = $student->getStudentId();
         $name = $student->getName();
         $faculty = $student->getFaculty();
         $batch = $student->getBatch();
         $address = $student->getAddress();
         $nic = $student->getNic();
         $sql->bind_param("ssssss", $studentId, $name, $batch, $faculty, $address, $nic);
         if ($sql->execute() == TRUE) {
             foreach ($contact as $value) {
                 $isAdded = StudentDBaccess::addStudentContact($con, $studentId, $value);
                 if ($isAdded == false) {
                     $con->rollback();
                     return false;
                 }
             }
             $con->commit();
             return true;
         } else {
             $con->rollback();
             return false;
             // echo "Error: " . $sql . "<br>";
         }
     } catch (Exception $e) {
         $con->rollback();
         return false;
     } finally {
         $con->close();
     }
 }