app/proxy/entity/src/Eccube/Entity/ProductClass.php line 28

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of EC-CUBE
  4.  *
  5.  * Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
  6.  *
  7.  * http://www.ec-cube.co.jp/
  8.  *
  9.  * For the full copyright and license information, please view the LICENSE
  10.  * file that was distributed with this source code.
  11.  */
  12. namespace Eccube\Entity;
  13. use Doctrine\ORM\Mapping as ORM;
  14.     /**
  15.      * ProductClass
  16.      *
  17.      * @ORM\Table(name="dtb_product_class", indexes={@ORM\Index(name="dtb_product_class_price02_idx", columns={"price02"}), @ORM\Index(name="dtb_product_class_stock_stock_unlimited_idx", columns={"stock", "stock_unlimited"})})
  18.      * @ORM\InheritanceType("SINGLE_TABLE")
  19.      * @ORM\DiscriminatorColumn(name="discriminator_type", type="string", length=255)
  20.      * @ORM\HasLifecycleCallbacks()
  21.      * @ORM\Entity(repositoryClass="Eccube\Repository\ProductClassRepository")
  22.      */
  23.     class ProductClass extends \Eccube\Entity\AbstractEntity
  24.     {
  25.     use \Plugin\EccubePaymentLite42\Entity\ProductClassTrait;
  26.         private $price01_inc_tax null;
  27.         private $price02_inc_tax null;
  28.         private $tax_rate false;
  29.         /**
  30.          * 商品規格名を含めた商品名を返す.
  31.          *
  32.          * @return string
  33.          */
  34.         public function formattedProductName()
  35.         {
  36.             $productName $this->getProduct()->getName();
  37.             if ($this->hasClassCategory1()) {
  38.                 $productName .= ' - '.$this->getClassCategory1()->getName();
  39.             }
  40.             if ($this->hasClassCategory2()) {
  41.                 $productName .= ' - '.$this->getClassCategory2()->getName();
  42.             }
  43.             return $productName;
  44.         }
  45.         /**
  46.          * Is Enable
  47.          *
  48.          * @return bool
  49.          *
  50.          * @deprecated
  51.          */
  52.         public function isEnable()
  53.         {
  54.             return $this->getProduct()->isEnable();
  55.         }
  56.         /**
  57.          * Set price01 IncTax
  58.          *
  59.          * @param  string       $price01_inc_tax
  60.          *
  61.          * @return ProductClass
  62.          */
  63.         public function setPrice01IncTax($price01_inc_tax)
  64.         {
  65.             $this->price01_inc_tax $price01_inc_tax;
  66.             return $this;
  67.         }
  68.         /**
  69.          * Get price01 IncTax
  70.          *
  71.          * @return string
  72.          */
  73.         public function getPrice01IncTax()
  74.         {
  75.             return $this->price01_inc_tax;
  76.         }
  77.         /**
  78.          * Set price02 IncTax
  79.          *
  80.          * @return ProductClass
  81.          */
  82.         public function setPrice02IncTax($price02_inc_tax)
  83.         {
  84.             $this->price02_inc_tax $price02_inc_tax;
  85.             return $this;
  86.         }
  87.         /**
  88.          * Get price02 IncTax
  89.          *
  90.          * @return string
  91.          */
  92.         public function getPrice02IncTax()
  93.         {
  94.             return $this->price02_inc_tax;
  95.         }
  96.         /**
  97.          * Get StockFind
  98.          *
  99.          * @return bool
  100.          */
  101.         public function getStockFind()
  102.         {
  103.             if ($this->getStock() > || $this->isStockUnlimited()) {
  104.                 return true;
  105.             } else {
  106.                 return false;
  107.             }
  108.         }
  109.         /**
  110.          * Set tax_rate
  111.          *
  112.          * @param  string $tax_rate
  113.          *
  114.          * @return ProductClass
  115.          */
  116.         public function setTaxRate($tax_rate)
  117.         {
  118.             $this->tax_rate $tax_rate;
  119.             return $this;
  120.         }
  121.         /**
  122.          * Get tax_rate
  123.          *
  124.          * @return boolean
  125.          */
  126.         public function getTaxRate()
  127.         {
  128.             return $this->tax_rate;
  129.         }
  130.         /**
  131.          * Has ClassCategory1
  132.          *
  133.          * @return boolean
  134.          */
  135.         public function hasClassCategory1()
  136.         {
  137.             return isset($this->ClassCategory1);
  138.         }
  139.         /**
  140.          * Has ClassCategory1
  141.          *
  142.          * @return boolean
  143.          */
  144.         public function hasClassCategory2()
  145.         {
  146.             return isset($this->ClassCategory2);
  147.         }
  148.         /**
  149.          * @var int
  150.          *
  151.          * @ORM\Column(name="id", type="integer", options={"unsigned":true})
  152.          * @ORM\Id
  153.          * @ORM\GeneratedValue(strategy="IDENTITY")
  154.          */
  155.         private $id;
  156.         /**
  157.          * @var string|null
  158.          *
  159.          * @ORM\Column(name="product_code", type="string", length=255, nullable=true)
  160.          */
  161.         private $code;
  162.         /**
  163.          * @var string|null
  164.          *
  165.          * @ORM\Column(name="stock", type="decimal", precision=10, scale=0, nullable=true)
  166.          */
  167.         private $stock;
  168.         /**
  169.          * @var boolean
  170.          *
  171.          * @ORM\Column(name="stock_unlimited", type="boolean", options={"default":false})
  172.          */
  173.         private $stock_unlimited false;
  174.         /**
  175.          * @var string|null
  176.          *
  177.          * @ORM\Column(name="sale_limit", type="decimal", precision=10, scale=0, nullable=true, options={"unsigned":true})
  178.          */
  179.         private $sale_limit;
  180.         /**
  181.          * @var string|null
  182.          *
  183.          * @ORM\Column(name="price01", type="decimal", precision=12, scale=2, nullable=true)
  184.          */
  185.         private $price01;
  186.         /**
  187.          * @var string
  188.          *
  189.          * @ORM\Column(name="price02", type="decimal", precision=12, scale=2)
  190.          */
  191.         private $price02;
  192.         /**
  193.          * @var string|null
  194.          *
  195.          * @ORM\Column(name="delivery_fee", type="decimal", precision=12, scale=2, nullable=true, options={"unsigned":true})
  196.          */
  197.         private $delivery_fee;
  198.         /**
  199.          * @var boolean
  200.          *
  201.          * @ORM\Column(name="visible", type="boolean", options={"default":true})
  202.          */
  203.         private $visible;
  204.         /**
  205.          * @var \DateTime
  206.          *
  207.          * @ORM\Column(name="create_date", type="datetimetz")
  208.          */
  209.         private $create_date;
  210.         /**
  211.          * @var \DateTime
  212.          *
  213.          * @ORM\Column(name="update_date", type="datetimetz")
  214.          */
  215.         private $update_date;
  216.         /**
  217.          * @var string|null
  218.          *
  219.          * @ORM\Column(name="currency_code", type="string", nullable=true)
  220.          */
  221.         private $currency_code;
  222.         /**
  223.          * @var string
  224.          *
  225.          * @ORM\Column(name="point_rate", type="decimal", precision=10, scale=0, options={"unsigned":true}, nullable=true)
  226.          */
  227.         private $point_rate;
  228.         /**
  229.          * @var string
  230.          *
  231.          * @ORM\Column(name="pointwbike", type="decimal", precision=10, scale=0, options={"unsigned":true}, nullable=true)
  232.          */
  233.         private $pointwbike_rate;
  234.         /**
  235.          * @var \Eccube\Entity\ProductStock
  236.          *
  237.          * @ORM\OneToOne(targetEntity="Eccube\Entity\ProductStock", mappedBy="ProductClass", cascade={"persist","remove"})
  238.          */
  239.         private $ProductStock;
  240.         /**
  241.          * @var \Eccube\Entity\TaxRule
  242.          *
  243.          * @ORM\OneToOne(targetEntity="Eccube\Entity\TaxRule", mappedBy="ProductClass", cascade={"persist","remove"})
  244.          */
  245.         private $TaxRule;
  246.         /**
  247.          * @var \Eccube\Entity\Product
  248.          *
  249.          * @ORM\ManyToOne(targetEntity="Eccube\Entity\Product", inversedBy="ProductClasses")
  250.          * @ORM\JoinColumns({
  251.          *   @ORM\JoinColumn(name="product_id", referencedColumnName="id")
  252.          * })
  253.          */
  254.         private $Product;
  255.         /**
  256.          * @var \Eccube\Entity\Master\SaleType
  257.          *
  258.          * @ORM\ManyToOne(targetEntity="Eccube\Entity\Master\SaleType")
  259.          * @ORM\JoinColumns({
  260.          *   @ORM\JoinColumn(name="sale_type_id", referencedColumnName="id")
  261.          * })
  262.          */
  263.         private $SaleType;
  264.         /**
  265.          * @var \Eccube\Entity\ClassCategory
  266.          *
  267.          * @ORM\ManyToOne(targetEntity="Eccube\Entity\ClassCategory")
  268.          * @ORM\JoinColumns({
  269.          *   @ORM\JoinColumn(name="class_category_id1", referencedColumnName="id", nullable=true)
  270.          * })
  271.          */
  272.         private $ClassCategory1;
  273.         /**
  274.          * @var \Eccube\Entity\ClassCategory
  275.          *
  276.          * @ORM\ManyToOne(targetEntity="Eccube\Entity\ClassCategory")
  277.          * @ORM\JoinColumns({
  278.          *   @ORM\JoinColumn(name="class_category_id2", referencedColumnName="id", nullable=true)
  279.          * })
  280.          */
  281.         private $ClassCategory2;
  282.         /**
  283.          * @var \Eccube\Entity\DeliveryDuration
  284.          *
  285.          * @ORM\ManyToOne(targetEntity="Eccube\Entity\DeliveryDuration")
  286.          * @ORM\JoinColumns({
  287.          *   @ORM\JoinColumn(name="delivery_duration_id", referencedColumnName="id")
  288.          * })
  289.          */
  290.         private $DeliveryDuration;
  291.         /**
  292.          * @var \Eccube\Entity\Member
  293.          *
  294.          * @ORM\ManyToOne(targetEntity="Eccube\Entity\Member")
  295.          * @ORM\JoinColumns({
  296.          *   @ORM\JoinColumn(name="creator_id", referencedColumnName="id")
  297.          * })
  298.          */
  299.         private $Creator;
  300.         public function __clone()
  301.         {
  302.             $this->id null;
  303.         }
  304.         /**
  305.          * Get id.
  306.          *
  307.          * @return int
  308.          */
  309.         public function getId()
  310.         {
  311.             return $this->id;
  312.         }
  313.         /**
  314.          * Set code.
  315.          *
  316.          * @param string|null $code
  317.          *
  318.          * @return ProductClass
  319.          */
  320.         public function setCode($code null)
  321.         {
  322.             $this->code $code;
  323.             return $this;
  324.         }
  325.         /**
  326.          * Get code.
  327.          *
  328.          * @return string|null
  329.          */
  330.         public function getCode()
  331.         {
  332.             return $this->code;
  333.         }
  334.         /**
  335.          * Set stock.
  336.          *
  337.          * @param string|null $stock
  338.          *
  339.          * @return ProductClass
  340.          */
  341.         public function setStock($stock null)
  342.         {
  343.             $this->stock $stock;
  344.             return $this;
  345.         }
  346.         /**
  347.          * Get stock.
  348.          *
  349.          * @return string|null
  350.          */
  351.         public function getStock()
  352.         {
  353.             return $this->stock;
  354.         }
  355.         /**
  356.          * Set stockUnlimited.
  357.          *
  358.          * @param boolean $stockUnlimited
  359.          *
  360.          * @return ProductClass
  361.          */
  362.         public function setStockUnlimited($stockUnlimited)
  363.         {
  364.             $this->stock_unlimited $stockUnlimited;
  365.             return $this;
  366.         }
  367.         /**
  368.          * Get stockUnlimited.
  369.          *
  370.          * @return boolean
  371.          */
  372.         public function isStockUnlimited()
  373.         {
  374.             return $this->stock_unlimited;
  375.         }
  376.         /**
  377.          * Set saleLimit.
  378.          *
  379.          * @param string|null $saleLimit
  380.          *
  381.          * @return ProductClass
  382.          */
  383.         public function setSaleLimit($saleLimit null)
  384.         {
  385.             $this->sale_limit $saleLimit;
  386.             return $this;
  387.         }
  388.         /**
  389.          * Get saleLimit.
  390.          *
  391.          * @return string|null
  392.          */
  393.         public function getSaleLimit()
  394.         {
  395.             return $this->sale_limit;
  396.         }
  397.         /**
  398.          * Set price01.
  399.          *
  400.          * @param string|null $price01
  401.          *
  402.          * @return ProductClass
  403.          */
  404.         public function setPrice01($price01 null)
  405.         {
  406.             $this->price01 $price01;
  407.             return $this;
  408.         }
  409.         /**
  410.          * Get price01.
  411.          *
  412.          * @return string|null
  413.          */
  414.         public function getPrice01()
  415.         {
  416.             return $this->price01;
  417.         }
  418.         /**
  419.          * Set price02.
  420.          *
  421.          * @param string $price02
  422.          *
  423.          * @return ProductClass
  424.          */
  425.         public function setPrice02($price02)
  426.         {
  427.             $this->price02 $price02;
  428.             return $this;
  429.         }
  430.         /**
  431.          * Get price02.
  432.          *
  433.          * @return string
  434.          */
  435.         public function getPrice02()
  436.         {
  437.             return $this->price02;
  438.         }
  439.         /**
  440.          * Set deliveryFee.
  441.          *
  442.          * @param string|null $deliveryFee
  443.          *
  444.          * @return ProductClass
  445.          */
  446.         public function setDeliveryFee($deliveryFee null)
  447.         {
  448.             $this->delivery_fee $deliveryFee;
  449.             return $this;
  450.         }
  451.         /**
  452.          * Get deliveryFee.
  453.          *
  454.          * @return string|null
  455.          */
  456.         public function getDeliveryFee()
  457.         {
  458.             return $this->delivery_fee;
  459.         }
  460.         /**
  461.          * @return boolean
  462.          */
  463.         public function isVisible()
  464.         {
  465.             return $this->visible;
  466.         }
  467.         /**
  468.          * @param boolean $visible
  469.          *
  470.          * @return ProductClass
  471.          */
  472.         public function setVisible($visible)
  473.         {
  474.             $this->visible $visible;
  475.             return $this;
  476.         }
  477.         /**
  478.          * Set createDate.
  479.          *
  480.          * @param \DateTime $createDate
  481.          *
  482.          * @return ProductClass
  483.          */
  484.         public function setCreateDate($createDate)
  485.         {
  486.             $this->create_date $createDate;
  487.             return $this;
  488.         }
  489.         /**
  490.          * Get createDate.
  491.          *
  492.          * @return \DateTime
  493.          */
  494.         public function getCreateDate()
  495.         {
  496.             return $this->create_date;
  497.         }
  498.         /**
  499.          * Set updateDate.
  500.          *
  501.          * @param \DateTime $updateDate
  502.          *
  503.          * @return ProductClass
  504.          */
  505.         public function setUpdateDate($updateDate)
  506.         {
  507.             $this->update_date $updateDate;
  508.             return $this;
  509.         }
  510.         /**
  511.          * Get updateDate.
  512.          *
  513.          * @return \DateTime
  514.          */
  515.         public function getUpdateDate()
  516.         {
  517.             return $this->update_date;
  518.         }
  519.         /**
  520.          * Get currencyCode.
  521.          *
  522.          * @return string
  523.          */
  524.         public function getCurrencyCode()
  525.         {
  526.             return $this->currency_code;
  527.         }
  528.         /**
  529.          * Set currencyCode.
  530.          *
  531.          * @param string|null $currencyCode
  532.          *
  533.          * @return $this
  534.          */
  535.         public function setCurrencyCode($currencyCode null)
  536.         {
  537.             $this->currency_code $currencyCode;
  538.             return $this;
  539.         }
  540.         /**
  541.          * Set productStock.
  542.          *
  543.          * @param \Eccube\Entity\ProductStock|null $productStock
  544.          *
  545.          * @return ProductClass
  546.          */
  547.         public function setProductStock(ProductStock $productStock null)
  548.         {
  549.             $this->ProductStock $productStock;
  550.             return $this;
  551.         }
  552.         /**
  553.          * Get productStock.
  554.          *
  555.          * @return \Eccube\Entity\ProductStock|null
  556.          */
  557.         public function getProductStock()
  558.         {
  559.             return $this->ProductStock;
  560.         }
  561.         /**
  562.          * Set taxRule.
  563.          *
  564.          * @param \Eccube\Entity\TaxRule|null $taxRule
  565.          *
  566.          * @return ProductClass
  567.          */
  568.         public function setTaxRule(TaxRule $taxRule null)
  569.         {
  570.             $this->TaxRule $taxRule;
  571.             return $this;
  572.         }
  573.         /**
  574.          * Get taxRule.
  575.          *
  576.          * @return \Eccube\Entity\TaxRule|null
  577.          */
  578.         public function getTaxRule()
  579.         {
  580.             return $this->TaxRule;
  581.         }
  582.         /**
  583.          * Set product.
  584.          *
  585.          * @param \Eccube\Entity\Product|null $product
  586.          *
  587.          * @return ProductClass
  588.          */
  589.         public function setProduct(Product $product null)
  590.         {
  591.             $this->Product $product;
  592.             return $this;
  593.         }
  594.         /**
  595.          * Get product.
  596.          *
  597.          * @return \Eccube\Entity\Product|null
  598.          */
  599.         public function getProduct()
  600.         {
  601.             return $this->Product;
  602.         }
  603.         /**
  604.          * Set saleType.
  605.          *
  606.          * @param \Eccube\Entity\Master\SaleType|null $saleType
  607.          *
  608.          * @return ProductClass
  609.          */
  610.         public function setSaleType(Master\SaleType $saleType null)
  611.         {
  612.             $this->SaleType $saleType;
  613.             return $this;
  614.         }
  615.         /**
  616.          * Get saleType.
  617.          *
  618.          * @return \Eccube\Entity\Master\SaleType|null
  619.          */
  620.         public function getSaleType()
  621.         {
  622.             return $this->SaleType;
  623.         }
  624.         /**
  625.          * Set classCategory1.
  626.          *
  627.          * @param \Eccube\Entity\ClassCategory|null $classCategory1
  628.          *
  629.          * @return ProductClass
  630.          */
  631.         public function setClassCategory1(ClassCategory $classCategory1 null)
  632.         {
  633.             $this->ClassCategory1 $classCategory1;
  634.             return $this;
  635.         }
  636.         /**
  637.          * Get classCategory1.
  638.          *
  639.          * @return \Eccube\Entity\ClassCategory|null
  640.          */
  641.         public function getClassCategory1()
  642.         {
  643.             return $this->ClassCategory1;
  644.         }
  645.         /**
  646.          * Set classCategory2.
  647.          *
  648.          * @param \Eccube\Entity\ClassCategory|null $classCategory2
  649.          *
  650.          * @return ProductClass
  651.          */
  652.         public function setClassCategory2(ClassCategory $classCategory2 null)
  653.         {
  654.             $this->ClassCategory2 $classCategory2;
  655.             return $this;
  656.         }
  657.         /**
  658.          * Get classCategory2.
  659.          *
  660.          * @return \Eccube\Entity\ClassCategory|null
  661.          */
  662.         public function getClassCategory2()
  663.         {
  664.             return $this->ClassCategory2;
  665.         }
  666.         /**
  667.          * Set deliveryDuration.
  668.          *
  669.          * @param \Eccube\Entity\DeliveryDuration|null $deliveryDuration
  670.          *
  671.          * @return ProductClass
  672.          */
  673.         public function setDeliveryDuration(DeliveryDuration $deliveryDuration null)
  674.         {
  675.             $this->DeliveryDuration $deliveryDuration;
  676.             return $this;
  677.         }
  678.         /**
  679.          * Get deliveryDuration.
  680.          *
  681.          * @return \Eccube\Entity\DeliveryDuration|null
  682.          */
  683.         public function getDeliveryDuration()
  684.         {
  685.             return $this->DeliveryDuration;
  686.         }
  687.         /**
  688.          * Set creator.
  689.          *
  690.          * @param \Eccube\Entity\Member|null $creator
  691.          *
  692.          * @return ProductClass
  693.          */
  694.         public function setCreator(Member $creator null)
  695.         {
  696.             $this->Creator $creator;
  697.             return $this;
  698.         }
  699.         /**
  700.          * Get creator.
  701.          *
  702.          * @return \Eccube\Entity\Member|null
  703.          */
  704.         public function getCreator()
  705.         {
  706.             return $this->Creator;
  707.         }
  708.         /**
  709.          * Set pointRate
  710.          *
  711.          * @param string $pointRate
  712.          *
  713.          * @return ProductClass
  714.          */
  715.         public function setPointRate($pointRate)
  716.         {
  717.             $this->point_rate $pointRate;
  718.             return $this;
  719.         }
  720.         /**
  721.          * Get pointRate
  722.          *
  723.          * @return string
  724.          */
  725.         public function getPointRate()
  726.         {
  727.             return $this->point_rate;
  728.         }
  729.         /**
  730.          * Set pointwbikeRate
  731.          *
  732.          * @param string $pointwbikeRate
  733.          *
  734.          * @return ProductClass
  735.          */
  736.         public function setPointwbikeRate($pointwbikeRate)
  737.         {
  738.             $this->pointwbike_rate $pointwbikeRate;
  739.             return $this;
  740.         }
  741.         /**
  742.          * Get pointwbikeRate
  743.          *
  744.          * @return string
  745.          */
  746.         public function getPointwbikeRate()
  747.         {
  748.             return $this->pointwbike_rate;
  749.         }
  750.     }