コード例 #1
0
ファイル: Default.php プロジェクト: ascertain/NGshop
 /**
  * @param null $seriesId
  * @return bool
  */
 public function cleanUpReservations($seriesId = null)
 {
     if (isset($seriesId)) {
         return OnlineShop_Framework_VoucherService_Reservation::cleanUpReservations($this->sysConfig->reservations->duration, $seriesId);
     } else {
         return OnlineShop_Framework_VoucherService_Reservation::cleanUpReservations($this->sysConfig->reservations->duration);
     }
 }
コード例 #2
0
ファイル: Resource.php プロジェクト: ascertain/NGshop
 /**
  * @return bool
  *
  * @param OnlineShop_Framework_ICart $cart
  */
 public function isReserved($cart = null)
 {
     $reservation = OnlineShop_Framework_VoucherService_Reservation::get($this->model->getToken(), $cart);
     if (!$reservation->exists()) {
         return false;
     }
     return true;
 }
コード例 #3
0
ファイル: Resource.php プロジェクト: ascertain/NGshop
 public function create($code, $cart)
 {
     if (OnlineShop_Framework_VoucherService_Reservation::reservationExists($code, $cart)) {
         return true;
     }
     try {
         // Single Type Token --> only one token per Cart! --> Update on duplicate key!
         $this->db->query("INSERT INTO " . self::TABLE_NAME . " (token,cart_id,timestamp) VALUES (?,?,NOW())", [$code, $cart->getId()]);
         return true;
     } catch (Exception $e) {
         return false;
     }
 }
コード例 #4
0
ファイル: Token.php プロジェクト: ascertain/NGshop
 public function release($cart)
 {
     return OnlineShop_Framework_VoucherService_Reservation::releaseToken($this, $cart);
 }
コード例 #5
0
ファイル: AbstractCart.php プロジェクト: ascertain/NGshop
 /**
  * Checks if checkout data voucher tokens are valid reservations
  */
 protected function validateVoucherTokenReservations()
 {
     foreach ($this->getVoucherTokenCodes() as $code) {
         $reservation = OnlineShop_Framework_VoucherService_Reservation::get($code, $this);
         if (!$reservation->check($this->getId())) {
             unset($this->checkoutData["voucher_" . $code]);
         }
     }
 }
コード例 #6
0
ファイル: Pattern.php プロジェクト: ascertain/NGshop
 /**
  * Removes reservations
  *
  * @param int $duration
  * @return bool
  */
 public function cleanUpReservations($duration = 0)
 {
     return OnlineShop_Framework_VoucherService_Reservation::cleanUpReservations($duration, $this->seriesId);
 }