src/Entity/Gos/OrderProductVariant.php line 18

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Gos;
  3. use App\Entity\Gos\Uniqskills\Course;
  4. use App\Entity\Gos\Uniqskills\OrderCycle;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. /**
  9.  * OrderProduct
  10.  *
  11.  * @ORM\Table()
  12.  * @ORM\Entity(repositoryClass="App\Repository\OrderProductVariantRepository")
  13.  * @ORM\HasLifecycleCallbacks
  14.  */
  15. class OrderProductVariant
  16. {
  17.     /**
  18.      * @var int
  19.      *
  20.      * @ORM\Column(name="id", type="integer")
  21.      * @ORM\Id
  22.      * @ORM\GeneratedValue(strategy="AUTO")
  23.      */
  24.     private $id;
  25.     /**
  26.      * @var string
  27.      *
  28.      * @ORM\Column(type="string", length=255)
  29.      */
  30.     private $title;
  31.     /**
  32.      * @var string
  33.      *
  34.      * @ORM\Column(type="string", length=255, nullable=true)
  35.      */
  36.     private $productVariantNoComplete;
  37.     /**
  38.      * @var int
  39.      *
  40.      * @ORM\Column(name="quantity", type="integer")
  41.      */
  42.     private $quantity;
  43.     /**
  44.      * @var float
  45.      *
  46.      * @ORM\Column(type="float", precision=18, scale=2)
  47.      */
  48.     private $priceNet;
  49.     /**
  50.      * @var float
  51.      *
  52.      * @ORM\Column(type="float", precision=18, scale=2)
  53.      */
  54.     private $priceGross;
  55.     /**
  56.      * @var float
  57.      *
  58.      * @ORM\Column(type="float", precision=18, scale=2)
  59.      */
  60.     private $priceBeforeCouponNet;
  61.     /**
  62.      * @var float
  63.      *
  64.      * @ORM\Column(type="float", precision=18, scale=2)
  65.      */
  66.     private $priceBeforeCouponGross;
  67.     /**
  68.      * @var bool
  69.      *
  70.      * @ORM\Column(type="boolean", nullable=true)
  71.      */
  72.     private $isGross;
  73.     /**
  74.      * @var bool
  75.      *
  76.      * @ORM\Column(type="boolean", nullable=true)
  77.      */
  78.     private $isFreeAccess;
  79.     /**
  80.      * @ORM\Column(type="datetime", nullable=true)
  81.      */
  82.     private $freeAccessEndAt;
  83.     /**
  84.      * @var int
  85.      *
  86.      * @ORM\Column(type="integer", options={"default" : 1})
  87.      */
  88.     private $maxUsers;
  89.     /**
  90.      * @ORM\ManyToOne(targetEntity="App\Entity\Gos\PaymentMethod", inversedBy="orderProductVariant")
  91.      * @ORM\JoinColumn()
  92.      */
  93.     private $paymentMethod;
  94.     /**
  95.      * @ORM\ManyToOne(targetEntity="App\Entity\Gos\OrderPart", inversedBy="orderProductVariant")
  96.      * @ORM\JoinColumn()
  97.      */
  98.     private $orderPart;
  99.     /**
  100.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\OrderCoupon", mappedBy="orderProductVariant")
  101.      */
  102.     private $orderCoupon;
  103.     /**
  104.      * @ORM\ManyToOne(targetEntity="OrderProductVariantType", inversedBy="orderProductVariant")
  105.      * @ORM\JoinColumn()
  106.      */
  107.     private $orderProductVariantType;
  108.     /**
  109.      * @ORM\OneToMany(targetEntity="OrderProductVariantUser", mappedBy="orderProductVariant", cascade={"persist"})
  110.      */
  111.     private $orderProductVariantUser;
  112.     /**
  113.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\UpdateProductVariantHistory", mappedBy="orderProductVariant")
  114.      */
  115.     private $updateProductVariantHistory;
  116.     /**
  117.      * @ORM\ManyToOne(targetEntity="App\Entity\Gos\ProductVariant", inversedBy="orderProductVariant")
  118.      * @ORM\JoinColumn()
  119.      */
  120.     private $productVariant;
  121.     /**
  122.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\OrderProductVariant", mappedBy="primaryVariant")
  123.      */
  124.     private $additionalVariant;
  125.     /**
  126.      * @ORM\ManyToOne(targetEntity="App\Entity\Gos\OrderProductVariant", inversedBy="additionalVariant")
  127.      * @ORM\JoinColumn(name="primary_variant_id", referencedColumnName="id")
  128.      */
  129.     private $primaryVariant;
  130.     /**
  131.      * @ORM\ManyToOne(targetEntity="App\Entity\Gos\ProductPackItem", inversedBy="orderProductVariant")
  132.      * @ORM\JoinColumn()
  133.      */
  134.     private $productPackItem;
  135.     /**
  136.      * @ORM\OneToOne(targetEntity="Gift", mappedBy="orderProductVariant")
  137.      */
  138.     private $gift;
  139.     /**
  140.      * @ORM\Column(type="datetime")
  141.      */
  142.     private $createdAt;
  143.     /**
  144.      * @ORM\Column(type="datetime", nullable=true)
  145.      */
  146.     private $updatedAt;
  147.     /**
  148.      * @ORM\ManyToOne(targetEntity="App\Entity\Gos\Uniqskills\OrderCycle", inversedBy="orderProductVariants")
  149.      */
  150.     private $cycle;
  151.     /**
  152.      * @ORM\Column(type="boolean", nullable=true, options={"default": 0})
  153.      */
  154.     private $isReminderSend;
  155.     /**
  156.      * @ORM\Column(type="boolean", nullable=true, options={"default": 0})
  157.      */
  158.     private $isUserDone;
  159.     /**
  160.      * @ORM\Column(type="datetime", nullable=true)
  161.      */
  162.     private $showDate;
  163.     /**
  164.      * @ORM\Column(type="datetime", nullable=true)
  165.      */
  166.     private $reminderStartDate;
  167.     /**
  168.      * @ORM\Column(type="integer", nullable=true)
  169.      */
  170.     private $upsellingType;
  171.     /**
  172.      * @ORM\Column(type="boolean", nullable=true)
  173.      */
  174.     private $omittedShippingCosts;
  175.     /**
  176.      * @ORM\ManyToOne(targetEntity=Course::class)
  177.      */
  178.     private $course;
  179.     /**
  180.      * @ORM\OneToMany(targetEntity=OrderProductVariantOmittedUpsell::class, mappedBy="orderProductVariant", orphanRemoval=true)
  181.      */
  182.     private $orderProductVariantOmittedUpsells;
  183.     /**
  184.      * @ORM\OneToMany(targetEntity=EventNotificationScheduler::class, mappedBy="orderProductVariant", orphanRemoval=true, cascade={"remove"})
  185.      */
  186.     private $eventNotificationSchedulers;
  187.     /**
  188.      * @ORM\OneToMany(targetEntity=FailureEventNotifications::class, mappedBy="orderProductVariant", orphanRemoval=true, cascade={"remove"})
  189.      */
  190.     private $failureEventNotifications;
  191.     /**
  192.      * @ORM\OneToMany(targetEntity=SentEventNotifications::class, mappedBy="orderProductVariant", orphanRemoval=true, cascade={"remove"})
  193.      */
  194.     private $sentEventNotifications;
  195.     /**
  196.      * @ORM\Column(type="boolean", nullable=true)
  197.      */
  198.     private $productDuplicationMessageDisplayed;
  199.     /** @ORM\PrePersist() */
  200.     public function prePersist()
  201.     {
  202.         $this->createdAt = new \DateTime();
  203.     }
  204.     /** @ORM\PreUpdate() */
  205.     public function preUpdate()
  206.     {
  207.         $this->updatedAt = new \DateTime();
  208.     }
  209.     public function __toString()
  210.     {
  211.         return (string)$this->title;
  212.     }
  213.     public function checkIfProductVariantHavePaymentMethod(string $paymentMethodSlug): bool
  214.     {
  215.         $additionalOptionsByClientType $this->getAdditionalOptionsByClientType();
  216.         if ($additionalOptionsByClientType)
  217.         {
  218.             foreach ($additionalOptionsByClientType->getPaymentMethod() as $paymentMethod)
  219.             {
  220.                 if ($paymentMethod->getSlug() === $paymentMethodSlug)
  221.                 {
  222.                     return true;
  223.                 }
  224.             }
  225.         }
  226.         return false;
  227.     }
  228.     public function checkIfProductVariantHaveToBeHiddenInSB(): bool
  229.     {
  230.         $additionalOptionsByClientType $this->getAdditionalOptionsByClientType();
  231.         if ($additionalOptionsByClientType && $additionalOptionsByClientType->getHiddenInSBTillPaid() === true)
  232.         {
  233.             return true;
  234.         }
  235.         return false;
  236.     }
  237.     public function getAdditionalOptionsByClientType(): ?AdditionalOptionsByClientType
  238.     {
  239.         return $this->getProductVariant()->getAdditionalOptionsByClientType($this->getClientTypeByOrder());
  240.     }
  241.     private function getClientTypeByOrder(): ?ClientType
  242.     {
  243.         $order $this->getOrderPart()->getOrders();
  244.         return $order->getAddress() ? $order->getAddress()->getClientType() : null;
  245.     }
  246.     /**
  247.      * Set orderPart
  248.      *
  249.      * @param OrderPart $orderPart
  250.      *
  251.      * @return OrderProductVariant
  252.      */
  253.     public function setOrderPart(OrderPart $orderPart null)
  254.     {
  255.         $this->orderPart $orderPart;
  256.         if (!empty($orderPart))
  257.         {
  258.             $orderPart->setOrderProductVariant($this);
  259.         }
  260.         return $this;
  261.     }
  262.     //------------------------------ setters & getters
  263.     /**
  264.      * Constructor
  265.      */
  266.     public function __construct()
  267.     {
  268.         $this->orderCoupon                  = new ArrayCollection();
  269.         $this->orderProductVariantUser      = new ArrayCollection();
  270.         $this->updateProductVariantHistory  = new ArrayCollection();
  271.         $this->additionalVariant            = new ArrayCollection();
  272.         $this->orderProductVariantOmittedUpsells = new ArrayCollection();
  273.     }
  274.     /**
  275.      * Get id
  276.      *
  277.      * @return integer
  278.      */
  279.     public function getId()
  280.     {
  281.         return $this->id;
  282.     }
  283.     /**
  284.      * Set title
  285.      *
  286.      * @param string $title
  287.      *
  288.      * @return OrderProductVariant
  289.      */
  290.     public function setTitle($title)
  291.     {
  292.         $this->title $title;
  293.         return $this;
  294.     }
  295.     /**
  296.      * Get title
  297.      *
  298.      * @return string
  299.      */
  300.     public function getTitle()
  301.     {
  302.         return $this->title;
  303.     }
  304.     /**
  305.      * Set productVariantNoComplete
  306.      *
  307.      * @param string $productVariantNoComplete
  308.      *
  309.      * @return OrderProductVariant
  310.      */
  311.     public function setProductVariantNoComplete($productVariantNoComplete)
  312.     {
  313.         $this->productVariantNoComplete $productVariantNoComplete;
  314.         return $this;
  315.     }
  316.     /**
  317.      * Get productVariantNoComplete
  318.      *
  319.      * @return string
  320.      */
  321.     public function getProductVariantNoComplete()
  322.     {
  323.         return $this->productVariantNoComplete;
  324.     }
  325.     /**
  326.      * Set quantity
  327.      *
  328.      * @param integer $quantity
  329.      *
  330.      * @return OrderProductVariant
  331.      */
  332.     public function setQuantity($quantity)
  333.     {
  334.         $this->quantity $quantity;
  335.         return $this;
  336.     }
  337.     /**
  338.      * Get quantity
  339.      *
  340.      * @return integer
  341.      */
  342.     public function getQuantity()
  343.     {
  344.         return $this->quantity;
  345.     }
  346.     /**
  347.      * Set priceNet
  348.      *
  349.      * @param float $priceNet
  350.      *
  351.      * @return OrderProductVariant
  352.      */
  353.     public function setPriceNet($priceNet)
  354.     {
  355.         $this->priceNet $priceNet;
  356.         return $this;
  357.     }
  358.     /**
  359.      * Get priceNet
  360.      *
  361.      * @return float
  362.      */
  363.     public function getPriceNet()
  364.     {
  365.         return $this->priceNet;
  366.     }
  367.     /**
  368.      * Set priceGross
  369.      *
  370.      * @param float $priceGross
  371.      *
  372.      * @return OrderProductVariant
  373.      */
  374.     public function setPriceGross($priceGross)
  375.     {
  376.         $this->priceGross $priceGross;
  377.         return $this;
  378.     }
  379.     /**
  380.      * Get priceGross
  381.      *
  382.      * @return float
  383.      */
  384.     public function getPriceGross()
  385.     {
  386.         return $this->priceGross;
  387.     }
  388.     /**
  389.      * Set priceBeforeCouponNet
  390.      *
  391.      * @param float $priceBeforeCouponNet
  392.      *
  393.      * @return OrderProductVariant
  394.      */
  395.     public function setPriceBeforeCouponNet($priceBeforeCouponNet)
  396.     {
  397.         $this->priceBeforeCouponNet $priceBeforeCouponNet;
  398.         return $this;
  399.     }
  400.     /**
  401.      * Get priceBeforeCouponNet
  402.      *
  403.      * @return float
  404.      */
  405.     public function getPriceBeforeCouponNet()
  406.     {
  407.         return $this->priceBeforeCouponNet;
  408.     }
  409.     /**
  410.      * Set priceBeforeCouponGross
  411.      *
  412.      * @param float $priceBeforeCouponGross
  413.      *
  414.      * @return OrderProductVariant
  415.      */
  416.     public function setPriceBeforeCouponGross($priceBeforeCouponGross)
  417.     {
  418.         $this->priceBeforeCouponGross $priceBeforeCouponGross;
  419.         return $this;
  420.     }
  421.     /**
  422.      * Get priceBeforeCouponGross
  423.      *
  424.      * @return float
  425.      */
  426.     public function getPriceBeforeCouponGross()
  427.     {
  428.         return $this->priceBeforeCouponGross;
  429.     }
  430.     /**
  431.      * Set isGross
  432.      *
  433.      * @param boolean $isGross
  434.      *
  435.      * @return OrderProductVariant
  436.      */
  437.     public function setIsGross($isGross)
  438.     {
  439.         $this->isGross $isGross;
  440.         return $this;
  441.     }
  442.     /**
  443.      * Get isGross
  444.      *
  445.      * @return boolean
  446.      */
  447.     public function getIsGross()
  448.     {
  449.         return $this->isGross;
  450.     }
  451.     /**
  452.      * Set createdAt
  453.      *
  454.      * @param \DateTime $createdAt
  455.      *
  456.      * @return OrderProductVariant
  457.      */
  458.     public function setCreatedAt($createdAt)
  459.     {
  460.         $this->createdAt $createdAt;
  461.         return $this;
  462.     }
  463.     /**
  464.      * Get createdAt
  465.      *
  466.      * @return \DateTime
  467.      */
  468.     public function getCreatedAt()
  469.     {
  470.         return $this->createdAt;
  471.     }
  472.     /**
  473.      * Set updatedAt
  474.      *
  475.      * @param \DateTime $updatedAt
  476.      *
  477.      * @return OrderProductVariant
  478.      */
  479.     public function setUpdatedAt($updatedAt)
  480.     {
  481.         $this->updatedAt $updatedAt;
  482.         return $this;
  483.     }
  484.     /**
  485.      * Get updatedAt
  486.      *
  487.      * @return \DateTime
  488.      */
  489.     public function getUpdatedAt()
  490.     {
  491.         return $this->updatedAt;
  492.     }
  493.     /**
  494.      * Set paymentMethod
  495.      *
  496.      * @param PaymentMethod $paymentMethod
  497.      *
  498.      * @return OrderProductVariant
  499.      */
  500.     public function setPaymentMethod(PaymentMethod $paymentMethod null)
  501.     {
  502.         $this->paymentMethod $paymentMethod;
  503.         return $this;
  504.     }
  505.     /**
  506.      * Get paymentMethod
  507.      *
  508.      * @return PaymentMethod
  509.      */
  510.     public function getPaymentMethod()
  511.     {
  512.         return $this->paymentMethod;
  513.     }
  514.     /**
  515.      * Get orderPart
  516.      *
  517.      * @return OrderPart
  518.      */
  519.     public function getOrderPart()
  520.     {
  521.         return $this->orderPart;
  522.     }
  523.     /**
  524.      * Add orderCoupon
  525.      *
  526.      * @param OrderCoupon $orderCoupon
  527.      *
  528.      * @return OrderProductVariant
  529.      */
  530.     public function addOrderCoupon(OrderCoupon $orderCoupon)
  531.     {
  532.         $this->orderCoupon[] = $orderCoupon;
  533.         return $this;
  534.     }
  535.     /**
  536.      * Remove orderCoupon
  537.      *
  538.      * @param OrderCoupon $orderCoupon
  539.      */
  540.     public function removeOrderCoupon(OrderCoupon $orderCoupon)
  541.     {
  542.         $this->orderCoupon->removeElement($orderCoupon);
  543.     }
  544.     /**
  545.      * Get orderCoupon
  546.      *
  547.      * @return Collection
  548.      */
  549.     public function getOrderCoupon()
  550.     {
  551.         return $this->orderCoupon;
  552.     }
  553.     /**
  554.      * Set orderProductVariantType
  555.      *
  556.      * @param OrderProductVariantType $orderProductVariantType
  557.      *
  558.      * @return OrderProductVariant
  559.      */
  560.     public function setOrderProductVariantType(
  561.         OrderProductVariantType $orderProductVariantType null
  562.     ) {
  563.         $this->orderProductVariantType $orderProductVariantType;
  564.         return $this;
  565.     }
  566.     /**
  567.      * Get orderProductVariantType
  568.      *
  569.      * @return OrderProductVariantType
  570.      */
  571.     public function getOrderProductVariantType()
  572.     {
  573.         return $this->orderProductVariantType;
  574.     }
  575.     /**
  576.      * Add orderProductVariantUser
  577.      *
  578.      * @param OrderProductVariantUser $orderProductVariantUser
  579.      *
  580.      * @return OrderProductVariant
  581.      */
  582.     public function addOrderProductVariantUser(OrderProductVariantUser $orderProductVariantUser)
  583.     {
  584.         $this->orderProductVariantUser[] = $orderProductVariantUser;
  585.         return $this;
  586.     }
  587.     /**
  588.      * Remove orderProductVariantUser
  589.      *
  590.      * @param OrderProductVariantUser $orderProductVariantUser
  591.      */
  592.     public function removeOrderProductVariantUser(
  593.         OrderProductVariantUser $orderProductVariantUser
  594.     ) {
  595.         $this->orderProductVariantUser->removeElement($orderProductVariantUser);
  596.     }
  597.     /**
  598.      * Get orderProductVariantUser
  599.      *
  600.      * @return Collection
  601.      */
  602.     public function getOrderProductVariantUser()
  603.     {
  604.         return $this->orderProductVariantUser;
  605.     }
  606.     public function isUserAdmin(User $user): bool
  607.     {
  608.         /** @var OrderProductVariantUser $opvu */
  609.         foreach ($this->orderProductVariantUser as $opvu)
  610.         {
  611.             if ($opvu->getUser() === $user)
  612.             {
  613.                 if ($opvu->getRoles() === 'ADMIN')
  614.                 {
  615.                     return true;
  616.                 }
  617.             }
  618.         }
  619.         return false;
  620.     }
  621.     /**
  622.      * Set maxUsers
  623.      *
  624.      * @param integer $maxUsers
  625.      *
  626.      * @return OrderProductVariant
  627.      */
  628.     public function setMaxUsers($maxUsers)
  629.     {
  630.         $this->maxUsers $maxUsers;
  631.         return $this;
  632.     }
  633.     /**
  634.      * Get maxUsers
  635.      *
  636.      * @return integer
  637.      */
  638.     public function getMaxUsers()
  639.     {
  640.         return $this->maxUsers;
  641.     }
  642.     /**
  643.      * Set isFreeAccess
  644.      *
  645.      * @param boolean $isFreeAccess
  646.      *
  647.      * @return OrderProductVariant
  648.      */
  649.     public function setIsFreeAccess($isFreeAccess)
  650.     {
  651.         $this->isFreeAccess $isFreeAccess;
  652.         return $this;
  653.     }
  654.     /**
  655.      * Get isFreeAccess
  656.      *
  657.      * @return boolean
  658.      */
  659.     public function getIsFreeAccess()
  660.     {
  661.         return $this->isFreeAccess;
  662.     }
  663.     /**
  664.      * Set freeAccessEndAt
  665.      *
  666.      * @param \DateTime $freeAccessEndAt
  667.      *
  668.      * @return OrderProductVariant
  669.      */
  670.     public function setFreeAccessEndAt($freeAccessEndAt)
  671.     {
  672.         $this->freeAccessEndAt $freeAccessEndAt;
  673.         return $this;
  674.     }
  675.     /**
  676.      * Get freeAccessEndAt
  677.      *
  678.      * @return \DateTime
  679.      */
  680.     public function getFreeAccessEndAt()
  681.     {
  682.         return $this->freeAccessEndAt;
  683.     }
  684.     /**
  685.      * Add updateProductVariantHistory
  686.      *
  687.      * @param UpdateProductVariantHistory $updateProductVariantHistory
  688.      *
  689.      * @return OrderProductVariant
  690.      */
  691.     public function addUpdateProductVariantHistory(
  692.         UpdateProductVariantHistory $updateProductVariantHistory
  693.     ) {
  694.         $this->updateProductVariantHistory[] = $updateProductVariantHistory;
  695.         return $this;
  696.     }
  697.     /**
  698.      * Remove updateProductVariantHistory
  699.      *
  700.      * @param UpdateProductVariantHistory $updateProductVariantHistory
  701.      */
  702.     public function removeUpdateProductVariantHistory(
  703.         UpdateProductVariantHistory $updateProductVariantHistory
  704.     ) {
  705.         $this->updateProductVariantHistory->removeElement($updateProductVariantHistory);
  706.     }
  707.     /**
  708.      * Get updateProductVariantHistory
  709.      *
  710.      * @return Collection
  711.      */
  712.     public function getUpdateProductVariantHistory()
  713.     {
  714.         return $this->updateProductVariantHistory;
  715.     }
  716.     /**
  717.      * Set productVariant
  718.      *
  719.      * @param ProductVariant $productVariant
  720.      *
  721.      * @return OrderProductVariant
  722.      */
  723.     public function setProductVariant(ProductVariant $productVariant null)
  724.     {
  725.         $this->productVariant $productVariant;
  726.         return $this;
  727.     }
  728.     /**
  729.      * Get productVariant
  730.      *
  731.      * @return ProductVariant
  732.      */
  733.     public function getProductVariant()
  734.     {
  735.         return $this->productVariant;
  736.     }
  737.     /**
  738.      * @return Collection|OrderProductVariant[]
  739.      */
  740.     public function getAdditionalVariant(): Collection
  741.     {
  742.         return $this->additionalVariant;
  743.     }
  744.     public function addAdditionalVariant(OrderProductVariant $additionalVariant): self
  745.     {
  746.         if (!$this->additionalVariant->contains($additionalVariant))
  747.         {
  748.             $this->additionalVariant[] = $additionalVariant;
  749.             $additionalVariant->setPrimaryVariant($this);
  750.         }
  751.         return $this;
  752.     }
  753.     public function removeAdditionalVariant(OrderProductVariant $additionalVariant): self
  754.     {
  755.         if ($this->additionalVariant->contains($additionalVariant))
  756.         {
  757.             $this->additionalVariant->removeElement($additionalVariant);
  758.             // set the owning side to null (unless already changed)
  759.             if ($additionalVariant->getPrimaryVariant() === $this)
  760.             {
  761.                 $additionalVariant->setPrimaryVariant(null);
  762.             }
  763.         }
  764.         return $this;
  765.     }
  766.     public function getPrimaryVariant(): ?self
  767.     {
  768.         return $this->primaryVariant;
  769.     }
  770.     public function setPrimaryVariant(?self $primaryVariant): self
  771.     {
  772.         $this->primaryVariant $primaryVariant;
  773.         return $this;
  774.     }
  775.     public function getProductPackItem(): ?ProductPackItem
  776.     {
  777.         return $this->productPackItem;
  778.     }
  779.     public function setProductPackItem(?ProductPackItem $productPackItem): self
  780.     {
  781.         $this->productPackItem $productPackItem;
  782.         return $this;
  783.     }
  784.     public function getGift(): ?Gift
  785.     {
  786.         return $this->gift;
  787.     }
  788.     public function setGift(?Gift $gift): self
  789.     {
  790.         $this->gift $gift;
  791.         // set (or unset) the owning side of the relation if necessary
  792.         $newOrderProductVariant $gift === null null $this;
  793.         if ($newOrderProductVariant !== $gift->getOrderProductVariant()) {
  794.             $gift->setOrderProductVariant($newOrderProductVariant);
  795.         }
  796.         return $this;
  797.     }
  798.     public function getCycle(): ?OrderCycle
  799.     {
  800.         return $this->cycle;
  801.     }
  802.     public function setCycle(?OrderCycle $cycle): self
  803.     {
  804.         $this->cycle $cycle;
  805.         return $this;
  806.     }
  807.     public function getIsReminderSend(): ?bool
  808.     {
  809.         return $this->isReminderSend;
  810.     }
  811.     public function setIsReminderSend(?bool $isReminderSend): self
  812.     {
  813.         $this->isReminderSend $isReminderSend;
  814.         return $this;
  815.     }
  816.     public function getIsUserDone(): ?bool
  817.     {
  818.         return $this->isUserDone;
  819.     }
  820.     public function setIsUserDone(?bool $isUserDone): self
  821.     {
  822.         $this->isUserDone $isUserDone;
  823.         return $this;
  824.     }
  825.     public function getShowDate(): ?\DateTimeInterface
  826.     {
  827.         return $this->showDate;
  828.     }
  829.     public function setShowDate(?\DateTimeInterface $showDate): self
  830.     {
  831.         $this->showDate $showDate;
  832.         return $this;
  833.     }
  834.     public function getReminderStartDate(): ?\DateTimeInterface
  835.     {
  836.         return $this->reminderStartDate;
  837.     }
  838.     public function setReminderStartDate(?\DateTimeInterface $reminderStartDate): self
  839.     {
  840.         $this->reminderStartDate $reminderStartDate;
  841.         return $this;
  842.     }
  843.     public function getUpsellingType(): ?int
  844.     {
  845.         return $this->upsellingType;
  846.     }
  847.     public function setUpsellingType(?int $upsellingType): self
  848.     {
  849.         $this->upsellingType $upsellingType;
  850.         return $this;
  851.     }
  852.     public function getOmittedShippingCosts(): ?bool
  853.     {
  854.         return $this->omittedShippingCosts;
  855.     }
  856.     public function setOmittedShippingCosts(?bool $omittedShippingCosts): self
  857.     {
  858.         $this->omittedShippingCosts $omittedShippingCosts;
  859.         return $this;
  860.     }
  861.     public function getCourse(): ?Course
  862.     {
  863.         return $this->course;
  864.     }
  865.     public function setCourse(?Course $course): self
  866.     {
  867.         $this->course $course;
  868.         return $this;
  869.     }
  870.     /**
  871.      * @return Collection|OrderProductVariantOmittedUpsell[]
  872.      */
  873.     public function getOrderProductVariantOmittedUpsells(): Collection
  874.     {
  875.         return $this->orderProductVariantOmittedUpsells;
  876.     }
  877.     public function addOrderProductVariantOmittedUpsell(OrderProductVariantOmittedUpsell $orderProductVariantOmittedUpsell): self
  878.     {
  879.         if (!$this->orderProductVariantOmittedUpsells->contains($orderProductVariantOmittedUpsell)) {
  880.             $this->orderProductVariantOmittedUpsells[] = $orderProductVariantOmittedUpsell;
  881.             $orderProductVariantOmittedUpsell->setOrderProductVariant($this);
  882.         }
  883.         return $this;
  884.     }
  885.     public function removeOrderProductVariantOmittedUpsell(OrderProductVariantOmittedUpsell $orderProductVariantOmittedUpsell): self
  886.     {
  887.         if ($this->orderProductVariantOmittedUpsells->contains($orderProductVariantOmittedUpsell)) {
  888.             $this->orderProductVariantOmittedUpsells->removeElement($orderProductVariantOmittedUpsell);
  889.             // set the owning side to null (unless already changed)
  890.             if ($orderProductVariantOmittedUpsell->getOrderProductVariant() === $this) {
  891.                 $orderProductVariantOmittedUpsell->setOrderProductVariant(null);
  892.             }
  893.         }
  894.         return $this;
  895.     }
  896.     public function getProductDuplicationMessageDisplayed(): ?bool
  897.     {
  898.         return $this->productDuplicationMessageDisplayed;
  899.     }
  900.     public function setProductDuplicationMessageDisplayed(?bool $productDuplicationMessageDisplayed): self
  901.     {
  902.         $this->productDuplicationMessageDisplayed $productDuplicationMessageDisplayed;
  903.         return $this;
  904.     }
  905. }