app/proxy/entity/src/Eccube/Entity/Product.php line 29

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\Common\Collections\ArrayCollection;
  14. use Doctrine\ORM\Mapping as ORM;
  15.     /**
  16.      * Product
  17.      *
  18.      * @ORM\Table(name="dtb_product")
  19.      * @ORM\InheritanceType("SINGLE_TABLE")
  20.      * @ORM\DiscriminatorColumn(name="discriminator_type", type="string", length=255)
  21.      * @ORM\HasLifecycleCallbacks()
  22.      * @ORM\Entity(repositoryClass="Eccube\Repository\ProductRepository")
  23.      */
  24.     class Product extends \Eccube\Entity\AbstractEntity
  25.     {
  26.     use \Plugin\RelatedProduct42\Entity\ProductTrait\Plugin\ProductMetaSeoIngenuity42\Entity\PmsiProductTrait\Plugin\ProductSort42\Entity\ProductTrait\Plugin\ApgSelectBoxForAddingToCart42\Entity\ProductTrait\Plugin\ApgVideoInsert42\Entity\ProductTrait;
  27.         private $_calc false;
  28.         private $stockFinds = [];
  29.         private $stocks = [];
  30.         private $stockUnlimiteds = [];
  31.         private $price01 = [];
  32.         private $price02 = [];
  33.         private $price01IncTaxs = [];
  34.         private $price02IncTaxs = [];
  35.         private $codes = [];
  36.         private $classCategories1 = [];
  37.         private $classCategories2 = [];
  38.         private $className1;
  39.         private $className2;
  40.         
  41.         
  42.         // 既存のプロパティとメソッド...
  43.         /**
  44.          * @var int|null
  45.          *
  46.          * @ORM\Column(name="plg_sort_no", type="integer", nullable=true)
  47.          */
  48.         private $plg_sort_no;
  49.         /**
  50.          * Get plg_sort_no.
  51.          *
  52.          * @return int|null
  53.          */
  54.         public function getPlgSortNo(): ?int
  55.         {
  56.             return $this->plg_sort_no;
  57.         }
  58.         /**
  59.          * Set plg_sort_no.
  60.          *
  61.          * @param int|null $plg_sort_no
  62.          *
  63.          * @return Product
  64.          */
  65.         public function setPlgSortNo(?int $plg_sort_no): self
  66.         {
  67.             $this->plg_sort_no $plg_sort_no;
  68.             return $this;
  69.         }
  70.         // 既存のプロパティとメソッド...
  71.         
  72.         
  73.         /**
  74.          * @return string
  75.          */
  76.         public function __toString()
  77.         {
  78.             return (string) $this->getName();
  79.         }
  80.         public function _calc()
  81.         {
  82.             if (!$this->_calc) {
  83.                 $i 0;
  84.                 foreach ($this->getProductClasses() as $ProductClass) {
  85.                     /* @var $ProductClass \Eccube\Entity\ProductClass */
  86.                     // stock_find
  87.                     if ($ProductClass->isVisible() == false) {
  88.                         continue;
  89.                     }
  90.                     $ClassCategory1 $ProductClass->getClassCategory1();
  91.                     $ClassCategory2 $ProductClass->getClassCategory2();
  92.                     if ($ClassCategory1 && !$ClassCategory1->isVisible()) {
  93.                         continue;
  94.                     }
  95.                     if ($ClassCategory2 && !$ClassCategory2->isVisible()) {
  96.                         continue;
  97.                     }
  98.                     // stock_find
  99.                     $this->stockFinds[] = $ProductClass->getStockFind();
  100.                     // stock
  101.                     $this->stocks[] = $ProductClass->getStock();
  102.                     // stock_unlimited
  103.                     $this->stockUnlimiteds[] = $ProductClass->isStockUnlimited();
  104.                     // price01
  105.                     if (!is_null($ProductClass->getPrice01())) {
  106.                         $this->price01[] = $ProductClass->getPrice01();
  107.                         // price01IncTax
  108.                         $this->price01IncTaxs[] = $ProductClass->getPrice01IncTax();
  109.                     }
  110.                     // price02
  111.                     $this->price02[] = $ProductClass->getPrice02();
  112.                     // price02IncTax
  113.                     $this->price02IncTaxs[] = $ProductClass->getPrice02IncTax();
  114.                     // product_code
  115.                     $this->codes[] = $ProductClass->getCode();
  116.                     if ($i === 0) {
  117.                         if ($ProductClass->getClassCategory1() && $ProductClass->getClassCategory1()->getId()) {
  118.                             $this->className1 $ProductClass->getClassCategory1()->getClassName()->getName();
  119.                         }
  120.                         if ($ProductClass->getClassCategory2() && $ProductClass->getClassCategory2()->getId()) {
  121.                             $this->className2 $ProductClass->getClassCategory2()->getClassName()->getName();
  122.                         }
  123.                     }
  124.                     if ($ProductClass->getClassCategory1()) {
  125.                         $classCategoryId1 $ProductClass->getClassCategory1()->getId();
  126.                         if (!empty($classCategoryId1)) {
  127.                             if ($ProductClass->getClassCategory2()) {
  128.                                 $this->classCategories1[$ProductClass->getClassCategory1()->getId()] = $ProductClass->getClassCategory1()->getName();
  129.                                 $this->classCategories2[$ProductClass->getClassCategory1()->getId()][$ProductClass->getClassCategory2()->getId()] = $ProductClass->getClassCategory2()->getName();
  130.                             } else {
  131.                                 $this->classCategories1[$ProductClass->getClassCategory1()->getId()] = $ProductClass->getClassCategory1()->getName().($ProductClass->getStockFind() ? '' trans('front.product.out_of_stock_label'));
  132.                             }
  133.                         }
  134.                     }
  135.                     $i++;
  136.                 }
  137.                 $this->_calc true;
  138.             }
  139.         }
  140.         /**
  141.          * Is Enable
  142.          *
  143.          * @return bool
  144.          *
  145.          * @deprecated
  146.          */
  147.         public function isEnable()
  148.         {
  149.             return $this->getStatus()->getId() === \Eccube\Entity\Master\ProductStatus::DISPLAY_SHOW true false;
  150.         }
  151.         /**
  152.          * Get ClassName1
  153.          *
  154.          * @return string
  155.          */
  156.         public function getClassName1()
  157.         {
  158.             $this->_calc();
  159.             return $this->className1;
  160.         }
  161.         /**
  162.          * Get ClassName2
  163.          *
  164.          * @return string
  165.          */
  166.         public function getClassName2()
  167.         {
  168.             $this->_calc();
  169.             return $this->className2;
  170.         }
  171.         /**
  172.          * Get getClassCategories1
  173.          *
  174.          * @return array
  175.          */
  176.         public function getClassCategories1()
  177.         {
  178.             $this->_calc();
  179.             return $this->classCategories1;
  180.         }
  181.         public function getClassCategories1AsFlip()
  182.         {
  183.             return array_flip($this->getClassCategories1());
  184.         }
  185.         /**
  186.          * Get getClassCategories2
  187.          *
  188.          * @return array
  189.          */
  190.         public function getClassCategories2($class_category1)
  191.         {
  192.             $this->_calc();
  193.             return isset($this->classCategories2[$class_category1]) ? $this->classCategories2[$class_category1] : [];
  194.         }
  195.         public function getClassCategories2AsFlip($class_category1)
  196.         {
  197.             return array_flip($this->getClassCategories2($class_category1));
  198.         }
  199.         /**
  200.          * Get StockFind
  201.          *
  202.          * @return bool
  203.          */
  204.         public function getStockFind()
  205.         {
  206.             $this->_calc();
  207.             return count($this->stockFinds)
  208.                 ? max($this->stockFinds)
  209.                 : null;
  210.         }
  211.         /**
  212.          * Get Stock min
  213.          *
  214.          * @return integer
  215.          */
  216.         public function getStockMin()
  217.         {
  218.             $this->_calc();
  219.             return count($this->stocks)
  220.                 ? min($this->stocks)
  221.                 : null;
  222.         }
  223.         /**
  224.          * Get Stock max
  225.          *
  226.          * @return integer
  227.          */
  228.         public function getStockMax()
  229.         {
  230.             $this->_calc();
  231.             return count($this->stocks)
  232.                 ? max($this->stocks)
  233.                 : null;
  234.         }
  235.         /**
  236.          * Get StockUnlimited min
  237.          *
  238.          * @return integer
  239.          */
  240.         public function getStockUnlimitedMin()
  241.         {
  242.             $this->_calc();
  243.             return count($this->stockUnlimiteds)
  244.                 ? min($this->stockUnlimiteds)
  245.                 : null;
  246.         }
  247.         /**
  248.          * Get StockUnlimited max
  249.          *
  250.          * @return integer
  251.          */
  252.         public function getStockUnlimitedMax()
  253.         {
  254.             $this->_calc();
  255.             return count($this->stockUnlimiteds)
  256.                 ? max($this->stockUnlimiteds)
  257.                 : null;
  258.         }
  259.         /**
  260.          * Get Price01 min
  261.          *
  262.          * @return integer
  263.          */
  264.         public function getPrice01Min()
  265.         {
  266.             $this->_calc();
  267.             if (count($this->price01) == 0) {
  268.                 return null;
  269.             }
  270.             return min($this->price01);
  271.         }
  272.         /**
  273.          * Get Price01 max
  274.          *
  275.          * @return integer
  276.          */
  277.         public function getPrice01Max()
  278.         {
  279.             $this->_calc();
  280.             if (count($this->price01) == 0) {
  281.                 return null;
  282.             }
  283.             return max($this->price01);
  284.         }
  285.         /**
  286.          * Get Price02 min
  287.          *
  288.          * @return integer
  289.          */
  290.         public function getPrice02Min()
  291.         {
  292.             $this->_calc();
  293.             return count($this->price02)
  294.                 ? min($this->price02)
  295.                 : null;
  296.         }
  297.         /**
  298.          * Get Price02 max
  299.          *
  300.          * @return integer
  301.          */
  302.         public function getPrice02Max()
  303.         {
  304.             $this->_calc();
  305.             return count($this->price02)
  306.                 ? max($this->price02)
  307.                 : null;
  308.         }
  309.         /**
  310.          * Get Price01IncTax min
  311.          *
  312.          * @return integer
  313.          */
  314.         public function getPrice01IncTaxMin()
  315.         {
  316.             $this->_calc();
  317.             return count($this->price01IncTaxs)
  318.                 ? min($this->price01IncTaxs)
  319.                 : null;
  320.         }
  321.         /**
  322.          * Get Price01IncTax max
  323.          *
  324.          * @return integer
  325.          */
  326.         public function getPrice01IncTaxMax()
  327.         {
  328.             $this->_calc();
  329.             return count($this->price01IncTaxs)
  330.                 ? max($this->price01IncTaxs)
  331.                 : null;
  332.         }
  333.         /**
  334.          * Get Price02IncTax min
  335.          *
  336.          * @return integer
  337.          */
  338.         public function getPrice02IncTaxMin()
  339.         {
  340.             $this->_calc();
  341.             return count($this->price02IncTaxs)
  342.                 ? min($this->price02IncTaxs)
  343.                 : null;
  344.         }
  345.         /**
  346.          * Get Price02IncTax max
  347.          *
  348.          * @return integer
  349.          */
  350.         public function getPrice02IncTaxMax()
  351.         {
  352.             $this->_calc();
  353.             return count($this->price02IncTaxs)
  354.                 ? max($this->price02IncTaxs)
  355.                 : null;
  356.         }
  357.         /**
  358.          * Get Product_code min
  359.          *
  360.          * @return integer
  361.          */
  362.         public function getCodeMin()
  363.         {
  364.             $this->_calc();
  365.             $codes = [];
  366.             foreach ($this->codes as $code) {
  367.                 if (!is_null($code)) {
  368.                     $codes[] = $code;
  369.                 }
  370.             }
  371.             return count($codes) ? min($codes) : null;
  372.         }
  373.         /**
  374.          * Get Product_code max
  375.          *
  376.          * @return integer
  377.          */
  378.         public function getCodeMax()
  379.         {
  380.             $this->_calc();
  381.             $codes = [];
  382.             foreach ($this->codes as $code) {
  383.                 if (!is_null($code)) {
  384.                     $codes[] = $code;
  385.                 }
  386.             }
  387.             return count($codes) ? max($codes) : null;
  388.         }
  389.         public function getMainListImage()
  390.         {
  391.             $ProductImages $this->getProductImage();
  392.             return $ProductImages->isEmpty() ? null $ProductImages[0];
  393.         }
  394.         public function getMainFileName()
  395.         {
  396.             if (count($this->ProductImage) > 0) {
  397.                 return $this->ProductImage[0];
  398.             } else {
  399.                 return null;
  400.             }
  401.         }
  402.         public function hasProductClass()
  403.         {
  404.             foreach ($this->ProductClasses as $ProductClass) {
  405.                 if (!$ProductClass->isVisible()) {
  406.                     continue;
  407.                 }
  408.                 if (!is_null($ProductClass->getClassCategory1())) {
  409.                     return true;
  410.                 }
  411.             }
  412.             return false;
  413.         }
  414.         /**
  415.          * @var integer
  416.          *
  417.          * @ORM\Column(name="id", type="integer", options={"unsigned":true})
  418.          * @ORM\Id
  419.          * @ORM\GeneratedValue(strategy="IDENTITY")
  420.          */
  421.         private $id;
  422.         /**
  423.          * @var string
  424.          *
  425.          * @ORM\Column(name="name", type="string", length=255)
  426.          */
  427.         private $name;
  428.         /**
  429.          * @var string|null
  430.          *
  431.          * @ORM\Column(name="note", type="text", nullable=true)
  432.          */
  433.         private $note;
  434.         /**
  435.          * @var string|null
  436.          *
  437.          * @ORM\Column(name="description_list", type="text", nullable=true)
  438.          */
  439.         private $description_list;
  440.         /**
  441.          * @var string|null
  442.          *
  443.          * @ORM\Column(name="description_detail", type="text", nullable=true)
  444.          */
  445.         private $description_detail;
  446.         /**
  447.          * @var string|null
  448.          *
  449.          * @ORM\Column(name="search_word", type="text", nullable=true)
  450.          */
  451.         private $search_word;
  452.         /**
  453.          * @var string|null
  454.          *
  455.          * @ORM\Column(name="free_area", type="text", nullable=true)
  456.          */
  457.         private $free_area;
  458.         /**
  459.          * @var \DateTime
  460.          *
  461.          * @ORM\Column(name="create_date", type="datetimetz")
  462.          */
  463.         private $create_date;
  464.         /**
  465.          * @var \DateTime
  466.          *
  467.          * @ORM\Column(name="update_date", type="datetimetz")
  468.          */
  469.         private $update_date;
  470.         /**
  471.          * @var \Doctrine\Common\Collections\Collection
  472.          *
  473.          * @ORM\OneToMany(targetEntity="Eccube\Entity\ProductCategory", mappedBy="Product", cascade={"persist","remove"})
  474.          */
  475.         private $ProductCategories;
  476.         /**
  477.          * @var \Doctrine\Common\Collections\Collection
  478.          *
  479.          * @ORM\OneToMany(targetEntity="Eccube\Entity\ProductClass", mappedBy="Product", cascade={"persist","remove"})
  480.          */
  481.         private $ProductClasses;
  482.         /**
  483.          * @var \Doctrine\Common\Collections\Collection
  484.          *
  485.          * @ORM\OneToMany(targetEntity="Eccube\Entity\ProductImage", mappedBy="Product", cascade={"remove"})
  486.          * @ORM\OrderBy({
  487.          *     "sort_no"="ASC"
  488.          * })
  489.          */
  490.         private $ProductImage;
  491.         /**
  492.          * @var \Doctrine\Common\Collections\Collection
  493.          *
  494.          * @ORM\OneToMany(targetEntity="Eccube\Entity\ProductTag", mappedBy="Product", cascade={"remove"})
  495.          */
  496.         private $ProductTag;
  497.         /**
  498.          * @var \Doctrine\Common\Collections\Collection
  499.          *
  500.          * @ORM\OneToMany(targetEntity="Eccube\Entity\CustomerFavoriteProduct", mappedBy="Product")
  501.          */
  502.         private $CustomerFavoriteProducts;
  503.         /**
  504.          * @var \Eccube\Entity\Member
  505.          *
  506.          * @ORM\ManyToOne(targetEntity="Eccube\Entity\Member")
  507.          * @ORM\JoinColumns({
  508.          *   @ORM\JoinColumn(name="creator_id", referencedColumnName="id")
  509.          * })
  510.          */
  511.         private $Creator;
  512.         /**
  513.          * @var \Eccube\Entity\Master\ProductStatus
  514.          *
  515.          * @ORM\ManyToOne(targetEntity="Eccube\Entity\Master\ProductStatus")
  516.          * @ORM\JoinColumns({
  517.          *   @ORM\JoinColumn(name="product_status_id", referencedColumnName="id")
  518.          * })
  519.          */
  520.         private $Status;
  521.         /**
  522.          * Constructor
  523.          */
  524.         public function __construct()
  525.         {
  526.             $this->ProductCategories = new \Doctrine\Common\Collections\ArrayCollection();
  527.             $this->ProductClasses = new \Doctrine\Common\Collections\ArrayCollection();
  528.             $this->ProductImage = new \Doctrine\Common\Collections\ArrayCollection();
  529.             $this->ProductTag = new \Doctrine\Common\Collections\ArrayCollection();
  530.             $this->CustomerFavoriteProducts = new \Doctrine\Common\Collections\ArrayCollection();
  531.         }
  532.         public function __clone()
  533.         {
  534.             $this->id null;
  535.         }
  536.         public function copy()
  537.         {
  538.             // コピー対象外
  539.             $this->CustomerFavoriteProducts = new ArrayCollection();
  540.             $Categories $this->getProductCategories();
  541.             $this->ProductCategories = new ArrayCollection();
  542.             foreach ($Categories as $Category) {
  543.                 $CopyCategory = clone $Category;
  544.                 $this->addProductCategory($CopyCategory);
  545.                 $CopyCategory->setProduct($this);
  546.             }
  547.             $Classes $this->getProductClasses();
  548.             $this->ProductClasses = new ArrayCollection();
  549.             foreach ($Classes as $Class) {
  550.                 $CopyClass = clone $Class;
  551.                 $this->addProductClass($CopyClass);
  552.                 $CopyClass->setProduct($this);
  553.             }
  554.             $Images $this->getProductImage();
  555.             $this->ProductImage = new ArrayCollection();
  556.             foreach ($Images as $Image) {
  557.                 $CloneImage = clone $Image;
  558.                 $this->addProductImage($CloneImage);
  559.                 $CloneImage->setProduct($this);
  560.             }
  561.             $Tags $this->getProductTag();
  562.             $this->ProductTag = new ArrayCollection();
  563.             foreach ($Tags as $Tag) {
  564.                 $CloneTag = clone $Tag;
  565.                 $this->addProductTag($CloneTag);
  566.                 $CloneTag->setProduct($this);
  567.             }
  568.             return $this;
  569.         }
  570.         /**
  571.          * Get id.
  572.          *
  573.          * @return int
  574.          */
  575.         public function getId()
  576.         {
  577.             return $this->id;
  578.         }
  579.         /**
  580.          * Set name.
  581.          *
  582.          * @param string $name
  583.          *
  584.          * @return Product
  585.          */
  586.         public function setName($name)
  587.         {
  588.             $this->name $name;
  589.             return $this;
  590.         }
  591.         /**
  592.          * Get name.
  593.          *
  594.          * @return string
  595.          */
  596.         public function getName()
  597.         {
  598.             return $this->name;
  599.         }
  600.         /**
  601.          * Set note.
  602.          *
  603.          * @param string|null $note
  604.          *
  605.          * @return Product
  606.          */
  607.         public function setNote($note null)
  608.         {
  609.             $this->note $note;
  610.             return $this;
  611.         }
  612.         /**
  613.          * Get note.
  614.          *
  615.          * @return string|null
  616.          */
  617.         public function getNote()
  618.         {
  619.             return $this->note;
  620.         }
  621.         /**
  622.          * Set descriptionList.
  623.          *
  624.          * @param string|null $descriptionList
  625.          *
  626.          * @return Product
  627.          */
  628.         public function setDescriptionList($descriptionList null)
  629.         {
  630.             $this->description_list $descriptionList;
  631.             return $this;
  632.         }
  633.         /**
  634.          * Get descriptionList.
  635.          *
  636.          * @return string|null
  637.          */
  638.         public function getDescriptionList()
  639.         {
  640.             return $this->description_list;
  641.         }
  642.         /**
  643.          * Set descriptionDetail.
  644.          *
  645.          * @param string|null $descriptionDetail
  646.          *
  647.          * @return Product
  648.          */
  649.         public function setDescriptionDetail($descriptionDetail null)
  650.         {
  651.             $this->description_detail $descriptionDetail;
  652.             return $this;
  653.         }
  654.         /**
  655.          * Get descriptionDetail.
  656.          *
  657.          * @return string|null
  658.          */
  659.         public function getDescriptionDetail()
  660.         {
  661.             return $this->description_detail;
  662.         }
  663.         /**
  664.          * Set searchWord.
  665.          *
  666.          * @param string|null $searchWord
  667.          *
  668.          * @return Product
  669.          */
  670.         public function setSearchWord($searchWord null)
  671.         {
  672.             $this->search_word $searchWord;
  673.             return $this;
  674.         }
  675.         /**
  676.          * Get searchWord.
  677.          *
  678.          * @return string|null
  679.          */
  680.         public function getSearchWord()
  681.         {
  682.             return $this->search_word;
  683.         }
  684.         /**
  685.          * Set freeArea.
  686.          *
  687.          * @param string|null $freeArea
  688.          *
  689.          * @return Product
  690.          */
  691.         public function setFreeArea($freeArea null)
  692.         {
  693.             $this->free_area $freeArea;
  694.             return $this;
  695.         }
  696.         /**
  697.          * Get freeArea.
  698.          *
  699.          * @return string|null
  700.          */
  701.         public function getFreeArea()
  702.         {
  703.             return $this->free_area;
  704.         }
  705.         /**
  706.          * Set createDate.
  707.          *
  708.          * @param \DateTime $createDate
  709.          *
  710.          * @return Product
  711.          */
  712.         public function setCreateDate($createDate)
  713.         {
  714.             $this->create_date $createDate;
  715.             return $this;
  716.         }
  717.         /**
  718.          * Get createDate.
  719.          *
  720.          * @return \DateTime
  721.          */
  722.         public function getCreateDate()
  723.         {
  724.             return $this->create_date;
  725.         }
  726.         /**
  727.          * Set updateDate.
  728.          *
  729.          * @param \DateTime $updateDate
  730.          *
  731.          * @return Product
  732.          */
  733.         public function setUpdateDate($updateDate)
  734.         {
  735.             $this->update_date $updateDate;
  736.             return $this;
  737.         }
  738.         /**
  739.          * Get updateDate.
  740.          *
  741.          * @return \DateTime
  742.          */
  743.         public function getUpdateDate()
  744.         {
  745.             return $this->update_date;
  746.         }
  747.         /**
  748.          * Add productCategory.
  749.          *
  750.          * @param \Eccube\Entity\ProductCategory $productCategory
  751.          *
  752.          * @return Product
  753.          */
  754.         public function addProductCategory(ProductCategory $productCategory)
  755.         {
  756.             $this->ProductCategories[] = $productCategory;
  757.             return $this;
  758.         }
  759.         /**
  760.          * Remove productCategory.
  761.          *
  762.          * @param \Eccube\Entity\ProductCategory $productCategory
  763.          *
  764.          * @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
  765.          */
  766.         public function removeProductCategory(ProductCategory $productCategory)
  767.         {
  768.             return $this->ProductCategories->removeElement($productCategory);
  769.         }
  770.         /**
  771.          * Get productCategories.
  772.          *
  773.          * @return \Doctrine\Common\Collections\Collection
  774.          */
  775.         public function getProductCategories()
  776.         {
  777.             return $this->ProductCategories;
  778.         }
  779.         /**
  780.          * Add productClass.
  781.          *
  782.          * @param \Eccube\Entity\ProductClass $productClass
  783.          *
  784.          * @return Product
  785.          */
  786.         public function addProductClass(ProductClass $productClass)
  787.         {
  788.             $this->ProductClasses[] = $productClass;
  789.             return $this;
  790.         }
  791.         /**
  792.          * Remove productClass.
  793.          *
  794.          * @param \Eccube\Entity\ProductClass $productClass
  795.          *
  796.          * @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
  797.          */
  798.         public function removeProductClass(ProductClass $productClass)
  799.         {
  800.             return $this->ProductClasses->removeElement($productClass);
  801.         }
  802.         /**
  803.          * Get productClasses.
  804.          *
  805.          * @return \Doctrine\Common\Collections\Collection
  806.          */
  807.         public function getProductClasses()
  808.         {
  809.             return $this->ProductClasses;
  810.         }
  811.         /**
  812.          * Add productImage.
  813.          *
  814.          * @param \Eccube\Entity\ProductImage $productImage
  815.          *
  816.          * @return Product
  817.          */
  818.         public function addProductImage(ProductImage $productImage)
  819.         {
  820.             $this->ProductImage[] = $productImage;
  821.             return $this;
  822.         }
  823.         /**
  824.          * Remove productImage.
  825.          *
  826.          * @param \Eccube\Entity\ProductImage $productImage
  827.          *
  828.          * @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
  829.          */
  830.         public function removeProductImage(ProductImage $productImage)
  831.         {
  832.             return $this->ProductImage->removeElement($productImage);
  833.         }
  834.         /**
  835.          * Get productImage.
  836.          *
  837.          * @return \Doctrine\Common\Collections\Collection
  838.          */
  839.         public function getProductImage()
  840.         {
  841.             return $this->ProductImage;
  842.         }
  843.         /**
  844.          * Add productTag.
  845.          *
  846.          * @param \Eccube\Entity\ProductTag $productTag
  847.          *
  848.          * @return Product
  849.          */
  850.         public function addProductTag(ProductTag $productTag)
  851.         {
  852.             $this->ProductTag[] = $productTag;
  853.             return $this;
  854.         }
  855.         /**
  856.          * Remove productTag.
  857.          *
  858.          * @param \Eccube\Entity\ProductTag $productTag
  859.          *
  860.          * @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
  861.          */
  862.         public function removeProductTag(ProductTag $productTag)
  863.         {
  864.             return $this->ProductTag->removeElement($productTag);
  865.         }
  866.         /**
  867.          * Get productTag.
  868.          *
  869.          * @return \Doctrine\Common\Collections\Collection
  870.          */
  871.         public function getProductTag()
  872.         {
  873.             return $this->ProductTag;
  874.         }
  875.         /**
  876.          * Get Tag
  877.          * フロント側タグsort_no順の配列を作成する
  878.          *
  879.          * @return []Tag
  880.          */
  881.         public function getTags()
  882.         {
  883.             $tags = [];
  884.             foreach ($this->getProductTag() as $productTag) {
  885.                 $tags[] = $productTag->getTag();
  886.             }
  887.             usort($tags, function (Tag $tag1Tag $tag2) {
  888.                 return $tag1->getSortNo() < $tag2->getSortNo();
  889.             });
  890.             return $tags;
  891.         }
  892.         /**
  893.          * Add customerFavoriteProduct.
  894.          *
  895.          * @param \Eccube\Entity\CustomerFavoriteProduct $customerFavoriteProduct
  896.          *
  897.          * @return Product
  898.          */
  899.         public function addCustomerFavoriteProduct(CustomerFavoriteProduct $customerFavoriteProduct)
  900.         {
  901.             $this->CustomerFavoriteProducts[] = $customerFavoriteProduct;
  902.             return $this;
  903.         }
  904.         /**
  905.          * Remove customerFavoriteProduct.
  906.          *
  907.          * @param \Eccube\Entity\CustomerFavoriteProduct $customerFavoriteProduct
  908.          *
  909.          * @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
  910.          */
  911.         public function removeCustomerFavoriteProduct(CustomerFavoriteProduct $customerFavoriteProduct)
  912.         {
  913.             return $this->CustomerFavoriteProducts->removeElement($customerFavoriteProduct);
  914.         }
  915.         /**
  916.          * Get customerFavoriteProducts.
  917.          *
  918.          * @return \Doctrine\Common\Collections\Collection
  919.          */
  920.         public function getCustomerFavoriteProducts()
  921.         {
  922.             return $this->CustomerFavoriteProducts;
  923.         }
  924.         /**
  925.          * Set creator.
  926.          *
  927.          * @param \Eccube\Entity\Member|null $creator
  928.          *
  929.          * @return Product
  930.          */
  931.         public function setCreator(Member $creator null)
  932.         {
  933.             $this->Creator $creator;
  934.             return $this;
  935.         }
  936.         /**
  937.          * Get creator.
  938.          *
  939.          * @return \Eccube\Entity\Member|null
  940.          */
  941.         public function getCreator()
  942.         {
  943.             return $this->Creator;
  944.         }
  945.         /**
  946.          * Set status.
  947.          *
  948.          * @param \Eccube\Entity\Master\ProductStatus|null $status
  949.          *
  950.          * @return Product
  951.          */
  952.         public function setStatus(Master\ProductStatus $status null)
  953.         {
  954.             $this->Status $status;
  955.             return $this;
  956.         }
  957.         /**
  958.          * Get status.
  959.          *
  960.          * @return \Eccube\Entity\Master\ProductStatus|null
  961.          */
  962.         public function getStatus()
  963.         {
  964.             return $this->Status;
  965.         }
  966.     }