<?php
namespace front\factory;
class ShopCoupon {
  private $id;
  private $name;
  private $status;
  private $type;
  private $amount;
  private $one_time;
  private $used;
  private $include_discounted_product;
  
  public function __construct() {
    ;
  }
  
  public function __get( $var ) {
    return $this -> $var;
  }
  
  public function __set( $var, $value ) {
    return $this -> $var = $value;
  }
  
  public function set_as_used() {
    global $mdb;
    $mdb -> update( 'pp_shop_coupon', [ 'used' => 1, 'date_used' => date( 'Y-m-d H:i:s' ) ], [ 'id' => $this -> id ] );
    $this -> used = 1;
  }
}
