public function getRelatedAuction() { if (is_null($this->auction)) { $this->auction = Auction::getAuctionWithId((int) $this->auction_id); } return $this->auction; }
public function postBuyerFeedback(Request $request, Session $session, $auction_id) { if (!$session->userIsLoggedIn()) { return $this->redirectTo('/login'); } $auction = Auction::getAuctionWithId($auction_id); Database::insert('INSERT INTO BuyerFeedback (content, speed_of_payment, communication, auction_id) VALUES (?,?,?,?)', [$request->post['feedback_comment'], $request->post['speed_of_payment'], $request->post['communication'], $auction->id]); return $this->redirectTo('/dashboard/?message=' . urlencode('Feedback saved!')); }
private function setWatchConfirmation(&$data, $session, $request) { $current_user = $session->activeUser(); $current_auction = Auction::getAuctionWithId(intval($request->url_array[1])); $data["watch"] = $request->post["watch"]; if ($data["watch"] == "1") { $current_auction->startWatchingAuction($current_user); NotificationSender::sendWatchRecievedNotification($current_auction); } elseif ($data["watch"] == "0") { $current_auction->stopWatchingAuction($current_user); } }