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