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

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 Customize\Entity\ProductDetailImage;
  14. use Customize\Entity\ProductFaq;
  15. use Customize\Entity\ProductFeature;
  16. use Customize\Entity\ProductGallery;
  17. use Customize\Entity\ProductHashTag;
  18. use Customize\Entity\ProductMovie;
  19. use Customize\Entity\ProductNaireImage;
  20. use Customize\Entity\ProductRelateFeature;
  21. use Customize\Entity\ProductSpec;
  22. use Doctrine\Common\Collections\ArrayCollection;
  23. use Doctrine\ORM\Mapping as ORM;
  24.     /**
  25.      * Product
  26.      *
  27.      * @ORM\Table(name="dtb_product")
  28.      * @ORM\InheritanceType("SINGLE_TABLE")
  29.      * @ORM\DiscriminatorColumn(name="discriminator_type", type="string", length=255)
  30.      * @ORM\HasLifecycleCallbacks()
  31.      * @ORM\Entity(repositoryClass="Eccube\Repository\ProductRepository")
  32.      */
  33.     class Product extends \Eccube\Entity\AbstractEntity
  34.     {
  35.     use \Customize\Entity\ProductTrait\Plugin\Productset42\Entity\ProductTrait\Plugin\RelatedProduct42\Entity\ProductTrait\Plugin\EccubePaymentLite42\Entity\ProductTrait\Plugin\Seo42\Entity\ProductTrait;
  36.         private $_calc false;
  37.         private $stockFinds = [];
  38.         private $stocks = [];
  39.         private $stockUnlimiteds = [];
  40.         private $price01 = [];
  41.         private $price02 = [];
  42.         private $price01IncTaxs = [];
  43.         private $price02IncTaxs = [];
  44.         private $codes = [];
  45.         private $classCategories1 = [];
  46.         private $classCategories2 = [];
  47.         private $className1;
  48.         private $className2;
  49.         /**
  50.          * @return string
  51.          */
  52.         public function __toString()
  53.         {
  54.             return (string) $this->getName();
  55.         }
  56.         public function _calc()
  57.         {
  58.             if (!$this->_calc) {
  59.                 $i 0;
  60.                 foreach ($this->getProductClasses() as $ProductClass) {
  61.                     /* @var $ProductClass \Eccube\Entity\ProductClass */
  62.                     // stock_find
  63.                     if ($ProductClass->isVisible() == false) {
  64.                         continue;
  65.                     }
  66.                     $ClassCategory1 $ProductClass->getClassCategory1();
  67.                     $ClassCategory2 $ProductClass->getClassCategory2();
  68.                     if ($ClassCategory1 && !$ClassCategory1->isVisible()) {
  69.                         continue;
  70.                     }
  71.                     if ($ClassCategory2 && !$ClassCategory2->isVisible()) {
  72.                         continue;
  73.                     }
  74.                     // stock_find
  75.                     $this->stockFinds[] = $ProductClass->getStockFind();
  76.                     // stock
  77.                     $this->stocks[] = $ProductClass->getStock();
  78.                     // stock_unlimited
  79.                     $this->stockUnlimiteds[] = $ProductClass->isStockUnlimited();
  80.                     // price01
  81.                     if (!is_null($ProductClass->getPrice01())) {
  82.                         $this->price01[] = $ProductClass->getPrice01();
  83.                         // price01IncTax
  84.                         $this->price01IncTaxs[] = $ProductClass->getPrice01IncTax();
  85.                     }
  86.                     // price02
  87.                     $this->price02[] = $ProductClass->getPrice02();
  88.                     // price02IncTax
  89.                     $this->price02IncTaxs[] = $ProductClass->getPrice02IncTax();
  90.                     // product_code
  91.                     $this->codes[] = $ProductClass->getCode();
  92.                     if ($i === 0) {
  93.                         if ($ProductClass->getClassCategory1() && $ProductClass->getClassCategory1()->getId()) {
  94.                             $this->className1 $ProductClass->getClassCategory1()->getClassName()->getName();
  95.                         }
  96.                         if ($ProductClass->getClassCategory2() && $ProductClass->getClassCategory2()->getId()) {
  97.                             $this->className2 $ProductClass->getClassCategory2()->getClassName()->getName();
  98.                         }
  99.                     }
  100.                     if ($ProductClass->getClassCategory1()) {
  101.                         $classCategoryId1 $ProductClass->getClassCategory1()->getId();
  102.                         if (!empty($classCategoryId1)) {
  103.                             if ($ProductClass->getClassCategory2()) {
  104.                                 $this->classCategories1[$ProductClass->getClassCategory1()->getId()] = $ProductClass->getClassCategory1()->getName();
  105.                                 $this->classCategories2[$ProductClass->getClassCategory1()->getId()][$ProductClass->getClassCategory2()->getId()] = $ProductClass->getClassCategory2()->getName();
  106.                             } else {
  107.                                 $this->classCategories1[$ProductClass->getClassCategory1()->getId()] = $ProductClass->getClassCategory1()->getName().($ProductClass->getStockFind() ? '' trans('front.product.out_of_stock_label'));
  108.                             }
  109.                         }
  110.                     }
  111.                     $i++;
  112.                 }
  113.                 $this->_calc true;
  114.             }
  115.         }
  116.         /**
  117.          * @var integer 海洋散骨商品ID
  118.          */
  119.         public const PRODUCT_SEA_BURIAL_ID 3;
  120.         /**
  121.          * @var integer STGの海洋散骨商品ID
  122.          */
  123.         public const PRODUCT_SEA_BURIAL_ID_ON_STG 22;
  124.         public function isSeaBurial()
  125.         {
  126.             return $this->getId() === self::PRODUCT_SEA_BURIAL_ID;
  127.         }
  128.         /**
  129.          * Is Enable
  130.          *
  131.          * @return bool
  132.          *
  133.          * @deprecated
  134.          */
  135.         public function isEnable()
  136.         {
  137.             return $this->getStatus()->getId() === \Eccube\Entity\Master\ProductStatus::DISPLAY_SHOW true false;
  138.         }
  139.         /**
  140.          * Get ClassName1
  141.          *
  142.          * @return string
  143.          */
  144.         public function getClassName1()
  145.         {
  146.             $this->_calc();
  147.             return $this->className1;
  148.         }
  149.         /**
  150.          * Get ClassName2
  151.          *
  152.          * @return string
  153.          */
  154.         public function getClassName2()
  155.         {
  156.             $this->_calc();
  157.             return $this->className2;
  158.         }
  159.         /**
  160.          * Get getClassCategories1
  161.          *
  162.          * @return array
  163.          */
  164.         public function getClassCategories1()
  165.         {
  166.             $this->_calc();
  167.             return $this->classCategories1;
  168.         }
  169.         public function getClassCategories1AsFlip()
  170.         {
  171.             return array_flip($this->getClassCategories1());
  172.         }
  173.         /**
  174.          * Get getClassCategories2
  175.          *
  176.          * @return array
  177.          */
  178.         public function getClassCategories2($class_category1)
  179.         {
  180.             $this->_calc();
  181.             return isset($this->classCategories2[$class_category1]) ? $this->classCategories2[$class_category1] : [];
  182.         }
  183.         public function getClassCategories2AsFlip($class_category1)
  184.         {
  185.             return array_flip($this->getClassCategories2($class_category1));
  186.         }
  187.         /**
  188.          * Get StockFind
  189.          *
  190.          * @return bool
  191.          */
  192.         public function getStockFind()
  193.         {
  194.             $this->_calc();
  195.             return count($this->stockFinds)
  196.                 ? max($this->stockFinds)
  197.                 : null;
  198.         }
  199.         /**
  200.          * Get Stock min
  201.          *
  202.          * @return integer
  203.          */
  204.         public function getStockMin()
  205.         {
  206.             $this->_calc();
  207.             return count($this->stocks)
  208.                 ? min($this->stocks)
  209.                 : null;
  210.         }
  211.         /**
  212.          * Get Stock max
  213.          *
  214.          * @return integer
  215.          */
  216.         public function getStockMax()
  217.         {
  218.             $this->_calc();
  219.             return count($this->stocks)
  220.                 ? max($this->stocks)
  221.                 : null;
  222.         }
  223.         /**
  224.          * Get StockUnlimited min
  225.          *
  226.          * @return integer
  227.          */
  228.         public function getStockUnlimitedMin()
  229.         {
  230.             $this->_calc();
  231.             return count($this->stockUnlimiteds)
  232.                 ? min($this->stockUnlimiteds)
  233.                 : null;
  234.         }
  235.         /**
  236.          * Get StockUnlimited max
  237.          *
  238.          * @return integer
  239.          */
  240.         public function getStockUnlimitedMax()
  241.         {
  242.             $this->_calc();
  243.             return count($this->stockUnlimiteds)
  244.                 ? max($this->stockUnlimiteds)
  245.                 : null;
  246.         }
  247.         /**
  248.          * Get Price01 min
  249.          *
  250.          * @return integer
  251.          */
  252.         public function getPrice01Min()
  253.         {
  254.             $this->_calc();
  255.             if (count($this->price01) == 0) {
  256.                 return null;
  257.             }
  258.             return min($this->price01);
  259.         }
  260.         /**
  261.          * Get Price01 max
  262.          *
  263.          * @return integer
  264.          */
  265.         public function getPrice01Max()
  266.         {
  267.             $this->_calc();
  268.             if (count($this->price01) == 0) {
  269.                 return null;
  270.             }
  271.             return max($this->price01);
  272.         }
  273.         /**
  274.          * Get Price02 min
  275.          *
  276.          * @return integer
  277.          */
  278.         public function getPrice02Min()
  279.         {
  280.             $this->_calc();
  281.             return count($this->price02)
  282.                 ? min($this->price02)
  283.                 : null;
  284.         }
  285.         /**
  286.          * Get Price02 max
  287.          *
  288.          * @return integer
  289.          */
  290.         public function getPrice02Max()
  291.         {
  292.             $this->_calc();
  293.             return count($this->price02)
  294.                 ? max($this->price02)
  295.                 : null;
  296.         }
  297.         /**
  298.          * Get Price01IncTax min
  299.          *
  300.          * @return integer
  301.          */
  302.         public function getPrice01IncTaxMin()
  303.         {
  304.             $this->_calc();
  305.             return count($this->price01IncTaxs)
  306.                 ? min($this->price01IncTaxs)
  307.                 : null;
  308.         }
  309.         /**
  310.          * Get Price01IncTax max
  311.          *
  312.          * @return integer
  313.          */
  314.         public function getPrice01IncTaxMax()
  315.         {
  316.             $this->_calc();
  317.             return count($this->price01IncTaxs)
  318.                 ? max($this->price01IncTaxs)
  319.                 : null;
  320.         }
  321.         /**
  322.          * Get Price02IncTax min
  323.          *
  324.          * @return integer
  325.          */
  326.         public function getPrice02IncTaxMin()
  327.         {
  328.             $this->_calc();
  329.             return count($this->price02IncTaxs)
  330.                 ? min($this->price02IncTaxs)
  331.                 : null;
  332.         }
  333.         /**
  334.          * Get Price02IncTax max
  335.          *
  336.          * @return integer
  337.          */
  338.         public function getPrice02IncTaxMax()
  339.         {
  340.             $this->_calc();
  341.             return count($this->price02IncTaxs)
  342.                 ? max($this->price02IncTaxs)
  343.                 : null;
  344.         }
  345.         /**
  346.          * Get Product_code min
  347.          *
  348.          * @return integer
  349.          */
  350.         public function getCodeMin()
  351.         {
  352.             $this->_calc();
  353.             $codes = [];
  354.             foreach ($this->codes as $code) {
  355.                 if (!is_null($code)) {
  356.                     $codes[] = $code;
  357.                 }
  358.             }
  359.             return count($codes) ? min($codes) : null;
  360.         }
  361.         /**
  362.          * Get Product_code max
  363.          *
  364.          * @return integer
  365.          */
  366.         public function getCodeMax()
  367.         {
  368.             $this->_calc();
  369.             $codes = [];
  370.             foreach ($this->codes as $code) {
  371.                 if (!is_null($code)) {
  372.                     $codes[] = $code;
  373.                 }
  374.             }
  375.             return count($codes) ? max($codes) : null;
  376.         }
  377.         public function getMainListImage()
  378.         {
  379.             $ProductImages $this->getProductImage();
  380.             return $ProductImages->isEmpty() ? null $ProductImages[0];
  381.         }
  382.         public function getMainFileName()
  383.         {
  384.             if (count($this->ProductImage) > 0) {
  385.                 return $this->ProductImage[0];
  386.             } else {
  387.                 return null;
  388.             }
  389.         }
  390.         public function hasProductClass()
  391.         {
  392.             foreach ($this->ProductClasses as $ProductClass) {
  393.                 if (!$ProductClass->isVisible()) {
  394.                     continue;
  395.                 }
  396.                 if (!is_null($ProductClass->getClassCategory1())) {
  397.                     return true;
  398.                 }
  399.             }
  400.             return false;
  401.         }
  402.         /**
  403.          * @var integer
  404.          *
  405.          * @ORM\Column(name="id", type="integer", options={"unsigned":true})
  406.          * @ORM\Id
  407.          * @ORM\GeneratedValue(strategy="IDENTITY")
  408.          */
  409.         private $id;
  410.         /**
  411.          * @var string
  412.          *
  413.          * @ORM\Column(name="name", type="string", length=255)
  414.          */
  415.         private $name;
  416.         /**
  417.          * @var string|null
  418.          *
  419.          * @ORM\Column(name="note", type="text", nullable=true)
  420.          */
  421.         private $note;
  422.         /**
  423.          * @var string|null
  424.          *
  425.          * @ORM\Column(name="description_list", type="text", nullable=true)
  426.          */
  427.         private $description_list;
  428.         /**
  429.          * @var string|null
  430.          *
  431.          * @ORM\Column(name="description_detail", type="text", nullable=true)
  432.          */
  433.         private $description_detail;
  434.         /**
  435.          * @var string|null
  436.          *
  437.          * @ORM\Column(name="search_word", type="text", nullable=true)
  438.          */
  439.         private $search_word;
  440.         /**
  441.          * @var string|null
  442.          *
  443.          * @ORM\Column(name="free_area", type="text", nullable=true)
  444.          */
  445.         private $free_area;
  446.         /**
  447.          * @var \DateTime
  448.          *
  449.          * @ORM\Column(name="create_date", type="datetimetz")
  450.          */
  451.         private $create_date;
  452.         /**
  453.          * @var \DateTime
  454.          *
  455.          * @ORM\Column(name="update_date", type="datetimetz")
  456.          */
  457.         private $update_date;
  458.         /**
  459.          * @var \Doctrine\Common\Collections\Collection
  460.          *
  461.          * @ORM\OneToMany(targetEntity="Eccube\Entity\ProductCategory", mappedBy="Product", cascade={"persist","remove"})
  462.          */
  463.         private $ProductCategories;
  464.         /**
  465.          * @var \Doctrine\Common\Collections\Collection
  466.          *
  467.          * @ORM\OneToMany(targetEntity="Eccube\Entity\ProductClass", mappedBy="Product", cascade={"persist","remove"})
  468.          */
  469.         private $ProductClasses;
  470.         /**
  471.          * @var \Doctrine\Common\Collections\Collection
  472.          *
  473.          * @ORM\OneToMany(targetEntity="Eccube\Entity\ProductImage", mappedBy="Product", cascade={"remove"})
  474.          * @ORM\OrderBy({
  475.          *     "sort_no"="ASC"
  476.          * })
  477.          */
  478.         private $ProductImage;
  479.         /**
  480.          * @var \Doctrine\Common\Collections\Collection
  481.          *
  482.          * @ORM\OneToMany(targetEntity="Eccube\Entity\ProductTag", mappedBy="Product", cascade={"remove"})
  483.          */
  484.         private $ProductTag;
  485.         /**
  486.          * @var \Doctrine\Common\Collections\Collection
  487.          *
  488.          * @ORM\OneToMany(targetEntity="Eccube\Entity\CustomerFavoriteProduct", mappedBy="Product")
  489.          */
  490.         private $CustomerFavoriteProducts;
  491.         /**
  492.          * @var \Doctrine\Common\Collections\Collection
  493.          *
  494.          * @ORM\OneToMany(targetEntity="Customize\Entity\ProductFeature", mappedBy="Product", cascade={"persist","remove"})
  495.          */
  496.         private $ProductFeatures;
  497.         /**
  498.          * @var \Doctrine\Common\Collections\Collection
  499.          *
  500.          * @ORM\OneToMany(targetEntity="Customize\Entity\ProductFaq", mappedBy="Product", cascade={"persist","remove"})
  501.          */
  502.         private $ProductFaqs;
  503.         /**
  504.          * @var \Doctrine\Common\Collections\Collection
  505.          *
  506.          * @ORM\OneToMany(targetEntity="Customize\Entity\ProductRelateFeature", mappedBy="Product", cascade={"persist","remove"})
  507.          */
  508.         private $ProductRelateFeatures;
  509.         /**
  510.          * @var \Doctrine\Common\Collections\Collection
  511.          *
  512.          * @ORM\OneToMany(targetEntity="Customize\Entity\ProductMovie", mappedBy="Product", cascade={"persist","remove"})
  513.          */
  514.         private $ProductMovies;
  515.         /**
  516.          * @var \Doctrine\Common\Collections\Collection
  517.          *
  518.          * @ORM\OneToMany(targetEntity="Customize\Entity\ProductGallery", mappedBy="Product", cascade={"persist","remove"})
  519.          * @ORM\OrderBy({
  520.          *     "sort_no"="ASC"
  521.          * })
  522.          */
  523.         private $ProductGalleries;
  524.         /**
  525.          * @var \Doctrine\Common\Collections\Collection
  526.          *
  527.          * @ORM\OneToMany(targetEntity="Customize\Entity\ProductSpec", mappedBy="Product", cascade={"persist","remove"})
  528.          */
  529.         private $ProductSpecs;
  530.         /**
  531.          * @var \Doctrine\Common\Collections\Collection
  532.          *
  533.          * @ORM\OneToMany(targetEntity="Customize\Entity\ProductDetailImage", mappedBy="Product", cascade={"persist","remove"})
  534.          * @ORM\OrderBy({
  535.          *    "sort_no"="ASC"
  536.          * })
  537.          */
  538.         private $ProductDetailImages;
  539.         /**
  540.          * @var \Doctrine\Common\Collections\Collection
  541.          *
  542.          * @ORM\OneToMany(targetEntity="Customize\Entity\ProductNaireImage", mappedBy="Product", cascade={"persist","remove"})
  543.          * @ORM\OrderBy({
  544.          *   "sort_no"="ASC"
  545.          * })
  546.          */
  547.         private $ProductNaireImages;
  548.         /**
  549.          * @var \Doctrine\Common\Collections\Collection
  550.          *
  551.          * @ORM\OneToMany(targetEntity="Customize\Entity\ProductHashTag", mappedBy="Product", cascade={"persist","remove"})
  552.          */
  553.         private $ProductHashTags;
  554.         /**
  555.          * @var \Eccube\Entity\Member
  556.          *
  557.          * @ORM\ManyToOne(targetEntity="Eccube\Entity\Member")
  558.          * @ORM\JoinColumns({
  559.          *   @ORM\JoinColumn(name="creator_id", referencedColumnName="id")
  560.          * })
  561.          */
  562.         private $Creator;
  563.         /**
  564.          * @var \Eccube\Entity\Master\ProductStatus
  565.          *
  566.          * @ORM\ManyToOne(targetEntity="Eccube\Entity\Master\ProductStatus")
  567.          * @ORM\JoinColumns({
  568.          *   @ORM\JoinColumn(name="product_status_id", referencedColumnName="id")
  569.          * })
  570.          */
  571.         private $Status;
  572.         /**
  573.          * Constructor
  574.          */
  575.         public function __construct()
  576.         {
  577.             $this->ProductCategories = new \Doctrine\Common\Collections\ArrayCollection();
  578.             $this->ProductClasses = new \Doctrine\Common\Collections\ArrayCollection();
  579.             $this->ProductImage = new \Doctrine\Common\Collections\ArrayCollection();
  580.             $this->ProductTag = new \Doctrine\Common\Collections\ArrayCollection();
  581.             $this->CustomerFavoriteProducts = new \Doctrine\Common\Collections\ArrayCollection();
  582.             $this->ProductFeatures = new \Doctrine\Common\Collections\ArrayCollection();
  583.             $this->ProductFaqs = new \Doctrine\Common\Collections\ArrayCollection();
  584.             $this->ProductRelateFeatures = new \Doctrine\Common\Collections\ArrayCollection();
  585.             $this->ProductMovies = new \Doctrine\Common\Collections\ArrayCollection();
  586.             $this->ProductGalleries = new \Doctrine\Common\Collections\ArrayCollection();
  587.             $this->ProductSpecs = new \Doctrine\Common\Collections\ArrayCollection();
  588.             $this->ProductHashTags = new \Doctrine\Common\Collections\ArrayCollection();
  589.             $this->ProductDetailImages = new \Doctrine\Common\Collections\ArrayCollection();
  590.             $this->ProductNaireImages = new \Doctrine\Common\Collections\ArrayCollection();
  591.         }
  592.         public function __clone()
  593.         {
  594.             $this->id null;
  595.         }
  596.         public function copy()
  597.         {
  598.             // コピー対象外
  599.             $this->CustomerFavoriteProducts = new ArrayCollection();
  600.             $Categories $this->getProductCategories();
  601.             $this->ProductCategories = new ArrayCollection();
  602.             foreach ($Categories as $Category) {
  603.                 $CopyCategory = clone $Category;
  604.                 $this->addProductCategory($CopyCategory);
  605.                 $CopyCategory->setProduct($this);
  606.             }
  607.             $Classes $this->getProductClasses();
  608.             $this->ProductClasses = new ArrayCollection();
  609.             foreach ($Classes as $Class) {
  610.                 $CopyClass = clone $Class;
  611.                 $this->addProductClass($CopyClass);
  612.                 $CopyClass->setProduct($this);
  613.             }
  614.             $Images $this->getProductImage();
  615.             $this->ProductImage = new ArrayCollection();
  616.             foreach ($Images as $Image) {
  617.                 $CloneImage = clone $Image;
  618.                 $this->addProductImage($CloneImage);
  619.                 $CloneImage->setProduct($this);
  620.             }
  621.             $Tags $this->getProductTag();
  622.             $this->ProductTag = new ArrayCollection();
  623.             foreach ($Tags as $Tag) {
  624.                 $CloneTag = clone $Tag;
  625.                 $this->addProductTag($CloneTag);
  626.                 $CloneTag->setProduct($this);
  627.             }
  628.             return $this;
  629.         }
  630.         /**
  631.          * Get id.
  632.          *
  633.          * @return int
  634.          */
  635.         public function getId()
  636.         {
  637.             return $this->id;
  638.         }
  639.         /**
  640.          * Set name.
  641.          *
  642.          * @param string $name
  643.          *
  644.          * @return Product
  645.          */
  646.         public function setName($name)
  647.         {
  648.             $this->name $name;
  649.             return $this;
  650.         }
  651.         /**
  652.          * Get name.
  653.          *
  654.          * @return string
  655.          */
  656.         public function getName()
  657.         {
  658.             return $this->name;
  659.         }
  660.         /**
  661.          * Set note.
  662.          *
  663.          * @param string|null $note
  664.          *
  665.          * @return Product
  666.          */
  667.         public function setNote($note null)
  668.         {
  669.             $this->note $note;
  670.             return $this;
  671.         }
  672.         /**
  673.          * Get note.
  674.          *
  675.          * @return string|null
  676.          */
  677.         public function getNote()
  678.         {
  679.             return $this->note;
  680.         }
  681.         /**
  682.          * Set descriptionList.
  683.          *
  684.          * @param string|null $descriptionList
  685.          *
  686.          * @return Product
  687.          */
  688.         public function setDescriptionList($descriptionList null)
  689.         {
  690.             $this->description_list $descriptionList;
  691.             return $this;
  692.         }
  693.         /**
  694.          * Get descriptionList.
  695.          *
  696.          * @return string|null
  697.          */
  698.         public function getDescriptionList()
  699.         {
  700.             return $this->description_list;
  701.         }
  702.         /**
  703.          * Set descriptionDetail.
  704.          *
  705.          * @param string|null $descriptionDetail
  706.          *
  707.          * @return Product
  708.          */
  709.         public function setDescriptionDetail($descriptionDetail null)
  710.         {
  711.             $this->description_detail $descriptionDetail;
  712.             return $this;
  713.         }
  714.         /**
  715.          * Get descriptionDetail.
  716.          *
  717.          * @return string|null
  718.          */
  719.         public function getDescriptionDetail()
  720.         {
  721.             return $this->description_detail;
  722.         }
  723.         /**
  724.          * Set searchWord.
  725.          *
  726.          * @param string|null $searchWord
  727.          *
  728.          * @return Product
  729.          */
  730.         public function setSearchWord($searchWord null)
  731.         {
  732.             $this->search_word $searchWord;
  733.             return $this;
  734.         }
  735.         /**
  736.          * Get searchWord.
  737.          *
  738.          * @return string|null
  739.          */
  740.         public function getSearchWord()
  741.         {
  742.             return $this->search_word;
  743.         }
  744.         /**
  745.          * Set freeArea.
  746.          *
  747.          * @param string|null $freeArea
  748.          *
  749.          * @return Product
  750.          */
  751.         public function setFreeArea($freeArea null)
  752.         {
  753.             $this->free_area $freeArea;
  754.             return $this;
  755.         }
  756.         /**
  757.          * Get freeArea.
  758.          *
  759.          * @return string|null
  760.          */
  761.         public function getFreeArea()
  762.         {
  763.             return $this->free_area;
  764.         }
  765.         /**
  766.          * Set createDate.
  767.          *
  768.          * @param \DateTime $createDate
  769.          *
  770.          * @return Product
  771.          */
  772.         public function setCreateDate($createDate)
  773.         {
  774.             $this->create_date $createDate;
  775.             return $this;
  776.         }
  777.         /**
  778.          * Get createDate.
  779.          *
  780.          * @return \DateTime
  781.          */
  782.         public function getCreateDate()
  783.         {
  784.             return $this->create_date;
  785.         }
  786.         /**
  787.          * Set updateDate.
  788.          *
  789.          * @param \DateTime $updateDate
  790.          *
  791.          * @return Product
  792.          */
  793.         public function setUpdateDate($updateDate)
  794.         {
  795.             $this->update_date $updateDate;
  796.             return $this;
  797.         }
  798.         /**
  799.          * Get updateDate.
  800.          *
  801.          * @return \DateTime
  802.          */
  803.         public function getUpdateDate()
  804.         {
  805.             return $this->update_date;
  806.         }
  807.         /**
  808.          * Add productCategory.
  809.          *
  810.          * @param \Eccube\Entity\ProductCategory $productCategory
  811.          *
  812.          * @return Product
  813.          */
  814.         public function addProductCategory(ProductCategory $productCategory)
  815.         {
  816.             $this->ProductCategories[] = $productCategory;
  817.             return $this;
  818.         }
  819.         /**
  820.          * Remove productCategory.
  821.          *
  822.          * @param \Eccube\Entity\ProductCategory $productCategory
  823.          *
  824.          * @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
  825.          */
  826.         public function removeProductCategory(ProductCategory $productCategory)
  827.         {
  828.             return $this->ProductCategories->removeElement($productCategory);
  829.         }
  830.         /**
  831.          * Get productCategories.
  832.          *
  833.          * @return \Doctrine\Common\Collections\Collection
  834.          */
  835.         public function getProductCategories()
  836.         {
  837.             return $this->ProductCategories;
  838.         }
  839.         /**
  840.          * Add productClass.
  841.          *
  842.          * @param \Eccube\Entity\ProductClass $productClass
  843.          *
  844.          * @return Product
  845.          */
  846.         public function addProductClass(ProductClass $productClass)
  847.         {
  848.             $this->ProductClasses[] = $productClass;
  849.             return $this;
  850.         }
  851.         /**
  852.          * Remove productClass.
  853.          *
  854.          * @param \Eccube\Entity\ProductClass $productClass
  855.          *
  856.          * @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
  857.          */
  858.         public function removeProductClass(ProductClass $productClass)
  859.         {
  860.             return $this->ProductClasses->removeElement($productClass);
  861.         }
  862.         /**
  863.          * Get productClasses.
  864.          *
  865.          * @return \Doctrine\Common\Collections\Collection
  866.          */
  867.         public function getProductClasses()
  868.         {
  869.             return $this->ProductClasses;
  870.         }
  871.         /**
  872.          * Add productImage.
  873.          *
  874.          * @param \Eccube\Entity\ProductImage $productImage
  875.          *
  876.          * @return Product
  877.          */
  878.         public function addProductImage(ProductImage $productImage)
  879.         {
  880.             $this->ProductImage[] = $productImage;
  881.             return $this;
  882.         }
  883.         /**
  884.          * Remove productImage.
  885.          *
  886.          * @param \Eccube\Entity\ProductImage $productImage
  887.          *
  888.          * @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
  889.          */
  890.         public function removeProductImage(ProductImage $productImage)
  891.         {
  892.             return $this->ProductImage->removeElement($productImage);
  893.         }
  894.         /**
  895.          * Get productImage.
  896.          *
  897.          * @return \Doctrine\Common\Collections\Collection
  898.          */
  899.         public function getProductImage()
  900.         {
  901.             return $this->ProductImage;
  902.         }
  903.         /**
  904.          * Add productTag.
  905.          *
  906.          * @param \Eccube\Entity\ProductTag $productTag
  907.          *
  908.          * @return Product
  909.          */
  910.         public function addProductTag(ProductTag $productTag)
  911.         {
  912.             $this->ProductTag[] = $productTag;
  913.             return $this;
  914.         }
  915.         /**
  916.          * Remove productTag.
  917.          *
  918.          * @param \Eccube\Entity\ProductTag $productTag
  919.          *
  920.          * @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
  921.          */
  922.         public function removeProductTag(ProductTag $productTag)
  923.         {
  924.             return $this->ProductTag->removeElement($productTag);
  925.         }
  926.         /**
  927.          * Get productTag.
  928.          *
  929.          * @return \Doctrine\Common\Collections\Collection
  930.          */
  931.         public function getProductTag()
  932.         {
  933.             return $this->ProductTag;
  934.         }
  935.         /**
  936.          * Get Tag
  937.          * フロント側タグsort_no順の配列を作成する
  938.          *
  939.          * @return []Tag
  940.          */
  941.         public function getTags()
  942.         {
  943.             $tags = [];
  944.             foreach ($this->getProductTag() as $productTag) {
  945.                 $tags[] = $productTag->getTag();
  946.             }
  947.             usort($tags, function (Tag $tag1Tag $tag2) {
  948.                 return $tag1->getSortNo() < $tag2->getSortNo();
  949.             });
  950.             return $tags;
  951.         }
  952.         /**
  953.          * Add customerFavoriteProduct.
  954.          *
  955.          * @param \Eccube\Entity\CustomerFavoriteProduct $customerFavoriteProduct
  956.          *
  957.          * @return Product
  958.          */
  959.         public function addCustomerFavoriteProduct(CustomerFavoriteProduct $customerFavoriteProduct)
  960.         {
  961.             $this->CustomerFavoriteProducts[] = $customerFavoriteProduct;
  962.             return $this;
  963.         }
  964.         /**
  965.          * Remove customerFavoriteProduct.
  966.          *
  967.          * @param \Eccube\Entity\CustomerFavoriteProduct $customerFavoriteProduct
  968.          *
  969.          * @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
  970.          */
  971.         public function removeCustomerFavoriteProduct(CustomerFavoriteProduct $customerFavoriteProduct)
  972.         {
  973.             return $this->CustomerFavoriteProducts->removeElement($customerFavoriteProduct);
  974.         }
  975.         /**
  976.          * Get customerFavoriteProducts.
  977.          *
  978.          * @return \Doctrine\Common\Collections\Collection
  979.          */
  980.         public function getCustomerFavoriteProducts()
  981.         {
  982.             return $this->CustomerFavoriteProducts;
  983.         }
  984.         /**
  985.          * Add productFeature.
  986.          *
  987.          * @param \Customize\Entity\ProductFeature $productFeature
  988.          *
  989.          * @return Product
  990.          */
  991.         public function addProductFeature(ProductFeature $productFeature)
  992.         {
  993.             $this->ProductFeatures[] = $productFeature;
  994.             return $this;
  995.         }
  996.         /**
  997.          * Remove productFeature.
  998.          *
  999.          * @param \Customize\Entity\ProductFeature $productFeature
  1000.          *
  1001.          * @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
  1002.          */
  1003.         public function removeProductFeature(ProductFeature $productFeature)
  1004.         {
  1005.             return $this->ProductFeatures->removeElement($productFeature);
  1006.         }
  1007.         /**
  1008.          * Get productFeatures.
  1009.          *
  1010.          * @return \Doctrine\Common\Collections\Collection
  1011.          */
  1012.         public function getProductFeatures()
  1013.         {
  1014.             return $this->ProductFeatures;
  1015.         }
  1016.         /**
  1017.          * Add productFaq.
  1018.          *
  1019.          * @param \Customize\Entity\ProductFaq $productFaq
  1020.          *
  1021.          * @return Product
  1022.          */
  1023.         public function addProductFaq(ProductFaq $productFaq)
  1024.         {
  1025.             $this->ProductFaqs[] = $productFaq;
  1026.             return $this;
  1027.         }
  1028.         /**
  1029.          * Remove productFaqs.
  1030.          *
  1031.          * @param \Customize\Entity\ProductFaq $productFaq
  1032.          *
  1033.          * @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
  1034.          */
  1035.         public function removeProductFaq(ProductFaq $productFaq)
  1036.         {
  1037.             return $this->ProductFaqs->removeElement($productFaq);
  1038.         }
  1039.         /**
  1040.          * Get productFaqs.
  1041.          *
  1042.          * @return \Doctrine\Common\Collections\Collection
  1043.          */
  1044.         public function getProductFaqs()
  1045.         {
  1046.             return $this->ProductFaqs;
  1047.         }
  1048.         /**
  1049.          * Add productRelateFeature.
  1050.          *
  1051.          * @param \Customize\Entity\ProductRelateFeature $productRelateFeature
  1052.          *
  1053.          * @return Product
  1054.          */
  1055.         public function addProductRelateFeature(ProductRelateFeature $productRelateFeature)
  1056.         {
  1057.             $this->ProductRelateFeatures[] = $productRelateFeature;
  1058.             return $this;
  1059.         }
  1060.         /**
  1061.          * Remove productRelateFeatures.
  1062.          *
  1063.          * @param \Customize\Entity\ProductRelateFeature $productRelateFeature
  1064.          *
  1065.          * @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
  1066.          */
  1067.         public function removeProductRelateFeature(ProductRelateFeature $productRelateFeature)
  1068.         {
  1069.             return $this->ProductRelateFeatures->removeElement($productRelateFeature);
  1070.         }
  1071.         /**
  1072.          * Get productRelateFeatures.
  1073.          *
  1074.          * @return \Doctrine\Common\Collections\Collection
  1075.          */
  1076.         public function getProductRelateFeatures()
  1077.         {
  1078.             return $this->ProductRelateFeatures;
  1079.         }
  1080.         /**
  1081.          * Add productMovie.
  1082.          *
  1083.          * @param \Customize\Entity\ProductMovie $productMovie
  1084.          *
  1085.          * @return Product
  1086.          */
  1087.         public function addProductMovie(ProductMovie $productMovie)
  1088.         {
  1089.             $this->ProductMovies[] = $productMovie;
  1090.             return $this;
  1091.         }
  1092.         /**
  1093.          * Remove productMovie.
  1094.          *
  1095.          * @param \Customize\Entity\ProductMovie $productMovie
  1096.          *
  1097.          * @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
  1098.          */
  1099.         public function removeProductMovie(ProductMovie $productMovie)
  1100.         {
  1101.             return $this->ProductMovies->removeElement($productMovie);
  1102.         }
  1103.         /**
  1104.          * Get productMovies.
  1105.          *
  1106.          * @return \Doctrine\Common\Collections\Collection
  1107.          */
  1108.         public function getProductMovies()
  1109.         {
  1110.             return $this->ProductMovies;
  1111.         }
  1112.         /**
  1113.          * Add productGallery.
  1114.          *
  1115.          * @param \Customize\Entity\ProductGallery $productGallery
  1116.          *
  1117.          * @return Product
  1118.          */
  1119.         public function addProductGallery(ProductGallery $productGallery)
  1120.         {
  1121.             $this->ProductGalleries[] = $productGallery;
  1122.             return $this;
  1123.         }
  1124.         /**
  1125.          * Remove productGallery.
  1126.          *
  1127.          * @param \Customize\Entity\ProductGallery $productGallery
  1128.          *
  1129.          * @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
  1130.          */
  1131.         public function removeProductGallery(ProductGallery $productGallery)
  1132.         {
  1133.             return $this->ProductGalleries->removeElement($productGallery);
  1134.         }
  1135.         /**
  1136.          * Get productGalleries.
  1137.          *
  1138.          * @return \Doctrine\Common\Collections\Collection
  1139.          */
  1140.         public function getProductGalleries()
  1141.         {
  1142.             return $this->ProductGalleries;
  1143.         }
  1144.         /**
  1145.          * Add productSpec.
  1146.          *
  1147.          * @param \Customize\Entity\ProductSpec $productSpec
  1148.          *
  1149.          * @return Product
  1150.          */
  1151.         public function addProductSpec(ProductSpec $productSpec)
  1152.         {
  1153.             $this->ProductSpecs[] = $productSpec;
  1154.             return $this;
  1155.         }
  1156.         /**
  1157.          * Remove productSpec.
  1158.          *
  1159.          * @param \Customize\Entity\ProductSpec $productSpec
  1160.          *
  1161.          * @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
  1162.          */
  1163.         public function removeProductSpec(ProductSpec $productSpec)
  1164.         {
  1165.             return $this->ProductSpecs->removeElement($productSpec);
  1166.         }
  1167.         /**
  1168.          * Get productSpecs.
  1169.          *
  1170.          * @return \Doctrine\Common\Collections\Collection
  1171.          */
  1172.         public function getProductSpecs()
  1173.         {
  1174.             return $this->ProductSpecs;
  1175.         }
  1176.         /**
  1177.          * Add productDetailImage.
  1178.          *
  1179.          * @param ProductDetailImage $productDetailImage
  1180.          *
  1181.          * @return Product
  1182.          */
  1183.         public function addProductDetailImage(ProductDetailImage $productDetailImage)
  1184.         {
  1185.             $this->ProductDetailImages[] = $productDetailImage;
  1186.             return $this;
  1187.         }
  1188.         /**
  1189.          * Remove productDetailImage.
  1190.          *
  1191.          * @param ProductDetailImage $productDetailImage
  1192.          *
  1193.          * @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
  1194.          */
  1195.         public function removeProductDetailImage(ProductDetailImage $productDetailImage)
  1196.         {
  1197.             return $this->ProductDetailImages->removeElement($productDetailImage);
  1198.         }
  1199.         /**
  1200.          * Get productDetailImages.
  1201.          *
  1202.          * @return \Doctrine\Common\Collections\Collection
  1203.          */
  1204.         public function getProductDetailImages()
  1205.         {
  1206.             return $this->ProductDetailImages;
  1207.         }
  1208.         /**
  1209.          * Add productNaireImage.
  1210.          *
  1211.          * @param ProductNaireImage $productNaireImage
  1212.          *
  1213.          * @return Product
  1214.          */
  1215.         public function addProductNaireImage(ProductNaireImage $productNaireImage)
  1216.         {
  1217.             $this->ProductNaireImages[] = $productNaireImage;
  1218.             return $this;
  1219.         }
  1220.         /**
  1221.          * Remove productNaireImage.
  1222.          *
  1223.          * @param ProductNaireImage $productNaireImage
  1224.          *
  1225.          * @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
  1226.          */
  1227.         public function removeProductNaireImage(ProductNaireImage $productNaireImage)
  1228.         {
  1229.             return $this->ProductNaireImages->removeElement($productNaireImage);
  1230.         }
  1231.         /**
  1232.          * Get productNaireImages.
  1233.          *
  1234.          * @return \Doctrine\Common\Collections\Collection
  1235.          */
  1236.         public function getProductNaireImages()
  1237.         {
  1238.             return $this->ProductNaireImages;
  1239.         }
  1240.         /**
  1241.          * Add productHashTag.
  1242.          *
  1243.          * @param \Customize\Entity\ProductHashTag $productHashTag
  1244.          *
  1245.          * @return Product
  1246.          */
  1247.         public function addProductHashTag(ProductHashTag $productHashTag)
  1248.         {
  1249.             $this->ProductHashTags[] = $productHashTag;
  1250.             return $this;
  1251.         }
  1252.         /**
  1253.          * Remove productHashTag.
  1254.          *
  1255.          * @param \Customize\Entity\ProductHashTag $productHashTag
  1256.          *
  1257.          * @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
  1258.          */
  1259.         public function removeProductHashTag(ProductHashTag $productHashTag)
  1260.         {
  1261.             return $this->ProductHashTags->removeElement($productHashTag);
  1262.         }
  1263.         /**
  1264.          * Get productHashTags.
  1265.          *
  1266.          * @return \Doctrine\Common\Collections\Collection
  1267.          */
  1268.         public function getProductHashTags()
  1269.         {
  1270.             return $this->ProductHashTags;
  1271.         }
  1272.         /**
  1273.          * Set creator.
  1274.          *
  1275.          * @param \Eccube\Entity\Member|null $creator
  1276.          *
  1277.          * @return Product
  1278.          */
  1279.         public function setCreator(Member $creator null)
  1280.         {
  1281.             $this->Creator $creator;
  1282.             return $this;
  1283.         }
  1284.         /**
  1285.          * Get creator.
  1286.          *
  1287.          * @return \Eccube\Entity\Member|null
  1288.          */
  1289.         public function getCreator()
  1290.         {
  1291.             return $this->Creator;
  1292.         }
  1293.         /**
  1294.          * Set status.
  1295.          *
  1296.          * @param \Eccube\Entity\Master\ProductStatus|null $status
  1297.          *
  1298.          * @return Product
  1299.          */
  1300.         public function setStatus(Master\ProductStatus $status null)
  1301.         {
  1302.             $this->Status $status;
  1303.             return $this;
  1304.         }
  1305.         /**
  1306.          * Get status.
  1307.          *
  1308.          * @return \Eccube\Entity\Master\ProductStatus|null
  1309.          */
  1310.         public function getStatus()
  1311.         {
  1312.             return $this->Status;
  1313.         }
  1314.     }