src/AtechNet/CoreBundle/Entity/ProductMeta.php line 21

Open in your IDE?
  1. <?php
  2. namespace App\AtechNet\CoreBundle\Entity;
  3. use App\AtechNet\CoreBundle\Translation\TranslatorInterface;
  4. use Doctrine\ORM\Mapping\Column;
  5. use Doctrine\ORM\Mapping\Entity;
  6. use Doctrine\ORM\Mapping\HasLifecycleCallbacks;
  7. use Doctrine\ORM\Mapping\JoinColumn;
  8. use Doctrine\ORM\Mapping\ManyToOne;
  9. use Doctrine\ORM\Mapping\Table as Table;
  10. use Symfony\Component\Validator\Constraints as Assert;
  11. /**
  12.  * Album
  13.  *
  14.  * @Table(name="products__metas")
  15.  * @Entity
  16.  * @HasLifecycleCallbacks
  17.  */
  18. class ProductMeta extends AbstractEntity
  19. {
  20.     /**
  21.      * @var Domain
  22.      *
  23.      * @Assert\NotNull
  24.      *
  25.      * @ManyToOne(targetEntity="Domain")
  26.      * @JoinColumn(name="domain_id", referencedColumnName="id")
  27.      */
  28.     private $domain;
  29.     /**
  30.      * @var Product
  31.      *
  32.      * @Assert\NotNull
  33.      *
  34.      * @ManyToOne(targetEntity="Product", inversedBy="metas")
  35.      * @JoinColumn(name="product_id", referencedColumnName="id")
  36.      */
  37.     private $product;
  38.     /**
  39.      * @var float
  40.      *
  41.      * @Column(name="price", type="float", nullable=true)
  42.      */
  43.     private $price = 0;
  44.     /**
  45.      * @var float
  46.      *
  47.      * @Column(name="suggested_price", type="float", nullable=true)
  48.      */
  49.     private $suggestedPrice = 0;
  50.     /**
  51.      * @var float
  52.      *
  53.      * @Column(name="current_vat_price", type="float", nullable=true)
  54.      */
  55.     private $currentVatPrice = 0;
  56.     /**
  57.      * @var float
  58.      *
  59.      * @Column(name="discount", type="float", nullable=true)
  60.      */
  61.     private $discount = 0;
  62.     /**
  63.      * @var bool
  64.      *
  65.      * @Assert\NotNull
  66.      *
  67.      * @Column(name="discounted", type="boolean")
  68.      */
  69.     private $discounted;
  70.     /**
  71.      * @var bool
  72.      *
  73.      * @Assert\NotNull
  74.      *
  75.      * @Column(name="active", type="boolean")
  76.      */
  77.     private $active;
  78.     /**
  79.      * @var bool
  80.      *
  81.      * @Assert\NotNull
  82.      *
  83.      * @Column(name="listed", type="boolean")
  84.      */
  85.     private $listed;
  86.     /**
  87.      * @var bool
  88.      *
  89.      * @Assert\NotNull
  90.      *
  91.      * @Column(name="orderable", type="boolean")
  92.      */
  93.     private $orderable;
  94.     /**
  95.      * @var float
  96.      *
  97.      * @Column(name="vat", type="decimal", precision=10, scale=2)
  98.      */
  99.     private $vat;
  100.     /**
  101.      * @var int
  102.      *
  103.      * @Assert\NotNull
  104.      *
  105.      * @Column(name="warranty", type="integer")
  106.      */
  107.     private $warranty;
  108.     /**
  109.      * @var bool
  110.      *
  111.      * @Assert\NotNull
  112.      *
  113.      * @Column(name="bazaar", type="boolean")
  114.      */
  115.     private $bazaar;
  116.     /**
  117.      * @var bool
  118.      *
  119.      * @Assert\NotNull
  120.      *
  121.      * @Column(name="best_seller", type="boolean")
  122.      */
  123.     private $bestSeller;
  124.     /**
  125.      * @var bool
  126.      *
  127.      * @Assert\NotNull
  128.      *
  129.      * @Column(name="re_lenovo", type="boolean")
  130.      */
  131.     private $reLenovo;
  132.     /**
  133.      * @var bool
  134.      *
  135.      * @Assert\NotNull
  136.      *
  137.      * @Column(name="hp_renew", type="boolean")
  138.      */
  139.     private $hpRenew;
  140.     /**
  141.      * @var bool
  142.      *
  143.      * @Assert\NotNull
  144.      *
  145.      * @Column(name="special_promotion", type="boolean")
  146.      */
  147.     private $specialPromotion;
  148.     /**
  149.      * @var string
  150.      *
  151.      * @Column(name="detail", type="text", nullable=true)
  152.      */
  153.     private $detail = null;
  154.     /**
  155.      * @var \DateTime
  156.      *
  157.      * @Column(name="sale_start", type="datetime", nullable=true)
  158.      */
  159.     private $saleStart;
  160.     /**
  161.      * @var \DateTime
  162.      *
  163.      * @Column(name="sale_end", type="datetime", nullable=true)
  164.      */
  165.     private $saleEnd;
  166.     /**
  167.      * @var \DateTime
  168.      *
  169.      * @Column(name="activation_date", type="datetime", nullable=true)
  170.      */
  171.     private $activationDate;
  172.     /**
  173.      * @var \DateTime
  174.      *
  175.      * @Column(name="discounted_date", type="datetime", nullable=true)
  176.      */
  177.     private $discountedDate;
  178.     /**
  179.      * @var \DateTime
  180.      *
  181.      * @Column(name="flash_sale_date", type="datetime", nullable=true)
  182.      */
  183.     private $flashSaleDate;
  184.     public function __construct()
  185.     {
  186.         parent::__construct();
  187.     }
  188.     /**
  189.      * @return float
  190.      */
  191.     public function getPrice()
  192.     {
  193.         if (in_array($this->domain->getId(), [Domain::DOMAIN_ID_RT_HU, Domain::DOMAIN_ID_WS_HU]) && $this->price % 10 != 0) {
  194.             return floor($this->price / 10) * 10;
  195.         } elseif (in_array($this->domain->getId(), [Domain::DOMAIN_ID_RT_CZ, Domain::DOMAIN_ID_WS_CZ])) {
  196.             return ceil($this->price);
  197.         }
  198.         return $this->price;
  199.     }
  200.     /**
  201.      * @param float $price
  202.      */
  203.     public function setPrice($price)
  204.     {
  205.         $this->price = $price;
  206.     }
  207.     /**
  208.      * @return float
  209.      */
  210.     public function getSuggestedPrice()
  211.     {
  212.         return $this->suggestedPrice;
  213.     }
  214.     /**
  215.      * @param float $suggestedPrice
  216.      */
  217.     public function setSuggestedPrice($suggestedPrice)
  218.     {
  219.         $this->suggestedPrice = $suggestedPrice;
  220.     }
  221.     /**
  222.      * @return float
  223.      */
  224.     public function getDomainSuggestedPrice()
  225.     {
  226.         if ($this->suggestedPriceCache == null) {
  227.             $this->suggestedPriceCache = round($this->getDomainVatSuggestedPrice() / (1 + $this->domain->getVat() / 100.), $this->domain->getPricePrecision(), PHP_ROUND_HALF_UP);
  228.         }
  229.         return $this->suggestedPriceCache;
  230.     }
  231.     private $suggestedPriceCache = null;
  232.     /**
  233.      * @return float
  234.      */
  235.     public function getDomainVatSuggestedPrice()
  236.     {
  237.         if ($this->suggestedVatPriceCache == null) {
  238.             $this->suggestedVatPriceCache = $this->domain->createVatPrice($this->getSuggestedPrice());
  239.         }
  240.         return $this->suggestedVatPriceCache;
  241.     }
  242.     private $suggestedVatPriceCache = null;
  243.     /**
  244.      * @return float
  245.      */
  246.     public function getVatPrice()
  247.     {
  248.         return $this->price * (1 + $this->vat / 100.);
  249.     }
  250.     /**
  251.      * @return float
  252.      */
  253.     public function getVatSuggestedPrice()
  254.     {
  255.         return $this->suggestedPrice * (1 + $this->vat / 100.);
  256.     }
  257.     /**
  258.      * @param float $discount
  259.      */
  260.     public function setDiscount($discount)
  261.     {
  262.         $this->discount = $discount;
  263.     }
  264.     /**
  265.      * @return float
  266.      */
  267.     public function getDiscount()
  268.     {
  269.         if (in_array($this->domain->getId(), [Domain::DOMAIN_ID_RT_HU, Domain::DOMAIN_ID_WS_HU]) && $this->discount % 10 != 0) {
  270.             return floor($this->discount / 10) * 10;
  271.         }
  272.         return $this->discount;
  273.     }
  274.     /**
  275.      * @return float
  276.      */
  277.     public function getVatDiscount()
  278.     {
  279.         return $this->discount * (1 + $this->vat / 100.);
  280.     }
  281.     /**
  282.      * @Assert\IsTrue
  283.      */
  284.     public function isDiscountValid()
  285.     {
  286.         return $this->discount > 0 && $this->discount < $this->price || $this->discount == 0;
  287.     }
  288.     /**
  289.      * @return float
  290.      */
  291.     public function getVat()
  292.     {
  293.         return $this->vat;
  294.     }
  295.     /**
  296.      * @param float $vat
  297.      */
  298.     public function setVat($vat)
  299.     {
  300.         $this->vat = $vat;
  301.     }
  302.     /**
  303.      * @Assert\IsTrue
  304.      */
  305.     public function isVatValid()
  306.     {
  307.         return $this->vat >= 0;
  308.     }
  309.     /**
  310.      * @return boolean
  311.      */
  312.     public function isDiscounted()
  313.     {
  314.         return $this->discounted;
  315.     }
  316.     /**
  317.      * @param boolean $discounted
  318.      */
  319.     public function setDiscounted($discounted)
  320.     {
  321.         $this->discounted = $discounted;
  322.     }
  323.     /**
  324.      * @return boolean
  325.      */
  326.     public function isNormal()
  327.     {
  328.         return !$this->discounted;
  329.     }
  330.     /**
  331.      * @param boolean $normal
  332.      */
  333.     public function setNormal($normal)
  334.     {
  335.         $this->discounted = !$normal;
  336.     }
  337.     /**
  338.      * @return boolean
  339.      */
  340.     public function isActive()
  341.     {
  342.         return $this->active;
  343.     }
  344.     /**
  345.      * @param boolean $active
  346.      */
  347.     public function setActive($active)
  348.     {
  349.         $this->active = $active;
  350.     }
  351.     /**
  352.      * @return boolean
  353.      */
  354.     public function isListed()
  355.     {
  356.         return $this->listed;
  357.     }
  358.     /**
  359.      * @param boolean $listed
  360.      */
  361.     public function setListed($listed)
  362.     {
  363.         $this->listed = $listed;
  364.     }
  365.     /**
  366.      * @return boolean
  367.      */
  368.     public function isOrderable()
  369.     {
  370.         return $this->orderable;
  371.     }
  372.     /**
  373.      * @param boolean $orderable
  374.      */
  375.     public function setOrderable($orderable)
  376.     {
  377.         $this->orderable = $orderable;
  378.     }
  379.     /**
  380.      * @return Product
  381.      */
  382.     public function getProduct()
  383.     {
  384.         return $this->product;
  385.     }
  386.     /**
  387.      * @param Product $product
  388.      */
  389.     public function setProduct($product)
  390.     {
  391.         $this->product = $product;
  392.         $product->addMeta($this);
  393.     }
  394.     /**
  395.      * @return Domain
  396.      */
  397.     public function getDomain()
  398.     {
  399.         return $this->domain;
  400.     }
  401.     /**
  402.      * @param Domain $domain
  403.      */
  404.     public function setDomain($domain)
  405.     {
  406.         $this->domain = $domain;
  407.     }
  408.     public function isReady()
  409.     {
  410.         return $this->price > 0 || $this->discount > 0;
  411.     }
  412.     /**
  413.      * @return float
  414.      */
  415.     public function getCurrentPrice()
  416.     {
  417.         if ($this->isDiscounted()) {
  418.             return $this->getDiscount();
  419.         } else {
  420.             return $this->getPrice();
  421.         }
  422.     }
  423.     /**
  424.      * @return float
  425.      */
  426.     public function getCurrentVatPrice()
  427.     {
  428.         return $this->currentVatPrice;
  429.     }
  430.     /**
  431.      * @param float $currentVatPrice
  432.      */
  433.     public function setCurrentVatPrice($currentVatPrice)
  434.     {
  435.         $this->currentVatPrice = $currentVatPrice;
  436.     }
  437.     /**
  438.      * @return boolean
  439.      */
  440.     public function isDomainDiscounted()
  441.     {
  442.         return $this->isDiscounted();
  443.     }
  444.     private $priceCache = null;
  445.     /**
  446.      * @return float
  447.      */
  448.     public function getDomainPrice()
  449.     {
  450.         if ($this->priceCache == null) {
  451.             $this->priceCache = round($this->getDomainVatPrice() / (1 + $this->domain->getVat() / 100.), $this->domain->getPricePrecision(), PHP_ROUND_HALF_UP);
  452.         }
  453.         if (in_array($this->domain->getId(), [Domain::DOMAIN_ID_RT_HU, Domain::DOMAIN_ID_WS_HU]) && $this->priceCache % 10 != 0) {
  454.             return floor($this->priceCache / 10) * 10;
  455.         }
  456.         return $this->priceCache;
  457.     }
  458.     private $vatPriceCache = null;
  459.     /**
  460.      * @return float
  461.      */
  462.     public function getDomainVatPrice()
  463.     {
  464.         if ($this->vatPriceCache == null) {
  465.             $this->vatPriceCache = $this->domain->createVatPrice($this->getPrice());
  466.         }
  467.         return $this->vatPriceCache;
  468.     }
  469.     private $discountPriceCache = null;
  470.     /**
  471.      * @return float
  472.      */
  473.     public function getDomainDiscount()
  474.     {
  475.         if ($this->discountPriceCache == null) {
  476.             $this->discountPriceCache = round($this->getDomainVatDiscount() / (1 + $this->domain->getVat() / 100.), $this->domain->getPricePrecision(), PHP_ROUND_HALF_UP);
  477.         }
  478.         if (in_array($this->domain->getId(), [Domain::DOMAIN_ID_RT_HU, Domain::DOMAIN_ID_WS_HU]) && $this->discountPriceCache % 10 != 0) {
  479.             return floor($this->discountPriceCache / 10) * 10;
  480.         }
  481.         return $this->discountPriceCache;
  482.     }
  483.     private $discountVatPriceCache = null;
  484.     /**
  485.      * @return float
  486.      */
  487.     public function getDomainVatDiscount()
  488.     {
  489.         if ($this->discountVatPriceCache == null) {
  490.             $this->discountVatPriceCache = $this->domain->createVatPrice($this->getDiscount());
  491.         }
  492.         return $this->discountVatPriceCache;
  493.     }
  494.     /**
  495.      * @return int
  496.      */
  497.     public function getWarranty()
  498.     {
  499.         return $this->warranty;
  500.     }
  501.     /**
  502.      * @param int $warranty
  503.      */
  504.     public function setWarranty($warranty)
  505.     {
  506.         $this->warranty = $warranty;
  507.     }
  508.     /**
  509.      * @return boolean
  510.      */
  511.     public function isBazaar()
  512.     {
  513.         return $this->bazaar;
  514.     }
  515.     /**
  516.      * @param boolean $bazaar
  517.      */
  518.     public function setBazaar($bazaar)
  519.     {
  520.         $this->bazaar = $bazaar;
  521.     }
  522.     /**
  523.      * @return boolean
  524.      */
  525.     public function isBestSeller()
  526.     {
  527.         return $this->bestSeller;
  528.     }
  529.     /**
  530.      * @param boolean $bestSeller
  531.      */
  532.     public function setBestSeller($bestSeller)
  533.     {
  534.         $this->bestSeller = $bestSeller;
  535.     }
  536.     /**
  537.      * @return boolean
  538.      */
  539.     public function isReLenovo()
  540.     {
  541.         return $this->reLenovo;
  542.     }
  543.     /**
  544.      * @param boolean $reLenovo
  545.      */
  546.     public function setReLenovo($reLenovo)
  547.     {
  548.         $this->reLenovo = $reLenovo;
  549.     }
  550.     /**
  551.      * @return boolean
  552.      */
  553.     public function isHpRenew()
  554.     {
  555.         return $this->hpRenew;
  556.     }
  557.     /**
  558.      * @param boolean $hpRenew
  559.      */
  560.     public function setHpRenew($hpRenew)
  561.     {
  562.         $this->hpRenew = $hpRenew;
  563.     }
  564.     /**
  565.      * @return boolean
  566.      */
  567.     public function isSpecialPromotion()
  568.     {
  569.         return $this->specialPromotion;
  570.     }
  571.     /**
  572.      * @param boolean $specialPromotion
  573.      */
  574.     public function setSpecialPromotion($specialPromotion)
  575.     {
  576.         $this->specialPromotion = $specialPromotion;
  577.     }
  578.     /**
  579.      * @return string
  580.      */
  581.     public function getDetail()
  582.     {
  583.         return $this->detail;
  584.     }
  585.     public function getFormatDetail()
  586.     {
  587.         return Product::createFormatedDetail($this->detail);
  588.     }
  589.     /**
  590.      * @param string $detail
  591.      */
  592.     public function setDetail($detail)
  593.     {
  594.         $this->detail = $detail;
  595.     }
  596.     private $fullDescription = [];
  597.     /**
  598.      * @param TranslatorInterface $translator
  599.      * @param bool $fromCache
  600.      * @param bool $lpcFpcCondition
  601.      * @param bool $displayQuality
  602.      * @return string
  603.      */
  604.     public function getFullDescription(TranslatorInterface $translator = null, $fromCache = true, $lpcFpcCondition = false, $displayQuality = false)
  605.     {
  606.         $transName = ($translator == null ? 'default' : $translator->getName());
  607.         if (!isset($this->fullDescription[$transName]) || !$fromCache) {
  608.             $result = '<div class="product-spec">';
  609.             /**
  610.              * @var ProductAttribute $option
  611.              */
  612.             $prevTitle = '';
  613.             foreach ($this->product->getSpecificationProductAttributeOptions() as $option) {
  614.                 if (is_null($option)) {
  615.                     continue;
  616.                 }
  617.                 /**
  618.                  * Do not display quality in this list, its displayed already separately
  619.                  * This will be removed after introduction of stock movements
  620.                  */
  621.                 if ($option->getOption()->getAttribute()->getId() == 101 && !$displayQuality) {
  622.                     continue;
  623.                 }
  624.                 /**
  625.                  * Do not display COAs on LPC and FPC
  626.                  */
  627.                 $optionId = $option->getOption()->getId();
  628.                 if ($lpcFpcCondition && in_array($optionId, [479, 480, 481, 537, 538, 849, 684, 702, 785, 789, 790, 845, 849, 1207])) {
  629.                     continue;
  630.                 }
  631.                 $title = htmlspecialchars($option->getOption()->getLongTitle($translator));
  632.                 if ($title == '') {
  633.                     $title = htmlspecialchars($option->getOption()->getTitle($translator));
  634.                 }
  635.                 $attrTitle = htmlspecialchars($option->getOption()->getAttribute()->getTitle($translator));
  636.                 $multiplier = '';
  637.                 if ($option->getMultiplier() != 0) {
  638.                     $multiplier = $option->getMultiplier() . ' x ';
  639.                 }
  640.                 $style = ' style="color:rgba(255, 255, 255, 0) !important;"';
  641.                 if ($prevTitle != $attrTitle) {
  642.                     $prevTitle = $attrTitle;
  643.                     $style = '';
  644.                 }
  645.                 $result .= '<dl class="attr-' . $option->getOption()->getAttribute()->getId() . '">';
  646.                 $result .= '<dt' . $style . '>' . $attrTitle . ':</dt>';
  647.                 $result .= '<dd>' . $multiplier . $title . '</dd>';
  648.                 $result .= '</dl>';
  649.                 if ($prevTitle == '') {
  650.                     $prevTitle = $attrTitle;
  651.                 }
  652.             }
  653.             $title = !is_null($translator) ? $translator->trans('Dimensions') : 'Dimensions';
  654.             if ($this->product->dimensions('mm', true) != null) {
  655.                 $result .= '<dl><dt>' . $title . ':</dt>';
  656.                 $result .= '<dd>' . $this->product->dimensions('mm', true) . '</dd>';
  657.                 $result .= '</dl>';
  658.             }
  659.             $title = !is_null($translator) ? $translator->trans('Weight') : 'Weight';
  660.             if ($this->product->getWeight() != 0) {
  661.                 $result .= '<dl><dt>' . $title . ':</dt>';
  662.                 $result .= '<dd>' . $this->product->dimensionInUnit($this->product->getWeight(), 'kg', true) . '</dd>';
  663.                 $result .= '</dl>';
  664.             }
  665.             $result .= '</div>';
  666.             $prodDetail = $this->product->getDetail();
  667.             if ($prodDetail !== null && $prodDetail != '') {
  668.                 $result .= Product::createFormatedDetail($prodDetail);
  669.             }
  670.             $detail = $this->getDetail();
  671.             if ($detail !== null && $detail != '') {
  672.                 $result .= Product::createFormatedDetail($detail);
  673.             }
  674.             if ($fromCache) {
  675.                 $this->fullDescription[$transName] = $result;
  676.             } else {
  677.                 return $result;
  678.             }
  679.         }
  680.         return $this->fullDescription[$transName];
  681.     }
  682.     /**
  683.      * Determine if we can add product into eshop cart
  684.      *
  685.      * @return  bool
  686.      **/
  687.     public function canAddToCart()
  688.     {
  689.         if (!$this->isOrderable()) {
  690.             return false;
  691.         }
  692.         if (!$this->product->isAvailable()) {
  693.             switch ($this->product->getOutOfStockStatus()) {
  694.                 case Product::OutOfStockStatus_Empty:
  695.                 case Product::OutOfStockStatus_NotVisibleDefault:
  696.                 case Product::OutOfStockStatus_VisibleComingSoon:
  697.                 case Product::OutOfStockStatus_VisibleSoldOut:
  698.                     return false;
  699.                     break;
  700.             }
  701.         }
  702.         return true;
  703.     }
  704.     /**
  705.      * @return \DateTime
  706.      */
  707.     public function getSaleStart()
  708.     {
  709.         return $this->saleStart;
  710.     }
  711.     /**
  712.      * @param \DateTime $saleStart
  713.      */
  714.     public function setSaleStart($saleStart)
  715.     {
  716.         $this->saleStart = $saleStart;
  717.     }
  718.     /**
  719.      * @return \DateTime
  720.      */
  721.     public function getSaleEnd()
  722.     {
  723.         return $this->saleEnd;
  724.     }
  725.     /**
  726.      * @param \DateTime $saleEnd
  727.      */
  728.     public function setSaleEnd($saleEnd)
  729.     {
  730.         $this->saleEnd = $saleEnd;
  731.     }
  732.     /**
  733.      * @param bool $checkOnlyEnding
  734.      * @return bool
  735.      */
  736.     public function isTimedSaleActive($checkOnlyEnding = false)
  737.     {
  738.         if (!is_null($this->getSaleStart()) || !is_null($this->getSaleEnd())) {
  739.             $currentTime = new \DateTime();
  740.             if (!is_null($this->getSaleStart()) && is_null($this->getSaleEnd()) && !$checkOnlyEnding) {
  741.                 return $currentTime >= $this->getSaleStart();
  742.             }
  743.             if (is_null($this->getSaleStart()) && !is_null($this->getSaleEnd())) {
  744.                 return $currentTime <= $this->getSaleEnd();
  745.             }
  746.             if (!is_null($this->getSaleStart()) && !is_null($this->getSaleEnd())) {
  747.                 return $this->getSaleStart() <= $currentTime && $currentTime <= $this->getSaleEnd();
  748.             }
  749.         }
  750.         return false;
  751.     }
  752.     /**
  753.      * @return \DateTime|null
  754.      */
  755.     public function getActivationDate(): ?\DateTime
  756.     {
  757.         return $this->activationDate;
  758.     }
  759.     /**
  760.      * @param \DateTime|null $activationDate
  761.      */
  762.     public function setActivationDate(?\DateTime $activationDate)
  763.     {
  764.         $this->activationDate = $activationDate;
  765.     }
  766.     /**
  767.      * @return \DateTime|null
  768.      */
  769.     public function getDiscountedDate(): ?\DateTime
  770.     {
  771.         return $this->discountedDate;
  772.     }
  773.     /**
  774.      * @param \DateTime|null $discountedDate
  775.      */
  776.     public function setDiscountedDate(?\DateTime $discountedDate)
  777.     {
  778.         $this->discountedDate = $discountedDate;
  779.     }
  780.     /**
  781.      * @return \DateTime|null
  782.      */
  783.     public function getFlashSaleDate(): ?\DateTime
  784.     {
  785.         return $this->flashSaleDate;
  786.     }
  787.     /**
  788.      * @param \DateTime|null $flashSaleDate
  789.      */
  790.     public function setFlashSaleDate(?\DateTime $flashSaleDate)
  791.     {
  792.         $this->flashSaleDate = $flashSaleDate;
  793.     }
  794. }