public function updateBid(Bid $bid)
 {
     $connection = ConnectionManager::getConnection();
     $amount = (double) $bid->amount;
     $timeOfBid = $bid->timeOfBid->format("Y-m-d H:i:s");
     $bidderID = (int) $bid->bidderID;
     $auctionID = (int) $bid->auctionID;
     if ($this->isValidBid($bid)) {
         $auctionManager = new AuctionManager();
         $bidder = (int) $auctionManager->getAuctionDetail($auctionID)->highestBidderID;
         $sql = "\n              INSERT INTO bid (amount, time_of_bid, auction_id, bidder_id)\n              VALUES ({$amount}, '{$timeOfBid}', {$auctionID}, {$bidderID})";
         if ($connection->query($sql) === TRUE) {
             $email = new EmailManager();
             if ($bidder != 0) {
                 $email->highestBidder($bid, $bidder);
             }
             $email->watcherEmail($auctionID, $amount);
             Alerter::showAlert("Your bid was posted successfully");
         } else {
             Alerter::showAlert("Error: " . $sql . " " . $connection->error);
         }
     } else {
         Alerter::showAlert("Your bid needs to be higher than the current highest bid and the starting price!");
     }
 }