src/Entity/Gos/Orders.php line 21

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Gos;
  3. use App\Entity\Gos\AdditionalAccess\AdditionalAccessBeneficiary;
  4. use App\Entity\Gos\AdditionalAccess\UserAdditionalAccessOffer;
  5. use App\Entity\Gos\VirtualCurrency\VirtualCurrencyTransaction;
  6. use App\Entity\OrdersInterface;
  7. use App\Enum\DocumentDistributionChannels;
  8. use Doctrine\Common\Collections\ArrayCollection;
  9. use Doctrine\Common\Collections\Collection;
  10. use Doctrine\ORM\Mapping as ORM;
  11. /**
  12.  * Orders
  13.  *
  14.  * @ORM\Table()
  15.  * @ORM\Entity(repositoryClass="App\Repository\OrdersRepository")
  16.  * @ORM\HasLifecycleCallbacks
  17.  */
  18. class Orders implements OrdersInterface
  19. {
  20.     /**
  21.      * @var int
  22.      *
  23.      * @ORM\Column(name="id", type="integer")
  24.      * @ORM\Id
  25.      * @ORM\GeneratedValue(strategy="AUTO")
  26.      */
  27.     private $id;
  28.     /**
  29.      * @ORM\Column(type="string", length=150, unique=true, nullable=true)
  30.      */
  31.     private $ordTran;
  32.     /**
  33.      * @ORM\Column(type="text", length=1000, nullable=true)
  34.      */
  35.     private $comment;
  36.     /**
  37.      * @var string
  38.      *
  39.      * @ORM\Column(type="string", length=255, nullable=true)
  40.      */
  41.     private $couponCode;
  42.     /**
  43.      * @var float
  44.      *
  45.      * @ORM\Column(type="float", precision=18, scale=2, nullable=true)
  46.      */
  47.     private $totalPriceGross;
  48.     /**
  49.      * @var float
  50.      *
  51.      * @ORM\Column(type="float", precision=18, scale=2, nullable=true)
  52.      */
  53.     private $totalPriceNet;
  54.     /**
  55.      * @var float
  56.      *
  57.      * @ORM\Column(type="float", precision=18, scale=2, nullable=true)
  58.      */
  59.     private $totalPriceBeforeCouponGross;
  60.     /**
  61.      * @var float
  62.      *
  63.      * @ORM\Column(type="float", precision=18, scale=2, nullable=true)
  64.      */
  65.     private $totalPriceBeforeCouponNet;
  66.     /**
  67.      * @ORM\Column(type="boolean", nullable=true, options={"default":0})
  68.      */
  69.     private $receiveAdvertising;
  70.     /**
  71.      * @ORM\Column(type="string", length=128, nullable=true)
  72.      */
  73.     private $actionNumber;
  74.     /**
  75.      * @ORM\Column(type="string", length=100, nullable=true)
  76.      */
  77.     private $fromSource;
  78.     /**
  79.      * @ORM\Column(type="string", length=100, nullable=true)
  80.      */
  81.     private $campaign;
  82.     /**
  83.      * @ORM\Column(type="string", length=100, nullable=true)
  84.      */
  85.     private $campaignChannel;
  86.     /**
  87.      * @ORM\Column(type="string", length=255, nullable=true)
  88.      */
  89.     private $buttonParameters;
  90.     /**
  91.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\OrderPart", mappedBy="orders", cascade={"persist"})
  92.      */
  93.     private $orderPart;
  94.     /**
  95.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\Participants", mappedBy="orders", cascade={"persist"})
  96.      */
  97.     private $participants;
  98.     /**
  99.      * @ORM\ManyToOne(targetEntity="App\Entity\Gos\Address", inversedBy="orders")
  100.      * @ORM\JoinColumn()
  101.      */
  102.     private $address;
  103.     /**
  104.      * @ORM\ManyToOne(targetEntity="App\Entity\Gos\User", inversedBy="orders")
  105.      * @ORM\JoinColumn()
  106.      */
  107.     private $user;
  108.     /**
  109.      * @ORM\ManyToOne(targetEntity="App\Entity\Gos\PortalSettings", inversedBy="orders")
  110.      * @ORM\JoinColumn()
  111.      */
  112.     private $portalSettings;
  113.     /**
  114.      * @ORM\ManyToOne(targetEntity="App\Entity\Gos\OrderType", inversedBy="orders")
  115.      * @ORM\JoinColumn()
  116.      */
  117.     private $orderType;
  118.     /**
  119.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\OrderTerm", mappedBy="orders")
  120.      */
  121.     private $orderTerms;
  122.     /**
  123.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\SalesManagoEvent", mappedBy="orders")
  124.      */
  125.     private $salesManagoEvent;
  126.     /**
  127.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\UserTerms", mappedBy="orders")
  128.      */
  129.     private $userTerms;
  130.     /**
  131.      * @ORM\Column(type="string", length=15, nullable=true)
  132.      */
  133.     private $client_ipv4;
  134.     /**
  135.      * @ORM\Column(type="string", length=255, nullable=true)
  136.      */
  137.     private $client_host;
  138.     /**
  139.      * @ORM\ManyToOne(targetEntity="App\Entity\Gos\NoTaxType", inversedBy="orders")
  140.      */
  141.     private $noTaxType;
  142.     /**
  143.      * @ORM\Column(type="string", length=255, nullable=true)
  144.      */
  145.     private $noTaxPublicSectorUnit;
  146.     /**
  147.      * @ORM\OneToOne(targetEntity="App\Entity\Gos\TouchPoint", mappedBy="order")
  148.      */
  149.     private $touchPoint;
  150.     /**
  151.      * @ORM\OneToOne(targetEntity="App\Entity\Gos\TouchPointAll", mappedBy="order")
  152.      */
  153.     private $touchPointAll;
  154.     /**
  155.      * @ORM\OneToMany(targetEntity="Gift", mappedBy="buyerOrder", cascade={"persist"})
  156.      */
  157.     private $buyerGift;
  158.     /**
  159.      * @ORM\OneToOne(targetEntity="Gift", mappedBy="recipientOrder")
  160.      */
  161.     private $recipientGift;
  162.     /**
  163.      * @ORM\ManyToOne(targetEntity="Country", inversedBy="orders")
  164.      * @ORM\JoinColumn()
  165.      */
  166.     private $country;
  167.     /**
  168.      * @ORM\ManyToOne(targetEntity="PaymentSystem", inversedBy="orders")
  169.      * @ORM\JoinColumn()
  170.      */
  171.     private $paymentSystem;
  172.     /**
  173.      * @ORM\OneToMany(targetEntity="BraintreeResponse", mappedBy="order")
  174.      */
  175.     private $braintreeResponse;
  176.     /**
  177.      * @ORM\Column(type="datetime")
  178.      */
  179.     private $createdAt;
  180.     /**
  181.      * @ORM\Column(type="datetime", nullable=true)
  182.      */
  183.     private $updatedAt;
  184.     /**
  185.      * @ORM\Column(type="datetime", nullable=true)
  186.      */
  187.     private $deletedAt;
  188.     /**
  189.      * @ORM\Column(type="string", length=255, nullable=true)
  190.      */
  191.     private $infoline;
  192.     /**
  193.      * @ORM\Column(type="string", length=255, nullable=true)
  194.      */
  195.     private $postOrder;
  196.     /**
  197.      * @ORM\OneToOne(targetEntity="App\Entity\Gos\User", mappedBy="orderDuringRegistration")
  198.      */
  199.     private $userFirstOrder;
  200.     /**
  201.      * @ORM\Column(type="text", nullable=true)
  202.      */
  203.     private $marketing;
  204.     /**
  205.      * @ORM\OneToOne(targetEntity="TeleOrder", mappedBy="mainOrder", cascade={"persist", "remove"})
  206.      */
  207.     private $teleOrder;
  208.     /**
  209.      * @ORM\Column(type="datetime", nullable=true)
  210.      */
  211.     private $foExportetAt;
  212.     /**
  213.      * @ORM\OneToMany(targetEntity=FoLog::class, mappedBy="orders")
  214.      */
  215.     private $foLogs;
  216.     /**
  217.      * @ORM\Column(type="boolean", nullable=true, options={"default":0})
  218.      */
  219.     private $isTest;
  220.     /**
  221.      * @ORM\Column(type="boolean", nullable=true)
  222.      */
  223.     private $isGATransactionSent;
  224.     /**
  225.      * @ORM\Column(type="string", length=255, nullable=true)
  226.      */
  227.     private $lab;
  228.     /**
  229.      * @ORM\Column(type="boolean", options={"default":0})
  230.      */
  231.     private $isSbExportNeeded false;
  232.     /**
  233.      * @ORM\Column(type="datetime", nullable=true)
  234.      */
  235.     private $sbExportAt;
  236.     /**
  237.      * @ORM\Column(type="integer", options={"default": 0})
  238.      */
  239.     private $extendedPaymentTime 0;
  240.     /**
  241.      * @ORM\ManyToOne(targetEntity=ShippingType::class)
  242.      */
  243.     private $shippingType;
  244.     /**
  245.      * @ORM\OneToOne(targetEntity=OrderTeleConsultant::class, cascade={"persist", "remove"})
  246.      */
  247.     private $teleConsultant;
  248.     /**
  249.      * @ORM\Column(type="string", length=255, nullable=true)
  250.      */
  251.     private $exportedToSbBy;
  252.     /**
  253.      * @ORM\OneToMany(targetEntity=UserCard::class, mappedBy="orders")
  254.      */
  255.     private $userCards;
  256.     /**
  257.      * @ORM\Column(type="text", nullable=true)
  258.      */
  259.     private $fromSourceAll;
  260.     /**
  261.      * @ORM\Column(type="text", nullable=true)
  262.      */
  263.     private $actionNumberAll;
  264.     /**
  265.      * @ORM\OneToOne(targetEntity=ProductVariantReviewNotification::class, mappedBy="orders")
  266.      */
  267.     private $productVariantsReviewNotification;
  268.     /**
  269.      * @ORM\Column(type="datetime", nullable=true)
  270.      */
  271.     private $paymentRewardDeadline;
  272.     /**
  273.      * @ORM\ManyToOne(targetEntity=UserAdditionalAccessOffer::class, inversedBy="orders")
  274.      */
  275.     private $userAdditionalAccessOffer;
  276.     /**
  277.      * @ORM\OneToMany(targetEntity=AdditionalAccessBeneficiary::class, mappedBy="orders", orphanRemoval=true)
  278.      */
  279.     private $additionalAccessBeneficiaries;
  280.     /**
  281.      * @ORM\Column(type="boolean", nullable=true)
  282.      */
  283.     private $teleOrderSplit;
  284.     /**
  285.      * @ORM\Column(type="string", length=255, nullable=true)
  286.      */
  287.     private $burAssignedSupportId;
  288.     /** @ORM\PrePersist() */
  289.     public function prePersist()
  290.     {
  291.         $this->createdAt = new \DateTime();
  292.     }
  293.     /** @ORM\PreUpdate() */
  294.     public function preUpdate()
  295.     {
  296.         $this->updatedAt = new \DateTime();
  297.     }
  298.     public function __toString()
  299.     {
  300.         return (string)$this->ordTran;
  301.     }
  302.     public function getObjectVars()
  303.     {
  304.         return get_object_vars($this);
  305.     }
  306.     public function getTotalShippingCost($returnNet true)
  307.     {
  308.         $totalShippingCostNet   0;
  309.         $totalShippingCostGross 0;
  310.         foreach ($this->getOrderPart() as $orderPart)
  311.         {
  312.             /** @var OrderPart $orderPart */
  313.             $totalShippingCostNet   += $orderPart->getTotalShippingCostNet();
  314.             $totalShippingCostGross += $orderPart->getTotalShippingCostGross();
  315.         }
  316.         return $returnNet $totalShippingCostNet $totalShippingCostGross;
  317.     }
  318.     public function getTotalPriceGrossWithShipping()
  319.     {
  320.         return $this->getTotalPriceGross() + $this->getTotalShippingCost(false);
  321.     }
  322.     public function getTotalPriceNetWithShipping()
  323.     {
  324.         return $this->getTotalPriceNet() + $this->getTotalShippingCost();
  325.     }
  326.     public function hasTestProduct()
  327.     {
  328.         /** @var OrderPart $orderPart */
  329.         foreach ($this->getOrderPart() as $orderPart)
  330.         {
  331.             if ($orderPart->hasTestProduct())
  332.             {
  333.                 return true;
  334.             }
  335.         }
  336.         return false;
  337.     }
  338.     //------------------------------ setters & getters
  339.     /**
  340.      * Get id
  341.      *
  342.      * @return int
  343.      */
  344.     public function getId()
  345.     {
  346.         return $this->id;
  347.     }
  348.     /**
  349.      * Set ordTran
  350.      *
  351.      * @param string $ordTran
  352.      *
  353.      * @return Orders
  354.      */
  355.     public function setOrdTran($ordTran)
  356.     {
  357.         $this->ordTran $ordTran;
  358.         return $this;
  359.     }
  360.     /**
  361.      * Get ordTran
  362.      *
  363.      * @return string
  364.      */
  365.     public function getOrdTran()
  366.     {
  367.         return $this->ordTran;
  368.     }
  369.     public function getOrdTranForSummaryLink()
  370.     {
  371.         foreach ($this->orderPart as $orderPart)
  372.         {
  373.             if (!empty($orderPart->getOrdTran()) && strpos($orderPart->getOrdTran(), 'WF') !== false)
  374.             {
  375.                 return $orderPart->getOrdTran();
  376.             }
  377.         }
  378.         return $this->ordTran;
  379.     }
  380.     /**
  381.      * Set createdAt
  382.      *
  383.      * @param \DateTime $createdAt
  384.      *
  385.      * @return Orders
  386.      */
  387.     public function setCreatedAt($createdAt)
  388.     {
  389.         $this->createdAt $createdAt;
  390.         return $this;
  391.     }
  392.     /**
  393.      * Get createdAt
  394.      *
  395.      * @return \DateTime
  396.      */
  397.     public function getCreatedAt()
  398.     {
  399.         return $this->createdAt;
  400.     }
  401.     /**
  402.      * Set updatedAt
  403.      *
  404.      * @param \DateTime $updatedAt
  405.      *
  406.      * @return Orders
  407.      */
  408.     public function setUpdatedAt($updatedAt)
  409.     {
  410.         $this->updatedAt $updatedAt;
  411.         return $this;
  412.     }
  413.     /**
  414.      * Get updatedAt
  415.      *
  416.      * @return \DateTime
  417.      */
  418.     public function getUpdatedAt()
  419.     {
  420.         return $this->updatedAt;
  421.     }
  422.     /**
  423.      * Set user
  424.      *
  425.      * @param \App\Entity\Gos\User $user
  426.      *
  427.      * @return Orders
  428.      */
  429.     public function setUser(\App\Entity\Gos\User $user null)
  430.     {
  431.         $this->user $user;
  432.         return $this;
  433.     }
  434.     /**
  435.      * Get user
  436.      *
  437.      * @return \App\Entity\Gos\User
  438.      */
  439.     public function getUser()
  440.     {
  441.         return $this->user;
  442.     }
  443.     /**
  444.      * Set orderType
  445.      *
  446.      * @param \App\Entity\Gos\OrderType $orderType
  447.      *
  448.      * @return Orders
  449.      */
  450.     public function setOrderType(\App\Entity\Gos\OrderType $orderType null)
  451.     {
  452.         $this->orderType $orderType;
  453.         return $this;
  454.     }
  455.     /**
  456.      * Get orderType
  457.      *
  458.      * @return \App\Entity\Gos\OrderType
  459.      */
  460.     public function getOrderType()
  461.     {
  462.         return $this->orderType;
  463.     }
  464.     /**
  465.      * Set comment
  466.      *
  467.      * @param string $comment
  468.      *
  469.      * @return Orders
  470.      */
  471.     public function setComment($comment)
  472.     {
  473.         $this->comment $comment;
  474.         return $this;
  475.     }
  476.     /**
  477.      * Get comment
  478.      *
  479.      * @return string
  480.      */
  481.     public function getComment()
  482.     {
  483.         return $this->comment;
  484.     }
  485.     /**
  486.      * Set address
  487.      *
  488.      * @param \App\Entity\Gos\Address $address
  489.      *
  490.      * @return Orders
  491.      */
  492.     public function setAddress(\App\Entity\Gos\Address $address null)
  493.     {
  494.         $this->address $address;
  495.         return $this;
  496.     }
  497.     /**
  498.      * Get address
  499.      *
  500.      * @return \App\Entity\Gos\Address
  501.      */
  502.     public function getAddress()
  503.     {
  504.         return $this->address;
  505.     }
  506.     /**
  507.      * Set receiveAdvertising
  508.      *
  509.      * @param boolean $receiveAdvertising
  510.      *
  511.      * @return Orders
  512.      */
  513.     public function setReceiveAdvertising($receiveAdvertising)
  514.     {
  515.         $this->receiveAdvertising $receiveAdvertising;
  516.         return $this;
  517.     }
  518.     /**
  519.      * Get receiveAdvertising
  520.      *
  521.      * @return boolean
  522.      */
  523.     public function getReceiveAdvertising()
  524.     {
  525.         return $this->receiveAdvertising;
  526.     }
  527.     /**
  528.      * Set totalPriceGross
  529.      *
  530.      * @param float $totalPriceGross
  531.      *
  532.      * @return Orders
  533.      */
  534.     public function setTotalPriceGross($totalPriceGross)
  535.     {
  536.         $this->totalPriceGross round($totalPriceGross2);
  537.         return $this;
  538.     }
  539.     /**
  540.      * Get totalPriceGross
  541.      *
  542.      * @return float
  543.      */
  544.     public function getTotalPriceGross()
  545.     {
  546.         return $this->totalPriceGross;
  547.     }
  548.     /**
  549.      * Set totalPriceNet
  550.      *
  551.      * @param float $totalPriceNet
  552.      *
  553.      * @return Orders
  554.      */
  555.     public function setTotalPriceNet($totalPriceNet)
  556.     {
  557.         $this->totalPriceNet round($totalPriceNet,2);
  558.         return $this;
  559.     }
  560.     /**
  561.      * Get totalPriceNet
  562.      *
  563.      * @return float
  564.      */
  565.     public function getTotalPriceNet()
  566.     {
  567.         return $this->totalPriceNet;
  568.     }
  569.     /**
  570.      * Set totalPriceBeforeCouponGross
  571.      *
  572.      * @param float $totalPriceBeforeCouponGross
  573.      *
  574.      * @return Orders
  575.      */
  576.     public function setTotalPriceBeforeCouponGross($totalPriceBeforeCouponGross)
  577.     {
  578.         $this->totalPriceBeforeCouponGross round($totalPriceBeforeCouponGross,);
  579.         return $this;
  580.     }
  581.     /**
  582.      * Get totalPriceBeforeCouponGross
  583.      *
  584.      * @return float
  585.      */
  586.     public function getTotalPriceBeforeCouponGross()
  587.     {
  588.         return $this->totalPriceBeforeCouponGross;
  589.     }
  590.     /**
  591.      * Set totalPriceBeforeCouponNet
  592.      *
  593.      * @param float $totalPriceBeforeCouponNet
  594.      *
  595.      * @return Orders
  596.      */
  597.     public function setTotalPriceBeforeCouponNet($totalPriceBeforeCouponNet)
  598.     {
  599.         $this->totalPriceBeforeCouponNet round($totalPriceBeforeCouponNet,2);
  600.         return $this;
  601.     }
  602.     /**
  603.      * Get totalPriceBeforeCouponNet
  604.      *
  605.      * @return float
  606.      */
  607.     public function getTotalPriceBeforeCouponNet()
  608.     {
  609.         return $this->totalPriceBeforeCouponNet;
  610.     }
  611.     /**
  612.      * Set couponCode
  613.      *
  614.      * @param string $couponCode
  615.      *
  616.      * @return Orders
  617.      */
  618.     public function setCouponCode($couponCode)
  619.     {
  620.         $this->couponCode $couponCode;
  621.         return $this;
  622.     }
  623.     /**
  624.      * Get couponCode
  625.      *
  626.      * @return string
  627.      */
  628.     public function getCouponCode()
  629.     {
  630.         return $this->couponCode;
  631.     }
  632.     /**
  633.      * Constructor
  634.      */
  635.     public function __construct()
  636.     {
  637.         $this->orderProductVariant  = new ArrayCollection();
  638.         $this->orderPart            = new ArrayCollection();
  639.         $this->participants         = new ArrayCollection();
  640.         $this->orderTerms           = new ArrayCollection();
  641.         $this->salesManagoEvent     = new ArrayCollection();
  642.         $this->userTerms            = new ArrayCollection();
  643.         $this->buyerGift            = new ArrayCollection();
  644.         $this->braintreeResponse    = new ArrayCollection();
  645.         $this->foLogs               = new ArrayCollection();
  646.         $this->userCards            = new ArrayCollection();
  647.         $this->additionalAccessBeneficiaries = new ArrayCollection();
  648.     }
  649.     /**
  650.      * Set actionNumber
  651.      *
  652.      * @param string $actionNumber
  653.      *
  654.      * @return Orders
  655.      */
  656.     public function setActionNumber($actionNumber)
  657.     {
  658.         $this->actionNumber $actionNumber;
  659.         return $this;
  660.     }
  661.     /**
  662.      * Get actionNumber
  663.      *
  664.      * @return string
  665.      */
  666.     public function getActionNumber()
  667.     {
  668.         return $this->actionNumber;
  669.     }
  670.     /**
  671.      * Set fromSource
  672.      *
  673.      * @param string $fromSource
  674.      *
  675.      * @return Orders
  676.      */
  677.     public function setFromSource($fromSource)
  678.     {
  679.         $this->fromSource $fromSource;
  680.         return $this;
  681.     }
  682.     /**
  683.      * Get fromSource
  684.      *
  685.      * @return string
  686.      */
  687.     public function getFromSource()
  688.     {
  689.         return $this->fromSource;
  690.     }
  691.     /**
  692.      * Set campaign
  693.      *
  694.      * @param string $campaign
  695.      * @return Orders
  696.      */
  697.     public function setCampaign($campaign)
  698.     {
  699.         $this->campaign $campaign;
  700.         return $this;
  701.     }
  702.     /**
  703.      * Get campaign
  704.      *
  705.      * @return string
  706.      */
  707.     public function getCampaign()
  708.     {
  709.         return $this->campaign;
  710.     }
  711.     /**
  712.      * Set campaignChannel
  713.      *
  714.      * @param string $campaignChannel
  715.      * @return Orders
  716.      */
  717.     public function setCampaignChannel($campaignChannel)
  718.     {
  719.         $this->campaignChannel $campaignChannel;
  720.         return $this;
  721.     }
  722.     /**
  723.      * Get campaignChannel
  724.      *
  725.      * @return string
  726.      */
  727.     public function getCampaignChannel()
  728.     {
  729.         return $this->campaignChannel;
  730.     }
  731.     /**
  732.      * Add orderPart
  733.      *
  734.      * @param \App\Entity\Gos\OrderPart $orderPart
  735.      *
  736.      * @return Orders
  737.      */
  738.     public function addOrderPart(\App\Entity\Gos\OrderPart $orderPart)
  739.     {
  740.         $this->orderPart[] = $orderPart;
  741.         return $this;
  742.     }
  743.     /**
  744.      * Remove orderPart
  745.      *
  746.      * @param \App\Entity\Gos\OrderPart $orderPart
  747.      */
  748.     public function removeOrderPart(\App\Entity\Gos\OrderPart $orderPart)
  749.     {
  750.         $this->orderPart->removeElement($orderPart);
  751.     }
  752.     /**
  753.      * Get orderPart
  754.      *
  755.      * @return \Doctrine\Common\Collections\Collection
  756.      */
  757.     public function getOrderPart()
  758.     {
  759.         return $this->orderPart;
  760.     }
  761.     /**
  762.      * Set portalSettings
  763.      *
  764.      * @param \App\Entity\Gos\PortalSettings $portalSettings
  765.      *
  766.      * @return Orders
  767.      */
  768.     public function setPortalSettings(\App\Entity\Gos\PortalSettings $portalSettings null)
  769.     {
  770.         $this->portalSettings $portalSettings;
  771.         return $this;
  772.     }
  773.     /**
  774.      * Get portalSettings
  775.      *
  776.      * @return \App\Entity\Gos\PortalSettings
  777.      */
  778.     public function getPortalSettings()
  779.     {
  780.         return $this->portalSettings;
  781.     }
  782.     /**
  783.      * Add orderTerm
  784.      *
  785.      * @param \App\Entity\Gos\OrderTerm $orderTerm
  786.      *
  787.      * @return Orders
  788.      */
  789.     public function addOrderTerm(\App\Entity\Gos\OrderTerm $orderTerm)
  790.     {
  791.         $this->orderTerms[] = $orderTerm;
  792.         return $this;
  793.     }
  794.     /**
  795.      * Remove orderTerm
  796.      *
  797.      * @param \App\Entity\Gos\OrderTerm $orderTerm
  798.      */
  799.     public function removeOrderTerm(\App\Entity\Gos\OrderTerm $orderTerm)
  800.     {
  801.         $this->orderTerms->removeElement($orderTerm);
  802.     }
  803.     /**
  804.      * Get orderTerms
  805.      *
  806.      * @return \Doctrine\Common\Collections\Collection
  807.      */
  808.     public function getOrderTerms()
  809.     {
  810.         return $this->orderTerms;
  811.     }
  812.     /**
  813.      * Set clientIpv4
  814.      *
  815.      * @param string $clientIpv4
  816.      *
  817.      * @return Orders
  818.      */
  819.     public function setClientIpv4($clientIpv4)
  820.     {
  821.         $this->client_ipv4 $clientIpv4;
  822.         return $this;
  823.     }
  824.     /**
  825.      * Get clientIpv4
  826.      *
  827.      * @return string
  828.      */
  829.     public function getClientIpv4()
  830.     {
  831.         return $this->client_ipv4;
  832.     }
  833.     /**
  834.      * Set clientHost
  835.      *
  836.      * @param string $clientHost
  837.      *
  838.      * @return Orders
  839.      */
  840.     public function setClientHost($clientHost)
  841.     {
  842.         $this->client_host $clientHost;
  843.         return $this;
  844.     }
  845.     /**
  846.      * Get clientHost
  847.      *
  848.      * @return string
  849.      */
  850.     public function getClientHost()
  851.     {
  852.         return $this->client_host;
  853.     }
  854.     /**
  855.      * Set deletedAt
  856.      *
  857.      * @param \DateTime $deletedAt
  858.      *
  859.      * @return Orders
  860.      */
  861.     public function setDeletedAt($deletedAt)
  862.     {
  863.         $this->deletedAt $deletedAt;
  864.         return $this;
  865.     }
  866.     /**
  867.      * Get deletedAt
  868.      *
  869.      * @return \DateTime
  870.      */
  871.     public function getDeletedAt()
  872.     {
  873.         return $this->deletedAt;
  874.     }
  875.     /**
  876.      * Add userTerm
  877.      *
  878.      * @param \App\Entity\Gos\UserTerms $userTerm
  879.      *
  880.      * @return Orders
  881.      */
  882.     public function addUserTerm(\App\Entity\Gos\UserTerms $userTerm)
  883.     {
  884.         $this->userTerms[] = $userTerm;
  885.         return $this;
  886.     }
  887.     /**
  888.      * Remove userTerm
  889.      *
  890.      * @param \App\Entity\Gos\UserTerms $userTerm
  891.      */
  892.     public function removeUserTerm(\App\Entity\Gos\UserTerms $userTerm)
  893.     {
  894.         $this->userTerms->removeElement($userTerm);
  895.     }
  896.     /**
  897.      * Get userTerms
  898.      *
  899.      * @return \Doctrine\Common\Collections\Collection
  900.      */
  901.     public function getUserTerms()
  902.     {
  903.         return $this->userTerms;
  904.     }
  905.     /**
  906.      * Add salesManagoEvent
  907.      *
  908.      * @param \App\Entity\Gos\SalesManagoEvent $salesManagoEvent
  909.      *
  910.      * @return Orders
  911.      */
  912.     public function addSalesManagoEvent(\App\Entity\Gos\SalesManagoEvent $salesManagoEvent)
  913.     {
  914.         $this->salesManagoEvent[] = $salesManagoEvent;
  915.         return $this;
  916.     }
  917.     /**
  918.      * Remove salesManagoEvent
  919.      *
  920.      * @param \App\Entity\Gos\SalesManagoEvent $salesManagoEvent
  921.      */
  922.     public function removeSalesManagoEvent(\App\Entity\Gos\SalesManagoEvent $salesManagoEvent)
  923.     {
  924.         $this->salesManagoEvent->removeElement($salesManagoEvent);
  925.     }
  926.     /**
  927.      * Get salesManagoEvent
  928.      *
  929.      * @return \Doctrine\Common\Collections\Collection
  930.      */
  931.     public function getSalesManagoEvent()
  932.     {
  933.         return $this->salesManagoEvent;
  934.     }
  935.     public function getInfoline(): ?string
  936.     {
  937.         return $this->infoline;
  938.     }
  939.     public function setInfoline(?string $infoline): self
  940.     {
  941.         $this->infoline $infoline;
  942.         return $this;
  943.     }
  944.     public function getPostOrder(): ?string
  945.     {
  946.         return $this->postOrder;
  947.     }
  948.     public function setPostOrder(?string $postOrder): self
  949.     {
  950.         $this->postOrder $postOrder;
  951.         return $this;
  952.     }
  953.     public function getNoTaxPublicSectorUnit(): ?string
  954.     {
  955.         return $this->noTaxPublicSectorUnit;
  956.     }
  957.     public function setNoTaxPublicSectorUnit(?string $noTaxPublicSectorUnit): self
  958.     {
  959.         $this->noTaxPublicSectorUnit $noTaxPublicSectorUnit;
  960.         return $this;
  961.     }
  962.     public function getNoTaxType(): ?NoTaxType
  963.     {
  964.         return $this->noTaxType;
  965.     }
  966.     public function setNoTaxType(?NoTaxType $noTaxType): self
  967.     {
  968.         $this->noTaxType $noTaxType;
  969.         return $this;
  970.     }
  971.     public function getTouchPoint(): ?TouchPoint
  972.     {
  973.         return $this->touchPoint;
  974.     }
  975.     public function setTouchPoint(?TouchPoint $touchPoint): self
  976.     {
  977.         $this->touchPoint $touchPoint;
  978.         // set (or unset) the owning side of the relation if necessary
  979.         $newOrder $touchPoint === null null $this;
  980.         if ($newOrder !== $touchPoint->getOrder()) {
  981.             $touchPoint->setOrder($newOrder);
  982.         }
  983.         return $this;
  984.     }
  985.     public function getBuyerGift(): ?Collection
  986.     {
  987.         return $this->buyerGift;
  988.     }
  989.     public function setBuyerGift(?Gift $buyerGift): self
  990.     {
  991.         $this->buyerGift $buyerGift;
  992.         // set (or unset) the owning side of the relation if necessary
  993.         $newBuyerOrder $buyerGift === null null $this;
  994.         if ($newBuyerOrder !== $buyerGift->getBuyerOrder()) {
  995.             $buyerGift->setBuyerOrder($newBuyerOrder);
  996.         }
  997.         return $this;
  998.     }
  999.     public function getRecipientGift(): ?Gift
  1000.     {
  1001.         return $this->recipientGift;
  1002.     }
  1003.     public function setRecipientGift(?Gift $recipientGift): self
  1004.     {
  1005.         $this->recipientGift $recipientGift;
  1006.         // set (or unset) the owning side of the relation if necessary
  1007.         $newRecipientOrder $recipientGift === null null $this;
  1008.         if ($newRecipientOrder !== $recipientGift->getRecipientOrder()) {
  1009.             $recipientGift->setRecipientOrder($newRecipientOrder);
  1010.         }
  1011.         return $this;
  1012.     }
  1013.     public function addBuyerGift(Gift $buyerGift): self
  1014.     {
  1015.         if (!$this->buyerGift->contains($buyerGift)) {
  1016.             $this->buyerGift[] = $buyerGift;
  1017.             $buyerGift->setBuyerOrder($this);
  1018.         }
  1019.         return $this;
  1020.     }
  1021.     public function removeBuyerGift(Gift $buyerGift): self
  1022.     {
  1023.         if ($this->buyerGift->contains($buyerGift)) {
  1024.             $this->buyerGift->removeElement($buyerGift);
  1025.             // set the owning side to null (unless already changed)
  1026.             if ($buyerGift->getBuyerOrder() === $this) {
  1027.                 $buyerGift->setBuyerOrder(null);
  1028.             }
  1029.         }
  1030.         return $this;
  1031.     }
  1032.     public function getTouchPointAll(): ?TouchPointAll
  1033.     {
  1034.         return $this->touchPointAll;
  1035.     }
  1036.     public function setTouchPointAll(?TouchPointAll $touchPointAll): self
  1037.     {
  1038.         $this->touchPointAll $touchPointAll;
  1039.         // set (or unset) the owning side of the relation if necessary
  1040.         $newOrder $touchPointAll === null null $this;
  1041.         if ($newOrder !== $touchPointAll->getOrder()) {
  1042.             $touchPointAll->setOrder($newOrder);
  1043.         }
  1044.         return $this;
  1045.     }
  1046.     public function getCountry(): ?Country
  1047.     {
  1048.         return $this->country;
  1049.     }
  1050.     public function setCountry(?Country $country): self
  1051.     {
  1052.         $this->country $country;
  1053.         return $this;
  1054.     }
  1055.     public function getUserFirstOrder(): ?User
  1056.     {
  1057.         return $this->userFirstOrder;
  1058.     }
  1059.     public function setUserFirstOrder(?User $user): self
  1060.     {
  1061.         $this->userFirstOrder $user;
  1062.         return $this;
  1063.     }
  1064.     public function checkIsCorrect(): bool
  1065.     {
  1066.         foreach ($this->orderPart as $orderPart)
  1067.         {
  1068.             /** @var OrderPart $orderPart */
  1069.             if (!$orderPart->getIsCorrect()) return false;
  1070.         }
  1071.         return true;
  1072.     }
  1073.     public function mustBeHiddenInSB(): bool
  1074.     {
  1075.         /** @var OrderPart $orderPart */
  1076.         foreach ($this->orderPart as $orderPart)
  1077.         {
  1078.             if ($orderPart->checkIfToHideInSB()) return true;
  1079.         }
  1080.         return false;
  1081.     }
  1082.     public function getProductsWithInvoicePayment(): array
  1083.     {
  1084.         $products = [];
  1085.         /** @var OrderPart $orderPart */
  1086.         foreach ($this->orderPart as $orderPart)
  1087.         {
  1088.             if (!$orderPart->getPaymentMethod())
  1089.             {
  1090.                 continue;
  1091.             }
  1092.             if ($orderPart->getPaymentMethod()->getSlug() === 'invoice')
  1093.             {
  1094.                 foreach ($orderPart->getOrderProductVariant() as $opv)
  1095.                 {
  1096.                     $products[] = $opv;
  1097.                 }
  1098.             }
  1099.         }
  1100.         return $products;
  1101.     }
  1102.     public function omittedShippingCostsInAllProducts(): bool
  1103.     {
  1104.         /** @var OrderPart $orderPart */
  1105.         foreach ($this->orderPart as $orderPart)
  1106.         {
  1107.             if (!$orderPart->omittedShippingCostsInAllProducts())
  1108.             {
  1109.                 return false;
  1110.             }
  1111.         }
  1112.         return true;
  1113.     }
  1114.     public function getProductsWithProformaPayment(): array
  1115.     {
  1116.         $products = [];
  1117.         /** @var OrderPart $orderPart */
  1118.         foreach ($this->orderPart as $orderPart)
  1119.         {
  1120.             /** @var OrderProductVariant $opv */
  1121.             if (!$orderPart->getPaymentMethod())
  1122.             {
  1123.                 continue;
  1124.             }
  1125.             if ($orderPart->getPaymentMethod()->getSlug() === 'proforma-invoice')
  1126.             {
  1127.                 foreach ($orderPart->getOrderProductVariant() as $opv)
  1128.                 {
  1129.                     $products[] = $opv;
  1130.                 }
  1131.             }
  1132.         }
  1133.         return $products;
  1134.     }
  1135.     public function canBePaidForWithOnline(): bool
  1136.     {
  1137.         /** @var OrderPart $orderPart */
  1138.         foreach ($this->orderPart as $orderPart)
  1139.         {
  1140.             if (!$orderPart->checkIfPayOnlineIsActive())
  1141.             {
  1142.                 return false;
  1143.             }
  1144.         }
  1145.         return true;
  1146.     }
  1147.     public function hasRecurringPaymentProducts(): bool
  1148.     {
  1149.         foreach ($this->orderPart as $orderPart)
  1150.         {
  1151.             if ($orderPart->hasRecurringPaymentProducts()) return true;
  1152.         }
  1153.         return false;
  1154.     }
  1155.     public function hasUniqskillsProducts()
  1156.     {
  1157.         foreach ($this->orderPart as $orderPart)
  1158.         {
  1159.             if ($orderPart->hasUniqskillsProducts())
  1160.                 return true;
  1161.         }
  1162.         return false;
  1163.     }
  1164.     public function hasOnlyUniqskillsProducts()
  1165.     {
  1166.         foreach ($this->orderPart as $orderPart)
  1167.         {
  1168.             if (!$orderPart->hasOnlyUniqskillsProducts())
  1169.                 return false;
  1170.         }
  1171.         return true;
  1172.     }
  1173.     public function getOrderedCourse()
  1174.     {
  1175.         /** @var OrderPart $orderPart */
  1176.         foreach ($this->getOrderPart() as $orderPart)
  1177.         {
  1178.             /** @var OrderProductVariant $opv */
  1179.             foreach ($orderPart->getOrderProductVariant() as $opv)
  1180.             {
  1181.                 if ($opv->getProductVariant() === null)
  1182.                 {
  1183.                     return null;
  1184.                 }
  1185.                 if (!$opv->getProductVariant()->getCourses()->isEmpty())
  1186.                 {
  1187.                     return $opv->getProductVariant()->getCourses()->first();
  1188.                 }
  1189.             }
  1190.         }
  1191.         return null;
  1192.     }
  1193.     public function getPaymentSystem(): ?PaymentSystem
  1194.     {
  1195.         return $this->paymentSystem;
  1196.     }
  1197.     public function setPaymentSystem(?PaymentSystem $paymentSystem): self
  1198.     {
  1199.         $this->paymentSystem $paymentSystem;
  1200.         return $this;
  1201.     }
  1202.     public function hasEventProducts()
  1203.     {
  1204.         foreach ($this->orderPart as $orderPart)
  1205.         {
  1206.             if ($orderPart->hasEventProduct())
  1207.                 return true;
  1208.         }
  1209.         return false;
  1210.     }
  1211.     public function hasDelayedProformaProducts()
  1212.     {
  1213.         foreach ($this->orderPart as $orderPart)
  1214.         {
  1215.             if ($orderPart->hasDelayedProformaProducts())
  1216.                 return true;
  1217.         }
  1218.         return false;
  1219.     }
  1220.     /**
  1221.      * @return Collection|BraintreeResponse[]
  1222.      */
  1223.     public function getBraintreeResponse(): Collection
  1224.     {
  1225.         return $this->braintreeResponse;
  1226.     }
  1227.     public function addBraintreeResponse(BraintreeResponse $braintreeResponse): self
  1228.     {
  1229.         if (!$this->braintreeResponse->contains($braintreeResponse)) {
  1230.             $this->braintreeResponse[] = $braintreeResponse;
  1231.             $braintreeResponse->setOrder($this);
  1232.         }
  1233.         return $this;
  1234.     }
  1235.     public function removeBraintreeResponse(BraintreeResponse $braintreeResponse): self
  1236.     {
  1237.         if ($this->braintreeResponse->contains($braintreeResponse)) {
  1238.             $this->braintreeResponse->removeElement($braintreeResponse);
  1239.             // set the owning side to null (unless already changed)
  1240.             if ($braintreeResponse->getOrder() === $this) {
  1241.                 $braintreeResponse->setOrder(null);
  1242.             }
  1243.         }
  1244.         return $this;
  1245.     }
  1246.     public function getIsTele()
  1247.     {
  1248.         if (strpos($this->getComment(), 'TELE ') && $this->getClientHost() == 'www.gos.e-firma.pl')
  1249.         {
  1250.             return true;
  1251.         }
  1252.         return false;
  1253.     }
  1254.     public function getButtonParameters(): ?string
  1255.     {
  1256.         return $this->buttonParameters;
  1257.     }
  1258.     public function setButtonParameters(?string $buttonParameters): self
  1259.     {
  1260.         $this->buttonParameters $buttonParameters;
  1261.         return $this;
  1262.     }
  1263.     public function getMarketing(): ?string
  1264.     {
  1265.         return $this->marketing;
  1266.     }
  1267.     public function setMarketing(?string $marketing): self
  1268.     {
  1269.         $this->marketing $marketing;
  1270.         return $this;
  1271.     }
  1272.     public function addParticipant(Participants $participant)
  1273.     {
  1274.         $this->participants[] = $participant;
  1275.         return $this;
  1276.     }
  1277.     public function removeParticipant(Participants $participant)
  1278.     {
  1279.         $this->participants->removeElement($participant);
  1280.     }
  1281.     public function getParticipants()
  1282.     {
  1283.         return $this->participants;
  1284.     }
  1285.     
  1286.     public function hasAllProductsTaxFreeForBudgetUnit()
  1287.     {
  1288.         /** @var OrderPart $orderPart */
  1289.         foreach ($this->getOrderPart() as $orderPart)
  1290.         {
  1291.             /** @var OrderProductVariant $opv */
  1292.             foreach ($orderPart->getOrderProductVariant() as $opv)
  1293.             {
  1294.                 if (!$opv->getProductVariant()->getTaxFreeForBudgetUnit())
  1295.                 {
  1296.                     return false;
  1297.                 }
  1298.             }
  1299.         }
  1300.         
  1301.         return true;
  1302.     }
  1303.     /**
  1304.      * @return Collection|ProductVariant[]
  1305.      */
  1306.     public function getAllProductVariants(): ?Collection
  1307.     {
  1308.         $variants = new ArrayCollection();
  1309.         /** @var OrderPart $orderPart */
  1310.         foreach ($this->getOrderPart() as $orderPart)
  1311.         {
  1312.             /** @var OrderProductVariant $opv */
  1313.             foreach ($orderPart->getOrderProductVariant() as $opv)
  1314.             {
  1315.                 $variants->add($opv->getProductVariant());
  1316.             }
  1317.         }
  1318.         return $variants;
  1319.     }
  1320.     public function getAllPrimaryProductVariants(): Collection
  1321.     {
  1322.         $variants = new ArrayCollection();
  1323.         /** @var OrderPart $orderPart */
  1324.         foreach ($this->getOrderPart() as $orderPart)
  1325.         {
  1326.             /** @var OrderProductVariant $opv */
  1327.             foreach ($orderPart->getOrderProductVariant() as $opv)
  1328.             {
  1329.                 if ($opv->getPrimaryVariant() === null) {
  1330.                     $variants->add($opv->getProductVariant());
  1331.                 }
  1332.             }
  1333.         }
  1334.         return $variants;
  1335.     }
  1336.     public function getAllOrderProductVariants(): ?Collection
  1337.     {
  1338.         $orderProductVariants = new ArrayCollection();
  1339.         /** @var OrderPart $orderPart */
  1340.         foreach ($this->getOrderPart() as $orderPart)
  1341.         {
  1342.             /** @var OrderProductVariant $opv */
  1343.             foreach ($orderPart->getOrderProductVariant() as $opv)
  1344.             {
  1345.                 $orderProductVariants->add($opv);
  1346.             }
  1347.         }
  1348.         return $orderProductVariants;
  1349.     }
  1350.     public function isEmailInvoiceEnabled(): bool
  1351.     {
  1352.         /** @var OrderPart $orderPart */
  1353.         foreach ($this->getOrderPart() as $orderPart)
  1354.         {
  1355.             /** @var OrderProductVariant $opv */
  1356.             foreach ($orderPart->getOrderProductVariant() as $opv)
  1357.             {
  1358.                 if (
  1359.                     is_null($opv->getProductVariant()->getDocumentDistributionChannel())
  1360.                     ||
  1361.                     $opv->getProductVariant()->getDocumentDistributionChannel() === DocumentDistributionChannels::PAPER)
  1362.                 {
  1363.                     return false;
  1364.                 }
  1365.             }
  1366.         }
  1367.         return true;
  1368.     }
  1369.     public function getTeleOrder(): ?TeleOrder
  1370.     {
  1371.         return $this->teleOrder;
  1372.     }
  1373.     public function setTeleOrder(?TeleOrder $teleOrder): self
  1374.     {
  1375.         $this->teleOrder $teleOrder;
  1376.         return $this;
  1377.     }
  1378.     public function getFoExportetAt(): ?\DateTimeInterface
  1379.     {
  1380.         return $this->foExportetAt;
  1381.     }
  1382.     public function setFoExportetAt(?\DateTimeInterface $foExportetAt): self
  1383.     {
  1384.         $this->foExportetAt $foExportetAt;
  1385.         return $this;
  1386.     }
  1387.     /**
  1388.      * @return Collection|FoLog[]
  1389.      */
  1390.     public function getFoLogs(): Collection
  1391.     {
  1392.         return $this->foLogs;
  1393.     }
  1394.     public function addFoLog(FoLog $foLog): self
  1395.     {
  1396.         if (!$this->foLogs->contains($foLog)) {
  1397.             $this->foLogs[] = $foLog;
  1398.             $foLog->setOrders($this);
  1399.         }
  1400.         return $this;
  1401.     }
  1402.     public function removeFoLog(FoLog $foLog): self
  1403.     {
  1404.         if ($this->foLogs->contains($foLog)) {
  1405.             $this->foLogs->removeElement($foLog);
  1406.             // set the owning side to null (unless already changed)
  1407.             if ($foLog->getOrders() === $this) {
  1408.                 $foLog->setOrders(null);
  1409.             }
  1410.         }
  1411.         return $this;
  1412.     }
  1413.     public function getIsTest(): ?bool
  1414.     {
  1415.         return $this->isTest;
  1416.     }
  1417.     public function setIsTest(?bool $isTest): self
  1418.     {
  1419.         $this->isTest $isTest;
  1420.         return $this;
  1421.     }
  1422.     public function getIsGATransactionSent(): ?bool
  1423.     {
  1424.         return $this->isGATransactionSent;
  1425.     }
  1426.     public function setIsGATransactionSent(?bool $isGATransactionSent): self
  1427.     {
  1428.         $this->isGATransactionSent $isGATransactionSent;
  1429.         return $this;
  1430.     }
  1431.     public function getLab(): ?string
  1432.     {
  1433.         return $this->lab;
  1434.     }
  1435.     public function setLab(?string $lab): self
  1436.     {
  1437.         $this->lab $lab;
  1438.         return $this;
  1439.     }
  1440.     public function getIsSbExportNeeded(): ?bool
  1441.     {
  1442.         return $this->isSbExportNeeded;
  1443.     }
  1444.     public function setIsSbExportNeeded(bool $isSbExportNeeded): self
  1445.     {
  1446.         $this->isSbExportNeeded $isSbExportNeeded;
  1447.         return $this;
  1448.     }
  1449.     public function getSbExportAt(): ?\DateTimeInterface
  1450.     {
  1451.         return $this->sbExportAt;
  1452.     }
  1453.     public function setSbExportAt(?\DateTimeInterface $sbExportAt): self
  1454.     {
  1455.         $this->sbExportAt $sbExportAt;
  1456.         return $this;
  1457.     }
  1458.     public function getExtendedPaymentTime(): ?int
  1459.     {
  1460.         return $this->extendedPaymentTime;
  1461.     }
  1462.     public function setExtendedPaymentTime(int $extendedPaymentTime): self
  1463.     {
  1464.         $this->extendedPaymentTime $extendedPaymentTime;
  1465.         return $this;
  1466.     }
  1467.     public function getShippingType(): ?ShippingType
  1468.     {
  1469.         return $this->shippingType;
  1470.     }
  1471.     public function setShippingType(?ShippingType $shippingType): self
  1472.     {
  1473.         $this->shippingType $shippingType;
  1474.         return $this;
  1475.     }
  1476.     public function getTeleConsultant(): ?OrderTeleConsultant
  1477.     {
  1478.         return $this->teleConsultant;
  1479.     }
  1480.     public function setTeleConsultant(?OrderTeleConsultant $teleConsultant): self
  1481.     {
  1482.         $this->teleConsultant $teleConsultant;
  1483.         return $this;
  1484.     }
  1485.     /**
  1486.      * @return Collection|UserCard[]
  1487.      */
  1488.     public function getUserCards(): Collection
  1489.     {
  1490.         return $this->userCards;
  1491.     }
  1492.     public function addUserCard(UserCard $userCard): self
  1493.     {
  1494.         if (!$this->userCards->contains($userCard)) {
  1495.             $this->userCards[] = $userCard;
  1496.             $userCard->setOrders($this);
  1497.         }
  1498.         return $this;
  1499.     }
  1500.     public function removeUserCard(UserCard $userCard): self
  1501.     {
  1502.         if ($this->userCards->contains($userCard)) {
  1503.             $this->userCards->removeElement($userCard);
  1504.             // set the owning side to null (unless already changed)
  1505.             if ($userCard->getOrders() === $this) {
  1506.                 $userCard->setOrders(null);
  1507.             }
  1508.         }
  1509.         return $this;
  1510.     }
  1511.     public function getExportedToSbBy(): ?string
  1512.     {
  1513.         return $this->exportedToSbBy;
  1514.     }
  1515.     public function setExportedToSbBy(?string $exportedToSbBy): self
  1516.     {
  1517.         $this->exportedToSbBy $exportedToSbBy;
  1518.         return $this;
  1519.     }
  1520.     /**
  1521.      * Checks the notifies of each orderPart
  1522.      * Returns true if all have status: COMPLETED
  1523.      *
  1524.      * @return bool
  1525.      */
  1526.     public function hasOnlinePaymentCompleted(): bool
  1527.     {
  1528.         if ($this->orderPart->isEmpty())
  1529.         {
  1530.             return false;
  1531.         }
  1532.         /** @var OrderPart $orderPart */
  1533.         foreach ($this->orderPart as $orderPart)
  1534.         {
  1535.             if (
  1536.                 $orderPart->getMasterNotify() === null
  1537.                 || !$orderPart->getMasterNotify()->isSuccessfullyPaid()
  1538.             )
  1539.             {
  1540.                 return false;
  1541.             }
  1542.         }
  1543.         return true;
  1544.     }
  1545.     public function getFromSourceAll(): ?string
  1546.     {
  1547.         return $this->fromSourceAll;
  1548.     }
  1549.     public function setFromSourceAll(?string $fromSourceAll): self
  1550.     {
  1551.         $this->fromSourceAll $fromSourceAll;
  1552.         return $this;
  1553.     }
  1554.     public function getActionNumberAll(): ?string
  1555.     {
  1556.         return $this->actionNumberAll;
  1557.     }
  1558.     public function setActionNumberAll(?string $actionNumberAll): self
  1559.     {
  1560.         $this->actionNumberAll $actionNumberAll;
  1561.         return $this;
  1562.     }
  1563.     public function getProductVariantsReviewNotification(): ?ProductVariantReviewNotification
  1564.     {
  1565.         return $this->productVariantsReviewNotification;
  1566.     }
  1567.     public function getPaymentRewardDeadline(): ?\DateTimeInterface
  1568.     {
  1569.         return $this->paymentRewardDeadline;
  1570.     }
  1571.     public function setPaymentRewardDeadline(?\DateTimeInterface $paymentRewardDeadline): self
  1572.     {
  1573.         $this->paymentRewardDeadline $paymentRewardDeadline;
  1574.         return $this;
  1575.     }
  1576.     public function getUserAdditionalAccessOffer(): ?UserAdditionalAccessOffer
  1577.     {
  1578.         return $this->userAdditionalAccessOffer;
  1579.     }
  1580.     public function setUserAdditionalAccessOffer(?UserAdditionalAccessOffer $userAdditionalAccessOffer): self
  1581.     {
  1582.         $this->userAdditionalAccessOffer $userAdditionalAccessOffer;
  1583.         return $this;
  1584.     }
  1585.     /**
  1586.      * @return Collection|AdditionalAccessBeneficiary[]
  1587.      */
  1588.     public function getAdditionalAccessBeneficiaries(): Collection
  1589.     {
  1590.         return $this->additionalAccessBeneficiaries;
  1591.     }
  1592.     public function addAdditionalAccessBeneficiary(AdditionalAccessBeneficiary $additionalAccessBeneficiary): self
  1593.     {
  1594.         if (!$this->additionalAccessBeneficiaries->contains($additionalAccessBeneficiary)) {
  1595.             $this->additionalAccessBeneficiaries[] = $additionalAccessBeneficiary;
  1596.             $additionalAccessBeneficiary->setOrders($this);
  1597.         }
  1598.         return $this;
  1599.     }
  1600.     public function removeAdditionalAccessBeneficiary(AdditionalAccessBeneficiary $additionalAccessBeneficiary): self
  1601.     {
  1602.         if ($this->additionalAccessBeneficiaries->contains($additionalAccessBeneficiary)) {
  1603.             $this->additionalAccessBeneficiaries->removeElement($additionalAccessBeneficiary);
  1604.             // set the owning side to null (unless already changed)
  1605.             if ($additionalAccessBeneficiary->getOrders() === $this) {
  1606.                 $additionalAccessBeneficiary->setOrders(null);
  1607.             }
  1608.         }
  1609.         return $this;
  1610.     }
  1611.     public function getTeleOrderSplit(): ?bool
  1612.     {
  1613.         return $this->teleOrderSplit;
  1614.     }
  1615.     public function setTeleOrderSplit(?bool $teleOrderSplit): self
  1616.     {
  1617.         $this->teleOrderSplit $teleOrderSplit;
  1618.         return $this;
  1619.     }
  1620.     public function getBurAssignedSupportId(): ?string
  1621.     {
  1622.         return $this->burAssignedSupportId;
  1623.     }
  1624.     public function setBurAssignedSupportId(?string $burAssignedSupportId): self
  1625.     {
  1626.         $this->burAssignedSupportId $burAssignedSupportId;
  1627.         return $this;
  1628.     }
  1629.     public function isOnboardingActive(): bool
  1630.     {
  1631.         $isActive false;
  1632.         $portalSettings $this->getPortalSettings();
  1633.         if ($portalSettings !== null) {
  1634.             $onboardingSettings $portalSettings->getOnboardingSettings();
  1635.             if ($onboardingSettings !== null) {
  1636.                 $isActive $onboardingSettings->getIsActive() === true;
  1637.             }
  1638.         }
  1639.         return $isActive;
  1640.     }
  1641.     public function getOnboardingEmailTemplate(): ?EmailTemplate
  1642.     {
  1643.         $emailTemplate null;
  1644.         $portalSettings $this->getPortalSettings();
  1645.         if ($portalSettings !== null) {
  1646.             $onboardingSettings $portalSettings->getOnboardingSettings();
  1647.             if ($onboardingSettings !== null) {
  1648.                 $emailTemplate $onboardingSettings->getEmailTemplate();
  1649.             }
  1650.         }
  1651.         return $emailTemplate;
  1652.     }
  1653.     public function getSalesManago2PurchaseTags(): array
  1654.     {
  1655.         $tags = [];
  1656.         /** @var OrderPart $orderPart */
  1657.         foreach ($this->getOrderPart() as $orderPart) {
  1658.             /** @var OrderProductVariant $orderProductVariant */
  1659.             foreach ($orderPart->getOrderProductVariant() as $orderProductVariant) {
  1660.                 $productVariant $orderProductVariant->getProductVariant();
  1661.                 $product $productVariant->getMasterProduct();
  1662.                 $tags[] = 'ZAKUP_P' $product->getProductNo() . 'END';
  1663.             }
  1664.         }
  1665.         return $tags;
  1666.     }
  1667.     public function getSalesmanago2Funnels(): array
  1668.     {
  1669.         $funnels = [];
  1670.         /** @var OrderPart $orderPart */
  1671.         foreach ($this->getOrderPart() as $orderPart) {
  1672.             /** @var OrderProductVariant $orderProductVariant */
  1673.             foreach ($orderPart->getOrderProductVariant() as $orderProductVariant) {
  1674.                 $productVariant $orderProductVariant->getProductVariant();
  1675.                 $product $productVariant->getMasterProduct();
  1676.                 $funnels[$product->getProductNo()] = $product->getSalesmanagoTags(true);
  1677.             }
  1678.         }
  1679.         return $funnels;
  1680.     }
  1681. }