Exemple #1
0
 private function parseRow($row)
 {
     if ($row == null) {
         return null;
     }
     $auction = new Wsm_Auction();
     $auction->setId($row['id']);
     $auction->setTitle($row['title']);
     $auction->setContent($row['content']);
     $auction->setDate($row['date']);
     $auction->setDateExpiry($row['expiryDate']);
     $auction->setSignature($row['signature']);
     return $auction;
 }
Exemple #2
0
 public function saveAction()
 {
     $auction = new Wsm_Auction();
     if ($this->has('id')) {
         $auction->setId($this->get('id'));
     }
     $auction->setTitle($this->get('title'));
     $auction->setContent($this->get('content'));
     $auction->setSignature($this->get('signature'));
     $auction->setDate($this->get('date'));
     $auction->setDateExpiry($this->get('dateExpiry'));
     $auctionService = new Wsm_Db_Auction();
     try {
         $auctionService->save($auction);
         $this->redirect('auctions/index?msg=saved');
     } catch (Exception $e) {
         $this->redirect('auctions/index?msg=save_error');
     }
 }