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\CustomerRank42\Entity\ProductClassTrait\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 \Eccube\Entity\ProductStock
  230.          *
  231.          * @ORM\OneToOne(targetEntity="Eccube\Entity\ProductStock", mappedBy="ProductClass", cascade={"persist","remove"})
  232.          */
  233.         private $ProductStock;
  234.         /**
  235.          * @var \Eccube\Entity\TaxRule
  236.          *
  237.          * @ORM\OneToOne(targetEntity="Eccube\Entity\TaxRule", mappedBy="ProductClass", cascade={"persist","remove"})
  238.          */
  239.         private $TaxRule;
  240.         /**
  241.          * @var \Eccube\Entity\Product
  242.          *
  243.          * @ORM\ManyToOne(targetEntity="Eccube\Entity\Product", inversedBy="ProductClasses")
  244.          * @ORM\JoinColumns({
  245.          *   @ORM\JoinColumn(name="product_id", referencedColumnName="id")
  246.          * })
  247.          */
  248.         private $Product;
  249.         /**
  250.          * @var \Eccube\Entity\Master\SaleType
  251.          *
  252.          * @ORM\ManyToOne(targetEntity="Eccube\Entity\Master\SaleType")
  253.          * @ORM\JoinColumns({
  254.          *   @ORM\JoinColumn(name="sale_type_id", referencedColumnName="id")
  255.          * })
  256.          */
  257.         private $SaleType;
  258.         /**
  259.          * @var \Eccube\Entity\ClassCategory
  260.          *
  261.          * @ORM\ManyToOne(targetEntity="Eccube\Entity\ClassCategory")
  262.          * @ORM\JoinColumns({
  263.          *   @ORM\JoinColumn(name="class_category_id1", referencedColumnName="id", nullable=true)
  264.          * })
  265.          */
  266.         private $ClassCategory1;
  267.         /**
  268.          * @var \Eccube\Entity\ClassCategory
  269.          *
  270.          * @ORM\ManyToOne(targetEntity="Eccube\Entity\ClassCategory")
  271.          * @ORM\JoinColumns({
  272.          *   @ORM\JoinColumn(name="class_category_id2", referencedColumnName="id", nullable=true)
  273.          * })
  274.          */
  275.         private $ClassCategory2;
  276.         /**
  277.          * @var \Eccube\Entity\DeliveryDuration
  278.          *
  279.          * @ORM\ManyToOne(targetEntity="Eccube\Entity\DeliveryDuration")
  280.          * @ORM\JoinColumns({
  281.          *   @ORM\JoinColumn(name="delivery_duration_id", referencedColumnName="id")
  282.          * })
  283.          */
  284.         private $DeliveryDuration;
  285.         /**
  286.          * @var \Eccube\Entity\Member
  287.          *
  288.          * @ORM\ManyToOne(targetEntity="Eccube\Entity\Member")
  289.          * @ORM\JoinColumns({
  290.          *   @ORM\JoinColumn(name="creator_id", referencedColumnName="id")
  291.          * })
  292.          */
  293.         private $Creator;
  294.         public function __clone()
  295.         {
  296.             $this->id null;
  297.         }
  298.         /**
  299.          * Set id.
  300.          *
  301.          * @param string|null $id
  302.          *
  303.          * @return ProductClass
  304.          */
  305.         public function setId($id null)
  306.         {
  307.             $this->id $id;
  308.             return $this;
  309.         }
  310.         /**
  311.          * Get id.
  312.          *
  313.          * @return int
  314.          */
  315.         public function getId()
  316.         {
  317.             return $this->id;
  318.         }
  319.         /**
  320.          * Set code.
  321.          *
  322.          * @param string|null $code
  323.          *
  324.          * @return ProductClass
  325.          */
  326.         public function setCode($code null)
  327.         {
  328.             $this->code $code;
  329.             return $this;
  330.         }
  331.         /**
  332.          * Get code.
  333.          *
  334.          * @return string|null
  335.          */
  336.         public function getCode()
  337.         {
  338.             return $this->code;
  339.         }
  340.         /**
  341.          * Set stock.
  342.          *
  343.          * @param string|null $stock
  344.          *
  345.          * @return ProductClass
  346.          */
  347.         public function setStock($stock null)
  348.         {
  349.             $this->stock $stock;
  350.             return $this;
  351.         }
  352.         /**
  353.          * Get stock.
  354.          *
  355.          * @return string|null
  356.          */
  357.         public function getStock()
  358.         {
  359.             return $this->stock;
  360.         }
  361.         /**
  362.          * Set stockUnlimited.
  363.          *
  364.          * @param boolean $stockUnlimited
  365.          *
  366.          * @return ProductClass
  367.          */
  368.         public function setStockUnlimited($stockUnlimited)
  369.         {
  370.             $this->stock_unlimited $stockUnlimited;
  371.             return $this;
  372.         }
  373.         /**
  374.          * Get stockUnlimited.
  375.          *
  376.          * @return boolean
  377.          */
  378.         public function isStockUnlimited()
  379.         {
  380.             return $this->stock_unlimited;
  381.         }
  382.         /**
  383.          * Set saleLimit.
  384.          *
  385.          * @param string|null $saleLimit
  386.          *
  387.          * @return ProductClass
  388.          */
  389.         public function setSaleLimit($saleLimit null)
  390.         {
  391.             $this->sale_limit $saleLimit;
  392.             return $this;
  393.         }
  394.         /**
  395.          * Get saleLimit.
  396.          *
  397.          * @return string|null
  398.          */
  399.         public function getSaleLimit()
  400.         {
  401.             return $this->sale_limit;
  402.         }
  403.         /**
  404.          * Set price01.
  405.          *
  406.          * @param string|null $price01
  407.          *
  408.          * @return ProductClass
  409.          */
  410.         public function setPrice01($price01 null)
  411.         {
  412.             $this->price01 $price01;
  413.             return $this;
  414.         }
  415.         /**
  416.          * Get price01.
  417.          *
  418.          * @return string|null
  419.          */
  420.         public function getPrice01()
  421.         {
  422.             return $this->price01;
  423.         }
  424.         /**
  425.          * Set price02.
  426.          *
  427.          * @param string $price02
  428.          *
  429.          * @return ProductClass
  430.          */
  431.         public function setPrice02($price02)
  432.         {
  433.             $this->price02 $price02;
  434.             return $this;
  435.         }
  436.         /**
  437.          * Get price02.
  438.          *
  439.          * @return string
  440.          */
  441.         public function getPrice02()
  442.         {
  443.             return $this->price02;
  444.         }
  445.         /**
  446.          * Set deliveryFee.
  447.          *
  448.          * @param string|null $deliveryFee
  449.          *
  450.          * @return ProductClass
  451.          */
  452.         public function setDeliveryFee($deliveryFee null)
  453.         {
  454.             $this->delivery_fee $deliveryFee;
  455.             return $this;
  456.         }
  457.         /**
  458.          * Get deliveryFee.
  459.          *
  460.          * @return string|null
  461.          */
  462.         public function getDeliveryFee()
  463.         {
  464.             return $this->delivery_fee;
  465.         }
  466.         /**
  467.          * @return boolean
  468.          */
  469.         public function isVisible()
  470.         {
  471.             return $this->visible;
  472.         }
  473.         /**
  474.          * @param boolean $visible
  475.          *
  476.          * @return ProductClass
  477.          */
  478.         public function setVisible($visible)
  479.         {
  480.             $this->visible $visible;
  481.             return $this;
  482.         }
  483.         /**
  484.          * Set createDate.
  485.          *
  486.          * @param \DateTime $createDate
  487.          *
  488.          * @return ProductClass
  489.          */
  490.         public function setCreateDate($createDate)
  491.         {
  492.             $this->create_date $createDate;
  493.             return $this;
  494.         }
  495.         /**
  496.          * Get createDate.
  497.          *
  498.          * @return \DateTime
  499.          */
  500.         public function getCreateDate()
  501.         {
  502.             return $this->create_date;
  503.         }
  504.         /**
  505.          * Set updateDate.
  506.          *
  507.          * @param \DateTime $updateDate
  508.          *
  509.          * @return ProductClass
  510.          */
  511.         public function setUpdateDate($updateDate)
  512.         {
  513.             $this->update_date $updateDate;
  514.             return $this;
  515.         }
  516.         /**
  517.          * Get updateDate.
  518.          *
  519.          * @return \DateTime
  520.          */
  521.         public function getUpdateDate()
  522.         {
  523.             return $this->update_date;
  524.         }
  525.         /**
  526.          * Get currencyCode.
  527.          *
  528.          * @return string
  529.          */
  530.         public function getCurrencyCode()
  531.         {
  532.             return $this->currency_code;
  533.         }
  534.         /**
  535.          * Set currencyCode.
  536.          *
  537.          * @param string|null $currencyCode
  538.          *
  539.          * @return $this
  540.          */
  541.         public function setCurrencyCode($currencyCode null)
  542.         {
  543.             $this->currency_code $currencyCode;
  544.             return $this;
  545.         }
  546.         /**
  547.          * Set productStock.
  548.          *
  549.          * @param \Eccube\Entity\ProductStock|null $productStock
  550.          *
  551.          * @return ProductClass
  552.          */
  553.         public function setProductStock(ProductStock $productStock null)
  554.         {
  555.             $this->ProductStock $productStock;
  556.             return $this;
  557.         }
  558.         /**
  559.          * Get productStock.
  560.          *
  561.          * @return \Eccube\Entity\ProductStock|null
  562.          */
  563.         public function getProductStock()
  564.         {
  565.             return $this->ProductStock;
  566.         }
  567.         /**
  568.          * Set taxRule.
  569.          *
  570.          * @param \Eccube\Entity\TaxRule|null $taxRule
  571.          *
  572.          * @return ProductClass
  573.          */
  574.         public function setTaxRule(TaxRule $taxRule null)
  575.         {
  576.             $this->TaxRule $taxRule;
  577.             return $this;
  578.         }
  579.         /**
  580.          * Get taxRule.
  581.          *
  582.          * @return \Eccube\Entity\TaxRule|null
  583.          */
  584.         public function getTaxRule()
  585.         {
  586.             return $this->TaxRule;
  587.         }
  588.         /**
  589.          * Set product.
  590.          *
  591.          * @param \Eccube\Entity\Product|null $product
  592.          *
  593.          * @return ProductClass
  594.          */
  595.         public function setProduct(Product $product null)
  596.         {
  597.             $this->Product $product;
  598.             return $this;
  599.         }
  600.         /**
  601.          * Get product.
  602.          *
  603.          * @return \Eccube\Entity\Product|null
  604.          */
  605.         public function getProduct()
  606.         {
  607.             return $this->Product;
  608.         }
  609.         /**
  610.          * Set saleType.
  611.          *
  612.          * @param \Eccube\Entity\Master\SaleType|null $saleType
  613.          *
  614.          * @return ProductClass
  615.          */
  616.         public function setSaleType(Master\SaleType $saleType null)
  617.         {
  618.             $this->SaleType $saleType;
  619.             return $this;
  620.         }
  621.         /**
  622.          * Get saleType.
  623.          *
  624.          * @return \Eccube\Entity\Master\SaleType|null
  625.          */
  626.         public function getSaleType()
  627.         {
  628.             return $this->SaleType;
  629.         }
  630.         /**
  631.          * Set classCategory1.
  632.          *
  633.          * @param \Eccube\Entity\ClassCategory|null $classCategory1
  634.          *
  635.          * @return ProductClass
  636.          */
  637.         public function setClassCategory1(ClassCategory $classCategory1 null)
  638.         {
  639.             $this->ClassCategory1 $classCategory1;
  640.             return $this;
  641.         }
  642.         /**
  643.          * Get classCategory1.
  644.          *
  645.          * @return \Eccube\Entity\ClassCategory|null
  646.          */
  647.         public function getClassCategory1()
  648.         {
  649.             return $this->ClassCategory1;
  650.         }
  651.         /**
  652.          * Set classCategory2.
  653.          *
  654.          * @param \Eccube\Entity\ClassCategory|null $classCategory2
  655.          *
  656.          * @return ProductClass
  657.          */
  658.         public function setClassCategory2(ClassCategory $classCategory2 null)
  659.         {
  660.             $this->ClassCategory2 $classCategory2;
  661.             return $this;
  662.         }
  663.         /**
  664.          * Get classCategory2.
  665.          *
  666.          * @return \Eccube\Entity\ClassCategory|null
  667.          */
  668.         public function getClassCategory2()
  669.         {
  670.             return $this->ClassCategory2;
  671.         }
  672.         /**
  673.          * Set deliveryDuration.
  674.          *
  675.          * @param \Eccube\Entity\DeliveryDuration|null $deliveryDuration
  676.          *
  677.          * @return ProductClass
  678.          */
  679.         public function setDeliveryDuration(DeliveryDuration $deliveryDuration null)
  680.         {
  681.             $this->DeliveryDuration $deliveryDuration;
  682.             return $this;
  683.         }
  684.         /**
  685.          * Get deliveryDuration.
  686.          *
  687.          * @return \Eccube\Entity\DeliveryDuration|null
  688.          */
  689.         public function getDeliveryDuration()
  690.         {
  691.             return $this->DeliveryDuration;
  692.         }
  693.         /**
  694.          * Set creator.
  695.          *
  696.          * @param \Eccube\Entity\Member|null $creator
  697.          *
  698.          * @return ProductClass
  699.          */
  700.         public function setCreator(Member $creator null)
  701.         {
  702.             $this->Creator $creator;
  703.             return $this;
  704.         }
  705.         /**
  706.          * Get creator.
  707.          *
  708.          * @return \Eccube\Entity\Member|null
  709.          */
  710.         public function getCreator()
  711.         {
  712.             return $this->Creator;
  713.         }
  714.         /**
  715.          * Set pointRate
  716.          *
  717.          * @param string $pointRate
  718.          *
  719.          * @return ProductClass
  720.          */
  721.         public function setPointRate($pointRate)
  722.         {
  723.             $this->point_rate $pointRate;
  724.             return $this;
  725.         }
  726.         /**
  727.          * Get pointRate
  728.          *
  729.          * @return string
  730.          */
  731.         public function getPointRate()
  732.         {
  733.             return $this->point_rate;
  734.         }
  735.     }