app/Plugin/ProductOption42/Entity/OptionCategory.php line 25

Open in your IDE?
  1. <?php
  2. /*
  3.  * Plugin Name : ProductOption
  4.  *
  5.  * Copyright (C) BraTech Co., Ltd. All Rights Reserved.
  6.  * http://www.bratech.co.jp/
  7.  *
  8.  * For the full copyright and license information, please view the LICENSE
  9.  * file that was distributed with this source code.
  10.  */
  11. namespace Plugin\ProductOption42\Entity;
  12. use Doctrine\ORM\Mapping as ORM;
  13. /**
  14.  * OptionCategory
  15.  *
  16.  * @ORM\Table(name="plg_productoption_dtb_optioncategory")
  17.  * @ORM\InheritanceType("SINGLE_TABLE")
  18.  * @ORM\DiscriminatorColumn(name="discriminator_type", type="string", length=255)
  19.  * @ORM\HasLifecycleCallbacks()
  20.  * @ORM\Entity(repositoryClass="Plugin\ProductOption42\Repository\OptionCategoryRepository")
  21.  */
  22. class OptionCategory extends \Eccube\Entity\AbstractEntity
  23. {
  24.     const ON 1;
  25.     const OFF 0;
  26.     private $label;
  27.     public function setLabel($label)
  28.     {
  29.         $this->label $label;
  30.         return $this;
  31.     }
  32.     public function getLabel()
  33.     {
  34.         return $this->label;
  35.     }
  36.     /**
  37.      * @var int
  38.      *
  39.      * @ORM\Column(name="id", type="integer", options={"unsigned":true})
  40.      * @ORM\Id
  41.      * @ORM\GeneratedValue(strategy="IDENTITY")
  42.      */
  43.     private $id;
  44.     /**
  45.      * @var string
  46.      *
  47.      * @ORM\Column(name="name", type="string", length=255, nullable=true)
  48.      */
  49.     private $name;
  50.     /**
  51.      * @var string|null
  52.      *
  53.      * @ORM\Column(name="description", type="string", length=4000, nullable=true)
  54.      */
  55.     private $description;
  56.     /**
  57.      * @var boolean|null
  58.      *
  59.      * @ORM\Column(name="disable_flg", type="boolean", nullable=true)
  60.      */
  61.     private $disable_flg;
  62.     /**
  63.      * @var boolean|null
  64.      *
  65.      * @ORM\Column(name="init_flg", type="boolean", nullable=true)
  66.      */
  67.     private $init_flg;
  68.     /**
  69.      * @var boolean|null
  70.      *
  71.      * @ORM\Column(name="hidden_flg", type="boolean", nullable=true)
  72.      */
  73.     private $hidden_flg;
  74.     /**
  75.      * @var string|null
  76.      *
  77.      * @ORM\Column(name="value", type="decimal", precision=12, scale=2, nullable=true)
  78.      */
  79.     private $value;
  80.     /**
  81.      * @var int|null
  82.      *
  83.      * @ORM\Column(name="delivery_free_flg", type="smallint", nullable=true)
  84.      */
  85.     private $delivery_free_flg;
  86.     /**
  87.      * @var int|null
  88.      *
  89.      * @ORM\Column(name="multiple_flg", type="smallint", nullable=true)
  90.      */
  91.     private $multiple_flg;
  92.     /**
  93.      * @var string|null
  94.      *
  95.      * @ORM\Column(name="weight", type="decimal", precision=12, scale=2, nullable=true)
  96.      */
  97.     private $weight;
  98.     /**
  99.      * @var string|null
  100.      *
  101.      * @ORM\Column(name="size", type="decimal", precision=12, scale=2, nullable=true)
  102.      */
  103.     private $size;
  104.     /**
  105.      * @var int
  106.      *
  107.      * @ORM\Column(name="sort_no", type="integer")
  108.      */
  109.     private $sort_no;
  110.     /**
  111.      * @var \DateTime
  112.      *
  113.      * @ORM\Column(name="create_date", type="datetimetz")
  114.      */
  115.     private $create_date;
  116.     /**
  117.      * @var \DateTime
  118.      *
  119.      * @ORM\Column(name="update_date", type="datetimetz")
  120.      */
  121.     private $update_date;
  122.     /**
  123.      * @var \Plugin\ProductOption42\Entity\Option
  124.      *
  125.      * @ORM\ManyToOne(targetEntity="Plugin\ProductOption42\Entity\Option", inversedBy="OptionCategories")
  126.      * @ORM\JoinColumns({
  127.      *   @ORM\JoinColumn(name="option_id", referencedColumnName="id")
  128.      * })
  129.      */
  130.     private $Option;
  131.     /**
  132.      * @var \Doctrine\Common\Collections\Collection
  133.      *
  134.      * @ORM\OneToMany(targetEntity="Plugin\ProductOption42\Entity\OptionImage", mappedBy="OptionCategory", cascade={"remove"})
  135.      * @ORM\OrderBy({
  136.      *     "sort_no"="ASC"
  137.      * })
  138.      */
  139.     private $OptionImages;
  140.     /**
  141.      * @var \Eccube\Entity\Member
  142.      *
  143.      * @ORM\ManyToOne(targetEntity="Eccube\Entity\Member")
  144.      * @ORM\JoinColumns({
  145.      *   @ORM\JoinColumn(name="creator_id", referencedColumnName="id")
  146.      * })
  147.      */
  148.     private $Creator;
  149.     /**
  150.      * Constructor
  151.      */
  152.     public function __construct()
  153.     {
  154.         $this->OptionImages = new \Doctrine\Common\Collections\ArrayCollection();
  155.     }
  156.     public function __toString()
  157.     {
  158.         return $this->getName();
  159.     }
  160.     public function getId()
  161.     {
  162.         return $this->id;
  163.     }
  164.     public function setName($name)
  165.     {
  166.         $this->name $name;
  167.         return $this;
  168.     }
  169.     public function getName()
  170.     {
  171.         return $this->name;
  172.     }
  173.     public function setDescription($description)
  174.     {
  175.         $this->description $description;
  176.         return $this;
  177.     }
  178.     public function getDescription()
  179.     {
  180.         return $this->description;
  181.     }
  182.     public function setCreateDate($date)
  183.     {
  184.         $this->create_date $date;
  185.         return $this;
  186.     }
  187.     public function getCreateDate()
  188.     {
  189.         return $this->create_date;
  190.     }
  191.     public function setUpdateDate($date)
  192.     {
  193.         $this->update_date $date;
  194.         return $this;
  195.     }
  196.     public function getUpdateDate()
  197.     {
  198.         return $this->update_date;
  199.     }
  200.     public function setWeight($weight)
  201.     {
  202.         $this->weight $weight;
  203.         return $this;
  204.     }
  205.     public function getWeight()
  206.     {
  207.         return $this->weight;
  208.     }
  209.     public function setSize($size)
  210.     {
  211.         $this->size $size;
  212.         return $this;
  213.     }
  214.     public function getSize()
  215.     {
  216.         return $this->size;
  217.     }
  218.     public function setSortNo($sortNo)
  219.     {
  220.         $this->sort_no $sortNo;
  221.         return $this;
  222.     }
  223.     public function getSortNo()
  224.     {
  225.         return $this->sort_no;
  226.     }
  227.     public function setDisableFlg($flg)
  228.     {
  229.         $this->disable_flg $flg;
  230.         return $this;
  231.     }
  232.     public function getDisableFlg()
  233.     {
  234.         return $this->disable_flg;
  235.     }
  236.     public function setInitFlg($flg)
  237.     {
  238.         $this->init_flg $flg;
  239.         return $this;
  240.     }
  241.     public function getInitFlg()
  242.     {
  243.         return $this->init_flg;
  244.     }
  245.     public function setHiddenFlg($flg)
  246.     {
  247.         $this->hidden_flg $flg;
  248.         return $this;
  249.     }
  250.     public function getHiddenFlg()
  251.     {
  252.         return $this->hidden_flg;
  253.     }
  254.     public function setValue($value)
  255.     {
  256.         $this->value $value;
  257.         return $this;
  258.     }
  259.     public function getValue()
  260.     {
  261.         return $this->value;
  262.     }
  263.     public function setDeliveryFreeFlg($flg)
  264.     {
  265.         $this->delivery_free_flg $flg;
  266.         return $this;
  267.     }
  268.     public function getDeliveryFreeFlg()
  269.     {
  270.         return $this->delivery_free_flg;
  271.     }
  272.     public function setMultipleFlg($flg)
  273.     {
  274.         $this->multiple_flg $flg;
  275.         return $this;
  276.     }
  277.     public function getMultipleFlg()
  278.     {
  279.         return $this->multiple_flg;
  280.     }
  281.     public function setOption(\Plugin\ProductOption42\Entity\Option $Option)
  282.     {
  283.         $this->Option $Option;
  284.         return $this;
  285.     }
  286.     public function getOption()
  287.     {
  288.         return $this->Option;
  289.     }
  290.     public function setCreator(\Eccube\Entity\Member $creator)
  291.     {
  292.         $this->Creator $creator;
  293.         return $this;
  294.     }
  295.     public function addOptionImage(\Plugin\ProductOption42\Entity\OptionImage $optionImage)
  296.     {
  297.         $this->OptionImages[] = $optionImage;
  298.         return $this;
  299.     }
  300.     public function removeOptionImage(\Plugin\ProductOption42\Entity\OptionImage $optionImage)
  301.     {
  302.         return $this->OptionImages->removeElement($optionImage);
  303.     }
  304.     public function getOptionImages()
  305.     {
  306.         return $this->OptionImages;
  307.     }
  308.     public function getCreator()
  309.     {
  310.         return $this->Creator;
  311.     }
  312. }