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