app/Plugin/QuantityDiscountDx/Entity/QdProductClass.php line 13

Open in your IDE?
  1. <?php
  2. namespace Plugin\QuantityDiscountDx\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5.  * PlgQdProductClass
  6.  *
  7.  * @ORM\Table(name="plg_qd_product_class")
  8.  * @ORM\Entity(repositoryClass="Plugin\QuantityDiscountDx\Repository\QdProductClassRepository")
  9.  */
  10. class QdProductClass extends \Eccube\Entity\AbstractEntity
  11. {
  12.     // 割引種類 価格
  13.     const QD_TYPE_PRICE 1;
  14.     // 割引種類 割引率
  15.     const QD_TYPE_RATE 2;
  16.     /**
  17.      * @var int
  18.      *
  19.      * @ORM\Column(name="id", type="integer")
  20.      * @ORM\Id
  21.      * @ORM\GeneratedValue(strategy="IDENTITY")
  22.      */
  23.     private $id;
  24.     /**
  25.      * @var \Eccube\Entity\ProductClass
  26.      *
  27.      * @ORM\ManyToOne(targetEntity="Eccube\Entity\ProductClass", inversedBy="QdProductClasses")
  28.      * @ORM\JoinColumns({
  29.      *   @ORM\JoinColumn(name="product_class_id", referencedColumnName="id")
  30.      * })
  31.      */
  32.     private $ProductClass;
  33.     /**
  34.      * @var int
  35.      *
  36.      * @ORM\Column(name="quantity", type="integer", nullable=false)
  37.      */
  38.     private $quantity;
  39.     /**
  40.      * @var int
  41.      *
  42.      * @ORM\Column(name="qd_type", type="integer", nullable=false)
  43.      */
  44.     private $qdType;
  45.     /**
  46.      * @var string|null
  47.      *
  48.      * @ORM\Column(name="price", type="decimal", precision=12, scale=2, nullable=true)
  49.      */
  50.     private $price;
  51.     /**
  52.      * @var int|null
  53.      *
  54.      * @ORM\Column(name="rate", type="integer", nullable=true)
  55.      */
  56.     private $rate;
  57.     /**
  58.      * Get id.
  59.      *
  60.      * @return int
  61.      */
  62.     public function getId()
  63.     {
  64.         return $this->id;
  65.     }
  66.     /**
  67.      * Set quantity.
  68.      *
  69.      * @param int $quantity
  70.      *
  71.      * @return QdProductClass
  72.      */
  73.     public function setQuantity($quantity)
  74.     {
  75.         $this->quantity $quantity;
  76.         return $this;
  77.     }
  78.     /**
  79.      * Get quantity.
  80.      *
  81.      * @return int
  82.      */
  83.     public function getQuantity()
  84.     {
  85.         return $this->quantity;
  86.     }
  87.     /**
  88.      * Set qdType.
  89.      *
  90.      * @param int $qdType
  91.      *
  92.      * @return QdProductClass
  93.      */
  94.     public function setQdType($qdType)
  95.     {
  96.         $this->qdType $qdType;
  97.         return $this;
  98.     }
  99.     /**
  100.      * Get qdType.
  101.      *
  102.      * @return int
  103.      */
  104.     public function getQdType()
  105.     {
  106.         return $this->qdType;
  107.     }
  108.     /**
  109.      * Set price.
  110.      *
  111.      * @param string|null $price
  112.      *
  113.      * @return QdProductClass
  114.      */
  115.     public function setPrice($price null)
  116.     {
  117.         $this->price $price;
  118.         return $this;
  119.     }
  120.     /**
  121.      * Get price.
  122.      *
  123.      * @return string|null
  124.      */
  125.     public function getPrice()
  126.     {
  127.         return $this->price;
  128.     }
  129.     /**
  130.      * Set rate.
  131.      *
  132.      * @param int|null $rate
  133.      *
  134.      * @return QdProductClass
  135.      */
  136.     public function setRate($rate null)
  137.     {
  138.         $this->rate $rate;
  139.         return $this;
  140.     }
  141.     /**
  142.      * Get rate.
  143.      *
  144.      * @return int|null
  145.      */
  146.     public function getRate()
  147.     {
  148.         return $this->rate;
  149.     }
  150.     /**
  151.      * Set productClass.
  152.      *
  153.      * @param \Eccube\Entity\ProductClass|null $productClass
  154.      *
  155.      * @return QdProductClass
  156.      */
  157.     public function setProductClass(\Eccube\Entity\ProductClass $productClass null)
  158.     {
  159.         $this->ProductClass $productClass;
  160.         return $this;
  161.     }
  162.     /**
  163.      * Get productClass.
  164.      *
  165.      * @return \Eccube\Entity\ProductClass|null
  166.      */
  167.     public function getProductClass()
  168.     {
  169.         return $this->ProductClass;
  170.     }
  171.     public function isQdTypePrice()
  172.     {
  173.         return $this->qdType == self::QD_TYPE_PRICE;
  174.     }
  175.     public function isQdTypeRate()
  176.     {
  177.         return $this->qdType == self::QD_TYPE_RATE;
  178.     }
  179.     public function __clone()
  180.     {
  181.         $this->id null;
  182.     }
  183. }