src/Eccube/Entity/ProductStock.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. if (!class_exists('\Eccube\Entity\ProductStock')) {
  15.     /**
  16.      * ProductStock
  17.      *
  18.      * @ORM\Table(name="dtb_product_stock")
  19.      * @ORM\InheritanceType("SINGLE_TABLE")
  20.      * @ORM\DiscriminatorColumn(name="discriminator_type", type="string", length=255)
  21.      * @ORM\HasLifecycleCallbacks()
  22.      * @ORM\Entity(repositoryClass="Eccube\Repository\ProductStockRepository")
  23.      */
  24.     class ProductStock extends \Eccube\Entity\AbstractEntity
  25.     {
  26.         public const IN_STOCK 1;
  27.         public const OUT_OF_STOCK 2;
  28.         /**
  29.          * @var integer
  30.          */
  31.         private $product_class_id;
  32.         /**
  33.          * Set product_class_id
  34.          *
  35.          * @param integer $productClassId
  36.          *
  37.          * @return ProductStock
  38.          */
  39.         public function setProductClassId($productClassId)
  40.         {
  41.             $this->product_class_id $productClassId;
  42.             return $this;
  43.         }
  44.         /**
  45.          * Get product_class_id
  46.          *
  47.          * @return integer
  48.          */
  49.         public function getProductClassId()
  50.         {
  51.             return $this->product_class_id;
  52.         }
  53.         /**
  54.          * @var integer
  55.          *
  56.          * @ORM\Column(name="id", type="integer", options={"unsigned":true})
  57.          * @ORM\Id
  58.          * @ORM\GeneratedValue(strategy="IDENTITY")
  59.          */
  60.         private $id;
  61.         /**
  62.          * @var string|null
  63.          *
  64.          * @ORM\Column(name="stock", type="decimal", precision=10, scale=0, nullable=true)
  65.          */
  66.         private $stock;
  67.         /**
  68.          * @var \DateTime
  69.          *
  70.          * @ORM\Column(name="create_date", type="datetimetz")
  71.          */
  72.         private $create_date;
  73.         /**
  74.          * @var \DateTime
  75.          *
  76.          * @ORM\Column(name="update_date", type="datetimetz")
  77.          */
  78.         private $update_date;
  79.         /**
  80.          * @var \Eccube\Entity\ProductClass
  81.          *
  82.          * @ORM\OneToOne(targetEntity="Eccube\Entity\ProductClass", inversedBy="ProductStock")
  83.          * @ORM\JoinColumns({
  84.          *   @ORM\JoinColumn(name="product_class_id", referencedColumnName="id")
  85.          * })
  86.          */
  87.         private $ProductClass;
  88.         /**
  89.          * @var \Eccube\Entity\Member
  90.          *
  91.          * @ORM\ManyToOne(targetEntity="Eccube\Entity\Member")
  92.          * @ORM\JoinColumns({
  93.          *   @ORM\JoinColumn(name="creator_id", referencedColumnName="id")
  94.          * })
  95.          */
  96.         private $Creator;
  97.         /**
  98.          * Get id.
  99.          *
  100.          * @return int
  101.          */
  102.         public function getId()
  103.         {
  104.             return $this->id;
  105.         }
  106.         /**
  107.          * Set stock.
  108.          *
  109.          * @param string|null $stock
  110.          *
  111.          * @return ProductStock
  112.          */
  113.         public function setStock($stock null)
  114.         {
  115.             $this->stock $stock;
  116.             return $this;
  117.         }
  118.         /**
  119.          * Get stock.
  120.          *
  121.          * @return string|null
  122.          */
  123.         public function getStock()
  124.         {
  125.             return $this->stock;
  126.         }
  127.         /**
  128.          * Set createDate.
  129.          *
  130.          * @param \DateTime $createDate
  131.          *
  132.          * @return ProductStock
  133.          */
  134.         public function setCreateDate($createDate)
  135.         {
  136.             $this->create_date $createDate;
  137.             return $this;
  138.         }
  139.         /**
  140.          * Get createDate.
  141.          *
  142.          * @return \DateTime
  143.          */
  144.         public function getCreateDate()
  145.         {
  146.             return $this->create_date;
  147.         }
  148.         /**
  149.          * Set updateDate.
  150.          *
  151.          * @param \DateTime $updateDate
  152.          *
  153.          * @return ProductStock
  154.          */
  155.         public function setUpdateDate($updateDate)
  156.         {
  157.             $this->update_date $updateDate;
  158.             return $this;
  159.         }
  160.         /**
  161.          * Get updateDate.
  162.          *
  163.          * @return \DateTime
  164.          */
  165.         public function getUpdateDate()
  166.         {
  167.             return $this->update_date;
  168.         }
  169.         /**
  170.          * Set productClass.
  171.          *
  172.          * @param \Eccube\Entity\ProductClass|null $productClass
  173.          *
  174.          * @return ProductStock
  175.          */
  176.         public function setProductClass(ProductClass $productClass null)
  177.         {
  178.             $this->ProductClass $productClass;
  179.             return $this;
  180.         }
  181.         /**
  182.          * Get productClass.
  183.          *
  184.          * @return \Eccube\Entity\ProductClass|null
  185.          */
  186.         public function getProductClass()
  187.         {
  188.             return $this->ProductClass;
  189.         }
  190.         /**
  191.          * Set creator.
  192.          *
  193.          * @param \Eccube\Entity\Member|null $creator
  194.          *
  195.          * @return ProductStock
  196.          */
  197.         public function setCreator(Member $creator null)
  198.         {
  199.             $this->Creator $creator;
  200.             return $this;
  201.         }
  202.         /**
  203.          * Get creator.
  204.          *
  205.          * @return \Eccube\Entity\Member|null
  206.          */
  207.         public function getCreator()
  208.         {
  209.             return $this->Creator;
  210.         }
  211.     }
  212. }