src/Entity/Order.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use App\Listener\OrderListener;
  6. use Symfony\Component\Serializer\Annotation\Ignore;
  7. use Symfony\Component\Validator\Constraints as Assert;
  8. /**
  9.  * @ORM\Entity(repositoryClass="App\Repository\OrderRepository")
  10.  * @ORM\Table(name="orders")
  11.  * @ORM\HasLifecycleCallbacks()
  12.  * @ORM\EntityListeners({OrderListener::class})
  13.  */
  14. class Order implements DomainBaseInterface
  15. {
  16.     const STATUS_PAID 'paid';
  17.     const STATUS_NEW 'new';
  18.     const STATUS_OPEN 'open';
  19.     const STATUS_FAILED 'failed';
  20.     const STATUS_IN_PROCESS 'IN_PROCESS';
  21.     const PARTIALLY_REFUNDED 'partially refunded';
  22.     const REFUNDED 'refunded';
  23.     const STATUS_CHARGEBACK 'chargeback';
  24.     const STATUS_COPIED 'copied';
  25.     const PARTIALLY_PAID 'partially paid';
  26.     const STATUS_PENDING 'pending';
  27.     const MANUALLY_CREATED 'manually created';
  28.     const TZ 'Europe/Amsterdam';
  29.     const SS_STATUS_NEW 'New';
  30.     const SS_STATUS_DELIVERED 'Delivered';
  31.     const SS_STATUS_SHIPPED 'Shipped';
  32.     const SS_STATUS_CANCELED 'Canceled';
  33.     const TYPE_ONE_OFF 'one-off';
  34.     const TYPE_SUBSCRIPTION 'subscription';
  35.     /**
  36.      * @Ignore()
  37.     */
  38.     private int $variantId 0;
  39.     /**
  40.      * @var int $id
  41.      * @ORM\Id()
  42.      * @ORM\GeneratedValue(strategy="AUTO")
  43.      * @ORM\Column(type="integer")
  44.      */
  45.     private $id;
  46.     /**
  47.      * @var PaymentProvider $paymentProvider
  48.      * @ORM\ManyToOne(targetEntity="PaymentProvider")
  49.      * @Ignore()
  50.      */
  51.     private $paymentProvider;
  52.     /**
  53.      * @var ShippingProvider $shippingProvider
  54.      * @ORM\ManyToOne(targetEntity="ShippingProvider")
  55.      * @ORM\JoinColumn(referencedColumnName="id", nullable=true)
  56.      * @Ignore()
  57.      */
  58.     private $shippingProvider;
  59.     /**
  60.      * @var EndUser $endUser
  61.      * @ORM\ManyToOne(targetEntity="EndUser", inversedBy="orders", fetch="EAGER", cascade={"persist"})
  62.      */
  63.     private $endUser;
  64.     /**
  65.      * @var string $shippingStatus
  66.      * @ORM\Column(type="string")
  67.      */
  68.     private $shippingStatus;
  69.     /**
  70.      * @var string $paymentStatus
  71.      * @ORM\Column(type="string")
  72.      */
  73.     private $paymentStatus;
  74.     /**
  75.      * @var $totalPrice float
  76.      * @ORM\Column(type="decimal", precision=10, scale=2)
  77.      */
  78.     private $totalPrice;
  79.     /**
  80.      * @var $saleSupplyId string
  81.      * @ORM\Column(type="string", nullable=true)
  82.      * @Ignore()
  83.      */
  84.     private $saleSupplyId;
  85.     /**
  86.      * @ORM\Column(type="string", nullable=true)
  87.      * @Ignore()
  88.      */
  89.     private $saleSupplyMainStatus;
  90.     /**
  91.      * @ORM\Column(type="string", nullable=true)
  92.      * @Ignore()
  93.      */
  94.     private $saleSupplyShipmentStatus;
  95.     /**
  96.      * @ORM\Column(type="string", nullable=true)
  97.      * @Ignore()
  98.      */
  99.     private $saleSupplyTrackingCode;
  100.     /**
  101.      * @ORM\Column(type="string", nullable=true)
  102.      * @Ignore()
  103.      */
  104.     private $saleSupplyCarrierName;
  105.     /**
  106.      * @var boolean $termsAndConditions
  107.      * @Assert\IsTrue(message="You have to accept T&C's")
  108.      * @ORM\Column(type="boolean", nullable=true)
  109.      */
  110.     private $termsAndConditions;
  111.     /**
  112.      * @var $paymentId string
  113.      * @ORM\Column(type="string", nullable=true)
  114.      */
  115.     private $paymentId;
  116.     /**
  117.      * @var \DateTime $createdAt
  118.      * @ORM\Column(type="datetime")
  119.      */
  120.     private $createdAt;
  121.     /**
  122.      * @var \DateTime $updatedAt
  123.      * @ORM\Column(type="datetime")
  124.      */
  125.     private $updatedAt;
  126.     /**
  127.      * @var $status string
  128.      * @ORM\Column(type="string", nullable=true)
  129.      */
  130.     private $status;
  131.     /**
  132.      * @var $paymentMethod string
  133.      * @ORM\Column(type="string", nullable=true)
  134.      */
  135.     private $paymentMethod;
  136.     /**
  137.      * @var $products OrderProduct[]
  138.      * @ORM\OneToMany(targetEntity="OrderProduct",  mappedBy="order",  cascade={"persist"})
  139.      */
  140.     private $products;
  141.     /**
  142.      * @var EndUserVoucher[] $vouchers
  143.      * @ORM\OneToMany(targetEntity="EndUserVoucher",  mappedBy="order", fetch="EAGER" ,cascade={"persist", "remove"})
  144.      */
  145.     private $vouchers;
  146.     /**
  147.      * @var $refunds OrderRefund[]
  148.      * @ORM\OneToMany(targetEntity="OrderRefund", mappedBy="order", cascade={"persist"})
  149.      */
  150.     private $refunds;
  151.     /**
  152.      * @var
  153.      * @ORM\Column(type="array")
  154.      * @Ignore()
  155.      */
  156.     private $userSnapshot;
  157.     /**
  158.      * @var \DateTime
  159.      * @ORM\Column(type="datetime", nullable=true)
  160.      */
  161.     private $paidAt;
  162.     /**
  163.      * @var
  164.      * @ORM\Column(type="decimal", precision=10, scale=2, nullable=false, options={"default" : 0})
  165.      */
  166.     private $shippingCost 0;
  167.     /**
  168.      * @var Domain $domain
  169.      * @ORM\ManyToOne(targetEntity="Domain")
  170.      * @Ignore()
  171.      */
  172.     private $domain;
  173.     /**
  174.      * @Ignore()
  175.      */
  176.     private $upsells;
  177.     /**
  178.      * @var $amountVat float
  179.      * @ORM\Column(type="decimal", scale=2, nullable=true)
  180.      */
  181.     private $amountVat 0;
  182.     /**
  183.      * @var
  184.      * @ORM\Column(type="string", nullable=false)
  185.      */
  186.     private $currency;
  187.     /**
  188.      * @var DomainVat $domainVat
  189.      * @ORM\ManyToOne(targetEntity="DomainVat")
  190.      * @Ignore()
  191.      */
  192.     private $domainVat;
  193.     /**
  194.      * @var
  195.      * @ORM\Column(type="decimal", precision=10, scale=2, options={"default" : 0})
  196.      */
  197.     private $chargePsp =  0;
  198.     /**
  199.      * @var
  200.      * @ORM\Column(type="decimal", precision=10, scale=2, options={"default" : 0})
  201.      */
  202.     private $chargeShipping 0;
  203.     /**
  204.      * @var $country Country
  205.      * @ORM\ManyToOne(targetEntity="Country")
  206.      * @Ignore()
  207.      */
  208.     private $country;
  209.     /**
  210.      * @var $tracker mixed
  211.      * @ORM\ManyToOne(targetEntity="Tracker", fetch="EAGER")
  212.      * @ORM\JoinColumn(referencedColumnName="id", nullable=true)
  213.      * @Ignore()
  214.      */
  215.     private $tracker;
  216.     /**
  217.      * @var
  218.      * @ORM\Column(type="array", nullable=true)
  219.      * @Ignore()
  220.      */
  221.     private $trackingParams;
  222.     /**
  223.      * @var \DateTime $postbackUrlDate
  224.      * @ORM\Column(type="datetime", nullable=true)
  225.      */
  226.     private $postbackUrlDate;
  227.     /**
  228.      * @var $trackingCommission float
  229.      * @ORM\Column(type="decimal", precision=10, scale=2, options={"default" : 0})
  230.      */
  231.     private $trackingCommission 0;
  232.     /**
  233.      * @var $totalPriceEx float
  234.      * @ORM\Column(type="decimal", precision=10, scale=2)
  235.      */
  236.     private $totalPriceEx 0;
  237.     /**
  238.      * @var string $text
  239.      * @ORM\Column(type="text", nullable=true)
  240.      */
  241.     private $comment;
  242.     /**
  243.      * @var string $orderNumber
  244.      * @ORM\Column(type="string", nullable=true)
  245.      */
  246.     private $orderNumber;
  247.     /**
  248.      * @var int $id
  249.      * @ORM\Column(type="integer", nullable=true)
  250.      */
  251.     private $countByUser;
  252.     /**
  253.      * @var
  254.      * @ORM\Column(type="decimal", precision=10, scale=2, options={"default" : 0})
  255.      */
  256.     private $chargePickAndPack 0;
  257.     /**
  258.      * @ORM\Column(type="string", nullable=true)
  259.      * @Ignore()
  260.      */
  261.     private $saleSupplyTrackingUrl;
  262.     /**
  263.      * @ORM\OneToMany(targetEntity="Order", mappedBy="parent")
  264.      * @Ignore()
  265.      */
  266.     protected $postOrders;
  267.     /**
  268.      * @ORM\ManyToOne(targetEntity="Order", inversedBy="postOrders")
  269.      * @ORM\JoinColumn(name="parent_id", referencedColumnName="id")
  270.      * @Ignore()
  271.      */
  272.     protected $parent;
  273.     /**
  274.      * @var $eventId string
  275.      * @ORM\Column(type="string", nullable=true)
  276.      */
  277.     private $eventId;
  278.     /**
  279.      * @var
  280.      * @ORM\Column(type="array", nullable=true)
  281.      * @Ignore()
  282.      */
  283.     private $eventAdditionalParams;
  284.     /**
  285.      * @var $totalPriceToEUR float
  286.      * @ORM\Column(type="decimal", precision=10, scale=2, nullable=false, options={"after": "totalPrice", "default" : 0})
  287.      */
  288.     private $totalPriceToEUR 0;
  289.     /**
  290.      * @var $totalPriceExToEUR float
  291.      * @ORM\Column(type="decimal", precision=10, scale=2, nullable=false, options={"after": "total_price_ex", "default" : 0})
  292.      */
  293.     private $totalPriceExToEUR 0;
  294.     /**
  295.      * @var
  296.      * @ORM\Column(type="decimal", precision=10, scale=2, nullable=false, options={"after": "shipping_cost","default" : 0})
  297.      */
  298.     private $shippingCostToEUR 0;
  299.     /**
  300.      * @ORM\Column(type="string", nullable=true)
  301.      */
  302.     private $type;
  303.     /**
  304.      * @Ignore()
  305.      */
  306.     private $subscriptionId;
  307.     /**
  308.      * @ORM\OneToOne(targetEntity="App\Entity\OrderSubscription", mappedBy="order", fetch="EAGER")
  309.      * @Ignore()
  310.      */
  311.     private $orderSubscription;
  312.     /**
  313.      * @ORM\OneToOne(targetEntity="App\Entity\OrderHolder", mappedBy="order")
  314.      * @Ignore()
  315.      */
  316.     private $orderHolder;
  317.     /**
  318.      * @var $productCost float
  319.      * @ORM\Column(type="decimal", precision=10, scale=2, options={"default" : 0})
  320.      */
  321.     private $productCost 0;
  322.     /**
  323.      * @var $productCostToEUR float
  324.      * @ORM\Column(type="decimal", precision=10, scale=2, options={"default" : 0})
  325.      */
  326.     private $productCostToEUR 0;
  327.     /**
  328.      * @var $returnCost float
  329.      * @ORM\Column(type="decimal", precision=10, scale=2, options={"default" : 0})
  330.      */
  331.     private $returnCost 0;
  332.     /**
  333.      * @var $returnCostToEUR float
  334.      * @ORM\Column(type="decimal", precision=10, scale=2, options={"default" : 0})
  335.      */
  336.     private $returnCostToEUR 0;
  337.     /**
  338.      * @var Product $firstProduct
  339.      * @ORM\ManyToOne(targetEntity="Product", inversedBy="orders")
  340.      * @Ignore()
  341.      */
  342.     private $firstProduct;
  343.     /**
  344.      * @var $warehouse Warehouse
  345.      * @ORM\ManyToOne(targetEntity="Warehouse")
  346.      * @ORM\JoinColumn(name="warehouse_id", referencedColumnName="id", nullable=true)
  347.      * @Ignore()
  348.      */
  349.     private $warehouse;
  350.     /**
  351.      * @ORM\OneToOne(targetEntity="OrderWarehouseDetail", mappedBy="order", fetch="EAGER", cascade={"persist", "remove"})
  352.      */
  353.     private $orderWarehouseDetail;
  354.     /**
  355.      * @ORM\OneToOne(targetEntity="OrderCalculatedData", mappedBy="order", fetch="EAGER", cascade={"persist", "remove"})
  356.      */
  357.     private $orderCalculatedData;
  358.     private $paymentUrl;
  359.     /**
  360.      * @var boolean $isVoucher
  361.      * @ORM\Column(type="boolean", options={"default":0})
  362.      */
  363.     private $isVoucher 0;
  364.     /**
  365.      * @var boolean $isFirstOrder
  366.      * @ORM\Column(type="boolean", options={"default":0})
  367.      */
  368.     private $isFirstOrder 0;
  369.     /**
  370.      * @return null|Warehouse
  371.      */
  372.     public function getWarehouse(): ?Warehouse
  373.     {
  374.         return $this->warehouse;
  375.     }
  376.     /**
  377.      * @param Warehouse $warehouse
  378.      * @return self
  379.      */
  380.     public function setWarehouse(Warehouse $warehouse): self
  381.     {
  382.         $this->warehouse $warehouse;
  383.         return $this;
  384.     }
  385.     /**
  386.      * @ORM\Column(type="string", nullable=true)
  387.      */
  388.     private $ip;
  389.     /**
  390.      * @var $funnel mixed
  391.      * @ORM\ManyToOne(targetEntity="Funnel", fetch="EAGER")
  392.      * @ORM\JoinColumn(referencedColumnName="id", nullable=true)
  393.      * @Ignore()
  394.      */
  395.     private $funnel;
  396.     public function __construct()
  397.     {
  398.         $this->products = new ArrayCollection();
  399.         $this->refunds = new ArrayCollection();
  400.         $this->postOrders = new ArrayCollection();
  401.         $this->vouchers = new ArrayCollection();
  402.     }
  403.     /**
  404.      * @return int
  405.      */
  406.     public function getId(): ?int
  407.     {
  408.         return $this->id;
  409.     }
  410.     /**
  411.      * @return PaymentProvider
  412.      */
  413.     public function getPaymentProvider(): ?PaymentProvider
  414.     {
  415.         return $this->paymentProvider;
  416.     }
  417.     /**
  418.      * @param PaymentProvider|null $paymentProvider
  419.      * @return self
  420.      */
  421.     public function setPaymentProvider(?PaymentProvider $paymentProvider): self
  422.     {
  423.         $this->paymentProvider $paymentProvider;
  424.         return $this;
  425.     }
  426.     /**
  427.      * @return ShippingProvider
  428.      */
  429.     public function getShippingProvider(): ?ShippingProvider
  430.     {
  431.         return $this->shippingProvider;
  432.     }
  433.     /**
  434.      * @param ShippingProvider $shippingProvider
  435.      * @return self
  436.      */
  437.     public function setShippingProvider(?ShippingProvider $shippingProvider): self
  438.     {
  439.         $this->shippingProvider $shippingProvider;
  440.         return $this;
  441.     }
  442.     /**
  443.      * @return EndUser
  444.      */
  445.     public function getEndUser(): ?EndUser
  446.     {
  447.         return $this->endUser;
  448.     }
  449.     /**
  450.      * @param EndUser $endUser
  451.      * @return self
  452.      */
  453.     public function setEndUser(EndUser $endUser): self
  454.     {
  455.         $this->endUser $endUser;
  456.         return $this;
  457.     }
  458.     /**
  459.      * @return string
  460.      */
  461.     public function getShippingStatus(): string
  462.     {
  463.         return $this->shippingStatus;
  464.     }
  465.     /**
  466.      * @param string $shippingStatus
  467.      * @return self
  468.      */
  469.     public function setShippingStatus(string $shippingStatus): self
  470.     {
  471.         $this->shippingStatus $shippingStatus;
  472.         return $this;
  473.     }
  474.     /**
  475.      * @return string
  476.      */
  477.     public function getPaymentStatus(): string
  478.     {
  479.         return $this->paymentStatus;
  480.     }
  481.     /**
  482.      * @param string $paymentStatus
  483.      * @return self
  484.      */
  485.     public function setPaymentStatus(string $paymentStatus): self
  486.     {
  487.         $this->paymentStatus $paymentStatus;
  488.         return $this;
  489.     }
  490.     /**
  491.      * @return float
  492.      */
  493.     public function getTotalPrice(): ?float
  494.     {
  495.         return $this->totalPrice;
  496.     }
  497.     /**
  498.      * @param float $totalPrice
  499.      * @return self
  500.      */
  501.     public function setTotalPrice(float $totalPrice): self
  502.     {
  503.         $this->totalPrice $totalPrice;
  504.         return $this;
  505.     }
  506.     /**
  507.      * @return string
  508.      */
  509.     public function getSaleSupplyId(): ?string
  510.     {
  511.         return $this->saleSupplyId;
  512.     }
  513.     /**
  514.      * @param string $saleSupplyId
  515.      * @return self
  516.      */
  517.     public function setSaleSupplyId(string $saleSupplyId): self
  518.     {
  519.         $this->saleSupplyId $saleSupplyId;
  520.         return $this;
  521.     }
  522.     /**
  523.      * @return mixed
  524.      */
  525.     public function getSaleSupplyMainStatus()
  526.     {
  527.         return $this->saleSupplyMainStatus;
  528.     }
  529.     /**
  530.      * @param mixed $saleSupplyMainStatus
  531.      * @return self
  532.      */
  533.     public function setSaleSupplyMainStatus($saleSupplyMainStatus): self
  534.     {
  535.         $this->saleSupplyMainStatus $saleSupplyMainStatus;
  536.         return $this;
  537.     }
  538.     /**
  539.      * @return mixed
  540.      */
  541.     public function getSaleSupplyShipmentStatus()
  542.     {
  543.         return $this->saleSupplyShipmentStatus;
  544.     }
  545.     /**
  546.      * @param mixed $saleSupplyShipmentStatus
  547.      * @return self
  548.      */
  549.     public function setSaleSupplyShipmentStatus($saleSupplyShipmentStatus): self
  550.     {
  551.         $this->saleSupplyShipmentStatus $saleSupplyShipmentStatus;
  552.         return $this;
  553.     }
  554.     /**
  555.      * @return mixed
  556.      */
  557.     public function getSaleSupplyTrackingCode()
  558.     {
  559.         return $this->saleSupplyTrackingCode;
  560.     }
  561.     /**
  562.      * @param mixed $saleSupplyTrackingCode
  563.      * @return self
  564.      */
  565.     public function setSaleSupplyTrackingCode($saleSupplyTrackingCode): self
  566.     {
  567.         $this->saleSupplyTrackingCode $saleSupplyTrackingCode;
  568.         return $this;
  569.     }
  570.     /**
  571.      * @return string
  572.      */
  573.     public function getPaymentId(): ?string
  574.     {
  575.         return $this->paymentId;
  576.     }
  577.     /**
  578.      * @param string $paymentId
  579.      * @return self
  580.      */
  581.     public function setPaymentId(string $paymentId): self
  582.     {
  583.         $this->paymentId $paymentId;
  584.         return $this;
  585.     }
  586.     /**
  587.      * @return string
  588.      */
  589.     public function getPaymentUrl(): ?string
  590.     {
  591.         return $this->paymentUrl;
  592.     }
  593.     /**
  594.      * @param string|null $paymentUrl
  595.      * @return self
  596.      */
  597.     public function setPaymentUrl(?string $paymentUrl): self
  598.     {
  599.         $this->paymentUrl $paymentUrl;
  600.         return $this;
  601.     }
  602.     /**
  603.      * @return string
  604.      */
  605.     public function getStatus(): ?string
  606.     {
  607.         return $this->status;
  608.     }
  609.     /**
  610.      * @param string $status
  611.      * @return self
  612.      */
  613.     public function setStatus(string $status): self
  614.     {
  615.         $this->status $status;
  616.         return $this;
  617.     }
  618.     /**
  619.      * @return bool
  620.      */
  621.     public function isTermsAndConditions(): bool
  622.     {
  623.         return $this->termsAndConditions;
  624.     }
  625.     /**
  626.      * @param bool $termsAndConditions
  627.      */
  628.     public function setTermsAndConditions(bool $termsAndConditions): self
  629.     {
  630.         $this->termsAndConditions $termsAndConditions;
  631.         return $this;
  632.     }
  633.     /**
  634.      * @return OrderProduct[]
  635.      */
  636.     public function getProducts()
  637.     {
  638.         return $this->products;
  639.     }
  640.     /**
  641.      * @return self
  642.      */
  643.     public function resetProducts(): self
  644.     {
  645.         $this->products = new ArrayCollection();
  646.         return $this;
  647.     }
  648.     /**
  649.      * @param OrderProduct[] $products
  650.      * @return self
  651.      */
  652.     public function addOrderProduct(OrderProduct $orderProduct): self
  653.     {
  654.         if (!$this->products->contains($orderProduct)) {
  655.             $this->products[] = $orderProduct;
  656.             $orderProduct->setOrder($this);
  657.         }
  658.         return $this;
  659.     }
  660.     /**
  661.      * @param OrderProduct[] $products
  662.      * @return self
  663.      */
  664.     public function removeOrderProduct(OrderProduct $orderProduct): self
  665.     {
  666.         if ($this->products->contains($orderProduct)) {
  667.             $this->products->removeElement($orderProduct);
  668. //            if ($orderProduct->getOrder() === $this) {
  669. //                $orderProduct->setOrder(null);
  670. //            }
  671.         }
  672.         return $this;
  673.     }
  674.     public function setProducts($products): self
  675.     {
  676.         $this->products $products;
  677.         return $this;
  678.     }
  679.     public function getVouchers()
  680.     {
  681.         return $this->vouchers;
  682.     }
  683.     /**
  684.      * @return \DateTime
  685.      */
  686.     public function getCreatedAt(): \DateTime
  687.     {
  688.         return $this->createdAt;
  689.     }
  690.     /**
  691.      * @param \DateTime $createdAt
  692.      * @return self
  693.      */
  694.     public function setCreatedAt(\DateTime $createdAt): self
  695.     {
  696.         $this->createdAt $createdAt;
  697.         return $this;
  698.     }
  699.     /**
  700.      * @return \DateTime
  701.      */
  702.     public function getUpdatedAt(): \DateTime
  703.     {
  704.         return $this->updatedAt;
  705.     }
  706.     /**
  707.      * @param \DateTime $updatedAt
  708.      * @return self
  709.      */
  710.     public function setUpdatedAt(\DateTime $updatedAt): self
  711.     {
  712.         $this->updatedAt $updatedAt;
  713.         return $this;
  714.     }
  715.     /**
  716.      * @ORM\PrePersist()
  717.      */
  718.     public function prePersist()
  719.     {
  720.         $orderProduct $this->products->first();
  721.         $this->firstProduct $orderProduct $orderProduct->getProduct() : null;
  722.         $this->orderWarehouseDetail = new OrderWarehouseDetail();
  723.         $this->orderWarehouseDetail->setOrder($this);
  724.         $this->createdAt = new \DateTime('now', new \DateTimeZone(self::TZ));
  725.         $this->updatedAt = new \DateTime('now', new \DateTimeZone(self::TZ));
  726.     }
  727.     /**
  728.      * @return void
  729.      * @ORM\PreUpdate()
  730.      */
  731.     public function preUpdate()
  732.     {
  733.         $this->updatedAt = new \DateTime('now', new \DateTimeZone(self::TZ));
  734.     }
  735.     /**
  736.      * @return mixed
  737.      */
  738.     public function getUpsells()
  739.     {
  740.         return $this->upsells;
  741.     }
  742.     /**
  743.      * @param mixed $upsells
  744.      * @return self
  745.      */
  746.     public function setUpsells($upsells): self
  747.     {
  748.         $this->upsells $upsells;
  749.         return $this;
  750.     }
  751.     /**
  752.      * @return string
  753.      */
  754.     public function getPaymentMethod()
  755.     {
  756.         return $this->paymentMethod;
  757.     }
  758.     /**
  759.      * @param mixed $paymentMethod
  760.      */
  761.     public function setPaymentMethod($paymentMethod): self
  762.     {
  763.         $this->paymentMethod $paymentMethod;
  764.         return $this;
  765.     }
  766.     /**
  767.      * @return \DateTime
  768.      */
  769.     public function getPaidAt(): ?\DateTime
  770.     {
  771.         return $this->paidAt;
  772.     }
  773.     /**
  774.      * @param \DateTime $paidAt
  775.      */
  776.     public function setPaidAt(?\DateTime $paidAt): self
  777.     {
  778.         $this->paidAt $paidAt;
  779.         return $this;
  780.     }
  781.     /**
  782.      * @return mixed
  783.      */
  784.     public function getUserSnapshot()
  785.     {
  786.         return $this->userSnapshot;
  787.     }
  788.     /**
  789.      * @param mixed $userSnapshot
  790.      */
  791.     public function setUserSnapshot($userSnapshot): self
  792.     {
  793.         $this->userSnapshot $userSnapshot;
  794.         return $this;
  795.     }
  796.     /**
  797.      * @return DomainVat
  798.      */
  799.     public function getDomainVat()
  800.     {
  801.         return $this->domainVat;
  802.     }
  803.     /**
  804.      * @param mixed $domainVat
  805.      */
  806.     public function setDomainVat($domainVat): self
  807.     {
  808.         $this->domainVat $domainVat;
  809.         return $this;
  810.     }
  811.     /**
  812.      * @return float
  813.      */
  814.     public function getAmountVat(): ?float
  815.     {
  816.         return $this->amountVat;
  817.     }
  818.     /**
  819.      * @param float $amountVat
  820.      * @return self
  821.      */
  822.     public function setAmountVat($amountVat): self
  823.     {
  824.         $this->amountVat $amountVat;
  825.         return $this;
  826.     }
  827.     /**
  828.      * @return mixed
  829.      */
  830.     public function getShippingCost()
  831.     {
  832.         return $this->shippingCost;
  833.     }
  834.     /**
  835.      * @param mixed $shippingCost
  836.      */
  837.     public function setShippingCost($shippingCost): self
  838.     {
  839.         $this->shippingCost $shippingCost;
  840.         return $this;
  841.     }
  842.     /**
  843.      * @return mixed
  844.      */
  845.     public function getCurrency()
  846.     {
  847.         return $this->currency;
  848.     }
  849.     /**
  850.      * @param mixed $currency
  851.      * @return self
  852.      */
  853.     public function setCurrency($currency): self
  854.     {
  855.         $this->currency $currency;
  856.         return $this;
  857.     }
  858.     /**
  859.      * @return Country
  860.      */
  861.     public function getCountry(): ?Country
  862.     {
  863.         return $this->country;
  864.     }
  865.     /**
  866.      * @param Country|null $country
  867.      * @return self
  868.      */
  869.     public function setCountry(?Country $country): self
  870.     {
  871.         $this->country $country;
  872.         return $this;
  873.     }
  874.     /**
  875.      * @return mixed
  876.      */
  877.     public function getChargePsp()
  878.     {
  879.         return $this->chargePsp;
  880.     }
  881.     /**
  882.      * @param mixed $chargePsp
  883.      * @return self
  884.      */
  885.     public function setChargePsp($chargePsp): self
  886.     {
  887.         $this->chargePsp $chargePsp;
  888.         return $this;
  889.     }
  890.     /**
  891.      * @return mixed
  892.      */
  893.     public function getChargeShipping()
  894.     {
  895.         return $this->chargeShipping;
  896.     }
  897.     /**
  898.      * @param mixed $chargeShipping
  899.      * @return self
  900.      */
  901.     public function setChargeShipping($chargeShipping): self
  902.     {
  903.         $this->chargeShipping $chargeShipping;
  904.         return $this;
  905.     }
  906.     /**
  907.      * @return mixed
  908.      */
  909.     public function getTracker(): ?Tracker
  910.     {
  911.         return $this->tracker;
  912.     }
  913.     /**
  914.      * @param mixed $tracker
  915.      * @return self
  916.      */
  917.     public function setTracker(?Tracker $tracker): self
  918.     {
  919.         $this->tracker $tracker;
  920.         return $this;
  921.     }
  922.     /**
  923.      * @return mixed
  924.      */
  925.     public function getTrackingParams()
  926.     {
  927.         return $this->trackingParams;
  928.     }
  929.     /**
  930.      * @param mixed $trackingParams
  931.      */
  932.     public function setTrackingParams($trackingParams): self
  933.     {
  934.         $this->trackingParams $trackingParams;
  935.         return $this;
  936.     }
  937.     /**
  938.      * @return mixed
  939.      */
  940.     public function getPostbackUrlDate(): ?\DateTime
  941.     {
  942.         return $this->postbackUrlDate;
  943.     }
  944.     /**
  945.      * @param mixed $postbackUrlDate
  946.      * @return self
  947.      */
  948.     public function setPostbackUrlDate(?\DateTime $postbackUrlDate): self
  949.     {
  950.         $this->postbackUrlDate $postbackUrlDate;
  951.         return $this;
  952.     }
  953.     /**
  954.      * @return mixed
  955.      */
  956.     public function getDomain(): ?Domain
  957.     {
  958.         return $this->domain;
  959.     }
  960.     /**
  961.      * @param mixed $domain
  962.      * @return self
  963.      */
  964.     public function setDomain($domain): self
  965.     {
  966.         $this->domain $domain;
  967.         return $this;
  968.     }
  969.     /**
  970.      * @return mixed
  971.      */
  972.     public function getTrackingCommission(): ?float
  973.     {
  974.         return $this->trackingCommission;
  975.     }
  976.     /**
  977.      * @param float $trackingCommission
  978.      * @return self
  979.      */
  980.     public function setTrackingCommission(float $trackingCommission): self
  981.     {
  982.         $this->trackingCommission $trackingCommission;
  983.         return $this;
  984.     }
  985.     /**
  986.      * @return mixed
  987.      */
  988.     public function getSaleSupplyCarrierName()
  989.     {
  990.         return $this->saleSupplyCarrierName;
  991.     }
  992.     /**
  993.      * @param mixed $saleSupplyCarrierName
  994.      * @return self
  995.      */
  996.     public function setSaleSupplyCarrierName($saleSupplyCarrierName): self
  997.     {
  998.         $this->saleSupplyCarrierName $saleSupplyCarrierName;
  999.         return $this;
  1000.     }
  1001.     /**
  1002.      * @return string
  1003.      */
  1004.     public function getComment(): ?string
  1005.     {
  1006.         return $this->comment;
  1007.     }
  1008.     /**
  1009.      * @param mixed $comment
  1010.      * @return self
  1011.      */
  1012.     public function setComment(?string $comment): self
  1013.     {
  1014.         $this->comment $comment;
  1015.         return $this;
  1016.     }
  1017.     /**
  1018.      * @return float
  1019.      */
  1020.     public function getTotalPriceEx(): float
  1021.     {
  1022.         return $this->totalPriceEx;
  1023.     }
  1024.     /**
  1025.      * @param float $totalPriceEx
  1026.      * @return self
  1027.      */
  1028.     public function setTotalPriceEx(float $totalPriceEx): self
  1029.     {
  1030.         $this->totalPriceEx $totalPriceEx;
  1031.         return $this;
  1032.     }
  1033.     /**
  1034.      * @return mixed
  1035.      */
  1036.     public function getRefunds()
  1037.     {
  1038.         return $this->refunds;
  1039.     }
  1040.     public function addRefund(OrderRefund $orderRefund)
  1041.     {
  1042.         if (!$this->refunds->contains($orderRefund)) {
  1043.             $this->refunds[] = $orderRefund;
  1044.             $orderRefund->setOrder($this);
  1045.         }
  1046.         return $this;
  1047.     }
  1048.     /**
  1049.      * @return mixed
  1050.      */
  1051.     public function getOrderNumber(): ?string
  1052.     {
  1053.         return $this->orderNumber;
  1054.     }
  1055.     /**
  1056.      * @param null|string $orderNumber
  1057.      * @return self
  1058.      */
  1059.     public function setOrderNumber(?string $orderNumber): self
  1060.     {
  1061.         $this->orderNumber $orderNumber;
  1062.         return $this;
  1063.     }
  1064.     /**
  1065.      * @return null|int
  1066.      */
  1067.     public function getCountByUser(): ?int
  1068.     {
  1069.         return $this->countByUser;
  1070.     }
  1071.     /**
  1072.      * @param null|int $countByUser
  1073.      * @return self
  1074.      */
  1075.     public function setCountByUser(?int $countByUser): self
  1076.     {
  1077.         $this->countByUser $countByUser;
  1078.         return $this;
  1079.     }
  1080.     /**
  1081.      * @return mixed
  1082.      */
  1083.     public function getChargePickAndPack()
  1084.     {
  1085.         return $this->chargePickAndPack;
  1086.     }
  1087.     /**
  1088.      * @param mixed $chargePickAndPack
  1089.      * @return self
  1090.      */
  1091.     public function setChargePickAndPack($chargePickAndPack): self
  1092.     {
  1093.         $this->chargePickAndPack $chargePickAndPack;
  1094.         return $this;
  1095.     }
  1096.     /**
  1097.      * @return mixed
  1098.      */
  1099.     public function getSaleSupplyTrackingUrl()
  1100.     {
  1101.         return $this->saleSupplyTrackingUrl;
  1102.     }
  1103.     /**
  1104.      * @param mixed $saleSupplyTrackingUrl
  1105.      * @return self
  1106.      */
  1107.     public function setSaleSupplyTrackingUrl($saleSupplyTrackingUrl): self
  1108.     {
  1109.         $this->saleSupplyTrackingUrl $saleSupplyTrackingUrl;
  1110.         return $this;
  1111.     }
  1112.     /**
  1113.      * @return Order|null
  1114.      */
  1115.     public function getParent(): ?Order
  1116.     {
  1117.         return $this->parent;
  1118.     }
  1119.     /**
  1120.      * @param Order|null $parent
  1121.      * @return self
  1122.      */
  1123.     public function setParent(?Order $parent): self
  1124.     {
  1125.         $this->parent $parent;
  1126.         return $this;
  1127.     }
  1128.     /**
  1129.      * @return mixed
  1130.      */
  1131.     public function getPostOrders()
  1132.     {
  1133.         return $this->postOrders;
  1134.     }
  1135.     /**
  1136.      * @return string|null
  1137.      */
  1138.     public function getEventId(): ?string
  1139.     {
  1140.         return $this->eventId;
  1141.     }
  1142.     /**
  1143.      * @param string|null $eventId
  1144.      * @return self
  1145.      */
  1146.     public function setEventId(?string $eventId): self
  1147.     {
  1148.         $this->eventId $eventId;
  1149.         return $this;
  1150.     }
  1151.     /**
  1152.      * @return mixed
  1153.      */
  1154.     public function getEventAdditionalParams()
  1155.     {
  1156.         return $this->eventAdditionalParams;
  1157.     }
  1158.     /**
  1159.      * @param mixed $eventAdditionalParams
  1160.      */
  1161.     public function setEventAdditionalParams($eventAdditionalParams): self
  1162.     {
  1163.         $this->eventAdditionalParams $eventAdditionalParams;
  1164.         return $this;
  1165.     }
  1166.     /**
  1167.      * @return float
  1168.      */
  1169.     public function getTotalPriceToEUR(): float
  1170.     {
  1171.         return $this->totalPriceToEUR;
  1172.     }
  1173.     /**
  1174.      * @param float $totalPriceToEUR
  1175.      * @return self
  1176.      */
  1177.     public function setTotalPriceToEUR(float $totalPriceToEUR): self
  1178.     {
  1179.         $this->totalPriceToEUR $totalPriceToEUR;
  1180.         return $this;
  1181.     }
  1182.     /**
  1183.      * @return float
  1184.      */
  1185.     public function getTotalPriceExToEUR(): float
  1186.     {
  1187.         return $this->totalPriceExToEUR;
  1188.     }
  1189.     /**
  1190.      * @param float $totalPriceExToEUR
  1191.      * @return self
  1192.      */
  1193.     public function setTotalPriceExToEUR(float $totalPriceExToEUR): self
  1194.     {
  1195.         $this->totalPriceExToEUR $totalPriceExToEUR;
  1196.         return $this;
  1197.     }
  1198.     /**
  1199.      * @return mixed
  1200.      */
  1201.     public function getShippingCostToEUR()
  1202.     {
  1203.         return $this->shippingCostToEUR;
  1204.     }
  1205.     /**
  1206.      * @param mixed $shippingCostToEUR
  1207.      */
  1208.     public function setShippingCostToEUR($shippingCostToEUR): self
  1209.     {
  1210.         $this->shippingCostToEUR $shippingCostToEUR;
  1211.         return $this;
  1212.     }
  1213.     /**
  1214.      * @return mixed
  1215.      */
  1216.     public function getType()
  1217.     {
  1218.         return $this->type;
  1219.     }
  1220.     /**
  1221.      * @param mixed $type
  1222.      * @return self
  1223.      */
  1224.     public function setType($type): self
  1225.     {
  1226.         $this->type $type;
  1227.         return $this;
  1228.     }
  1229.     /**
  1230.      * @return mixed
  1231.      */
  1232.     public function getSubscriptionId()
  1233.     {
  1234.         return $this->subscriptionId;
  1235.     }
  1236.     /**
  1237.      * @param mixed $subscriptionId
  1238.      * @return self
  1239.      */
  1240.     public function setSubscriptionId($subscriptionId): self
  1241.     {
  1242.         $this->subscriptionId $subscriptionId;
  1243.         return $this;
  1244.     }
  1245.     public function getOrderSubscription(): ?OrderSubscription
  1246.     {
  1247.         return $this->orderSubscription;
  1248.     }
  1249.     /**
  1250.      * @param OrderSubscription|null $orderSubscription
  1251.      * @return self
  1252.      */
  1253.     public function setOrderSubscription(?OrderSubscription $orderSubscription): self
  1254.     {
  1255.         $this->orderSubscription $orderSubscription;
  1256.         return $this;
  1257.     }
  1258.     public function __clone()
  1259.     {
  1260.         $this->id null;
  1261.         $this->saleSupplyId null;
  1262.         $this->saleSupplyCarrierName null;
  1263.         $this->saleSupplyMainStatus null;
  1264.         $this->saleSupplyShipmentStatus null;
  1265.         $this->saleSupplyTrackingCode null;
  1266.         $this->saleSupplyTrackingUrl null;
  1267.         $this->totalPrice 0;
  1268.         $this->paymentId null;
  1269.         $this->userSnapshot null;
  1270.         $this->amountVat 0;
  1271.         $this->chargePsp 0;
  1272.         $this->chargeShipping 0;
  1273.         $this->trackingParams null;
  1274.         $this->tracker null;
  1275.         $this->postbackUrlDate null;
  1276.         $this->trackingCommission 0;
  1277.         $this->comment null;
  1278.         $this->totalPriceEx 0;
  1279.         $this->countByUser null;
  1280.         $this->chargePickAndPack 0;
  1281.         $this->parent null;
  1282.         $this->eventAdditionalParams null;
  1283.         $this->refunds = new ArrayCollection();
  1284.         $this->postOrders = new ArrayCollection();
  1285.         $this->shippingStatus null;
  1286.         $this->paymentStatus null;
  1287.         $this->paidAt null;
  1288.         $this->warehouse null;
  1289.     }
  1290.     /**
  1291.      * @return null|OrderHolder
  1292.      */
  1293.     public function getOrderHolder(): ?OrderHolder
  1294.     {
  1295.         return $this->orderHolder;
  1296.     }
  1297.     /**
  1298.      * @param OrderHolder|null $orderHolder
  1299.      * @return self
  1300.      */
  1301.     public function setOrderHolder(?OrderHolder $orderHolder): self
  1302.     {
  1303.         $this->orderHolder $orderHolder;
  1304.         return $this;
  1305.     }
  1306.     /**
  1307.      * @return float
  1308.      */
  1309.     public function getProductCost(): float
  1310.     {
  1311.         return $this->productCost;
  1312.     }
  1313.     /**
  1314.      * @param float $productCost
  1315.      * @return self
  1316.      */
  1317.     public function setProductCost(float $productCost): self
  1318.     {
  1319.         $this->productCost $productCost;
  1320.         return $this;
  1321.     }
  1322.     /**
  1323.      * @return float
  1324.      */
  1325.     public function getProductCostToEUR(): float
  1326.     {
  1327.         return $this->productCostToEUR;
  1328.     }
  1329.     /**
  1330.      * @param float $productCostToEUR
  1331.      * @return self
  1332.      */
  1333.     public function setProductCostToEUR(float $productCostToEUR): self
  1334.     {
  1335.         $this->productCostToEUR $productCostToEUR;
  1336.         return $this;
  1337.     }
  1338.     /**
  1339.      * @return float
  1340.      */
  1341.     public function getReturnCost(): float
  1342.     {
  1343.         return $this->returnCost;
  1344.     }
  1345.     /**
  1346.      * @param float $returnCost
  1347.      * @return self
  1348.      */
  1349.     public function setReturnCost(float $returnCost): self
  1350.     {
  1351.         $this->returnCost $returnCost;
  1352.         return $this;
  1353.     }
  1354.     /**
  1355.      * @return float
  1356.      */
  1357.     public function getReturnCostToEUR(): float
  1358.     {
  1359.         return $this->returnCostToEUR;
  1360.     }
  1361.     /**
  1362.      * @param float $returnCostToEUR
  1363.      * @return self
  1364.      */
  1365.     public function setReturnCostToEUR(float $returnCostToEUR): self
  1366.     {
  1367.         $this->returnCostToEUR $returnCostToEUR;
  1368.         return $this;
  1369.     }
  1370.     /**
  1371.      * @return Product
  1372.      */
  1373.     public function getFirstProduct(): ?Product
  1374.     {
  1375.         return $this->firstProduct;
  1376.     }
  1377.     /**
  1378.      * @param Product|null $firstProduct
  1379.      * @return self
  1380.      */
  1381.     public function setFirstProduct(?Product $firstProduct): self
  1382.     {
  1383.         $this->firstProduct $firstProduct;
  1384.         return $this;
  1385.     }
  1386.     public function getOrderWarehouseDetail(): ?OrderWarehouseDetail
  1387.     {
  1388.         return $this->orderWarehouseDetail;
  1389.     }
  1390.     /**
  1391.      * @param OrderWarehouseDetail|null $orderWarehouseDetail
  1392.      * @return self
  1393.      */
  1394.     public function setOrderWarehouseDetail(?OrderWarehouseDetail $orderWarehouseDetail): self
  1395.     {
  1396.         $this->orderWarehouseDetail $orderWarehouseDetail;
  1397.         if ($orderWarehouseDetail && $orderWarehouseDetail->getOrder() !== $this) {
  1398.             $orderWarehouseDetail->setOrder($this);
  1399.         }
  1400.         return $this;
  1401.     }
  1402.     /**
  1403.      * @return Funnel|null
  1404.      */
  1405.     public function getFunnel(): ?Funnel
  1406.     {
  1407.         return $this->funnel;
  1408.     }
  1409.     /**
  1410.      * @param Funnel|null $funnel
  1411.      * @return self
  1412.      */
  1413.     public function setFunnel(?Funnel $funnel): self
  1414.     {
  1415.         $this->funnel $funnel;
  1416.         return $this;
  1417.     }
  1418.     /**
  1419.      * @return bool|int
  1420.      */
  1421.     public function isVoucher()
  1422.     {
  1423.         return $this->isVoucher;
  1424.     }
  1425.     /**
  1426.      * @param bool|int $isVoucher
  1427.      * @return Order
  1428.      */
  1429.     public function setIsVoucher($isVoucher)
  1430.     {
  1431.         $this->isVoucher $isVoucher;
  1432.         return $this;
  1433.     }
  1434.     /**
  1435.      * @return bool|int
  1436.      */
  1437.     public function isFirstOrder()
  1438.     {
  1439.         return $this->isFirstOrder;
  1440.     }
  1441.     /**
  1442.      * @param bool|int $isFirstOrder
  1443.      * @return Order
  1444.      */
  1445.     public function setIsFirstOrder($isFirstOrder): self
  1446.     {
  1447.         $this->isFirstOrder $isFirstOrder;
  1448.         return $this;
  1449.     }
  1450.     /**
  1451.      * @return mixed
  1452.      */
  1453.     public function getIp()
  1454.     {
  1455.         return $this->ip;
  1456.     }
  1457.     /**
  1458.      * @param string|null $ip
  1459.      * @return self
  1460.      */
  1461.     public function setIp(?string $ip): self
  1462.     {
  1463.         $this->ip $ip;
  1464.         return $this;
  1465.     }
  1466.     public function getVariantId(): ?int
  1467.     {
  1468.         return $this->variantId;
  1469.     }
  1470.     public function setVariantId(?int $variantId): self
  1471.     {
  1472.         $this->variantId $variantId;
  1473.         return $this;
  1474.     }
  1475. }