src/Entity/System/Cart.php line 30

Open in your IDE?
  1. <?php
  2. namespace App\Entity\System;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Doctrine\ORM\Mapping\JoinColumn;
  7. use Doctrine\ORM\Mapping\OneToOne;
  8. /**
  9.  * Cart
  10.  *
  11.  * @ORM\Table(
  12.  *      name="ps_cart",
  13.  *      indexes={
  14.  *
  15.  *          @ORM\Index(name="id_lang", columns={"id_lang"}),
  16.  *          @ORM\Index(name="id_guest", columns={"id_guest"}),
  17.  *          @ORM\Index(name="is_sync", columns={"is_sync"}),
  18.  *          @ORM\Index(name="is_virtual", columns={"is_virtual"}),
  19.  *          @ORM\Index(name="id_currency", columns={"id_currency"}),
  20.  *          @ORM\Index(name="secure_key", columns={"secure_key"}),
  21.  *          @ORM\Index(name="delivery_option", columns={"delivery_option"})
  22.  *      }
  23.  *  )
  24.  *
  25.  * @ORM\Entity(repositoryClass="App\Repository\System\CartRepository")
  26.  */
  27. class Cart
  28. {
  29.     public const DEFAULT_CURRENCY_EUR 1;
  30.     /**
  31.      * @var int
  32.      *
  33.      * @ORM\Id
  34.      *
  35.      * @ORM\GeneratedValue(strategy="AUTO")
  36.      *
  37.      * @ORM\Column(type="integer", name="id_cart")
  38.      */
  39.     private $id;
  40.     /**
  41.      * One Cart has One Order.
  42.      *
  43.      * @var Order|null
  44.      *
  45.      * @OneToOne(targetEntity="App\Entity\System\Order", inversedBy="cart")
  46.      *
  47.      * @JoinColumn(name="id_order", referencedColumnName="id_order", nullable=true)
  48.      */
  49.     private $order;
  50.     /**
  51.      * @ORM\ManyToOne(targetEntity="App\Entity\System\Carrier")
  52.      *
  53.      * @ORM\JoinColumn(name="id_carrier", referencedColumnName="id_carrier", nullable=true)
  54.      */
  55.     private ?Carrier $carrier;
  56.     /**
  57.      * @var string
  58.      *
  59.      * @ORM\Column(type="string", length=1000)
  60.      */
  61.     private $deliveryOption;
  62.     /**
  63.      * @var int
  64.      *
  65.      * @ORM\Column(type="integer", length=10, name="id_lang")
  66.      */
  67.     private $languageId;
  68.     /**
  69.      * @ORM\ManyToOne(targetEntity="App\Entity\System\Address")
  70.      *
  71.      * @ORM\JoinColumn(referencedColumnName="id_address", name="id_address_delivery", nullable=true)
  72.      */
  73.     private ?Address $addressDelivery;
  74.     /**
  75.      * @deprecated la dirección de facturación es la del cliente del carrito
  76.      *
  77.      * @ORM\ManyToOne(targetEntity="App\Entity\System\Address")
  78.      *
  79.      * @ORM\JoinColumn(referencedColumnName="id_address", name="id_address_invoice", nullable=true)
  80.      */
  81.     private ?Address $addressInvoice;
  82.     /**
  83.      * @var int
  84.      *
  85.      * @ORM\Column(type="integer", length=10, name="id_currency")
  86.      */
  87.     private $currencyId;
  88.     /**
  89.      * @ORM\ManyToOne(targetEntity="App\Entity\System\Customer")
  90.      *
  91.      * @ORM\JoinColumn(name="id_customer", referencedColumnName="id_customer", nullable=true)
  92.      */
  93.     private ?Customer $customer;
  94.     /**
  95.      * @var int
  96.      *
  97.      * @ORM\Column(type="integer", length=10, name="id_guest")
  98.      */
  99.     private $guestId;
  100.     /**
  101.      * @var string|null
  102.      *
  103.      * @ORM\Column(type="string", length=32, nullable=true, options={"default" : "-1"})
  104.      */
  105.     private $secureKey;
  106.     /**
  107.      * @var bool
  108.      *
  109.      * @ORM\Column(type="boolean", options={"default" : 1})
  110.      */
  111.     private $recyclable;
  112.     /**
  113.      * @var \DateTime
  114.      *
  115.      * @ORM\Column(type="datetime")
  116.      */
  117.     private $dateUpd;
  118.     /**
  119.      * @var \DateTime
  120.      *
  121.      * @ORM\Column(type="datetime")
  122.      */
  123.     private $dateAdd;
  124.     /**
  125.      * @var bool
  126.      *
  127.      * @ORM\Column(type="boolean", options={"default" : 0}, name="is_virtual")
  128.      */
  129.     private $virtual;
  130.     /**
  131.      * @var bool
  132.      *
  133.      * @ORM\Column(type="boolean", columnDefinition="tinyint(4)", options={"default" : 0}, name="is_sync")
  134.      */
  135.     private bool $sync;
  136.     /**
  137.      * @deprecated
  138.      *
  139.      * @var int
  140.      *
  141.      * @ORM\Column(type="integer", name="id_sincronate_shop_configuration", nullable=true)
  142.      */
  143.     private $sincronateShopConfigurationId;
  144.     /**
  145.      * @var bool
  146.      *
  147.      * @ORM\Column(type="boolean", options={"default" : 0}, name="is_mobile")
  148.      */
  149.     private $mobile;
  150.     /**
  151.      * @var bool|null
  152.      *
  153.      * @ORM\Column(type="boolean", options={"default" : 0})
  154.      */
  155.     private $dropshipping;
  156.     /**
  157.      * @var string|null
  158.      *
  159.      * @ORM\Column(type="string", nullable=true)
  160.      */
  161.     private $payment;
  162.     /**
  163.      * @var string|null
  164.      *
  165.      * @ORM\Column(type="string", length=64, nullable=true)
  166.      */
  167.     private ?string $paymentMethodType null;
  168.     /**
  169.      * @var string|null
  170.      *
  171.      * @ORM\Column(type="string", length=64, nullable=true)
  172.      */
  173.     private ?string $paymentMethodId null;
  174.     /**
  175.      * One Cart has One PackPaymentMethod.
  176.      *
  177.      * @var PaymentMethod|null
  178.      *
  179.      * @ORM\ManyToOne(targetEntity="App\Entity\System\PaymentMethod", inversedBy="packCarts")
  180.      *
  181.      * @JoinColumn(name="pack_payment_method_id", referencedColumnName="id_payment_method", nullable=true)
  182.      */
  183.     private $packPaymentMethod;
  184.     /**
  185.      * @var string|null
  186.      *
  187.      * @ORM\Column(type="string", nullable=true)
  188.      */
  189.     private $packStoredPaymentMethodId;
  190.     /**
  191.      * One Cart has One ServicesPaymentMethod.
  192.      *
  193.      * @var PaymentMethod|null
  194.      *
  195.      * @ORM\ManyToOne(targetEntity="App\Entity\System\PaymentMethod", inversedBy="servicesCarts")
  196.      *
  197.      * @JoinColumn(name="services_payment_method_id", referencedColumnName="id_payment_method", nullable=true)
  198.      */
  199.     private $servicesPaymentMethod;
  200.     /**
  201.      * @var string|null
  202.      *
  203.      * @ORM\Column(type="string", nullable=true)
  204.      */
  205.     private $servicesStoredPaymentMethodId;
  206.     /**
  207.      * @var float|null
  208.      *
  209.      * @ORM\Column(type="float", options={"default" : 0.00}, nullable=true)
  210.      */
  211.     private $totalProducts;
  212.     /**
  213.      * @var float|null
  214.      *
  215.      * @ORM\Column(type="float", options={"default" : 0.00}, nullable=true, name="total_envio")
  216.      */
  217.     private $totalShipping;
  218.     /**
  219.      * @ORM\Column(type="float", nullable=true, name="logistic_weight")
  220.      */
  221.     private ?float $logisticWeight;
  222.     /**
  223.      * @var CartProduct[]|ArrayCollection
  224.      *
  225.      * @ORM\OneToMany(targetEntity="CartProduct", mappedBy="cart", cascade={"persist"})
  226.      */
  227.     private $cartProducts;
  228.     /**
  229.      * @ORM\Column(type="string", length=40, nullable=true)
  230.      */
  231.     private ?string $carrierComment null;
  232.     /**
  233.      * @ORM\Column(type="string", length=50, nullable=true)
  234.      */
  235.     private ?string $refOrderSupplier null;
  236.     /**
  237.      * @ORM\Column(type="boolean", options={"default" : 0}, name="is_system")
  238.      */
  239.     private bool $system false;
  240.     /**
  241.      * @ORM\Column(type="string", length=64, nullable=true)
  242.      */
  243.     private ?string $sellingChannel null;
  244.     /**
  245.      * @ORM\Column(type="string", length=256, nullable=true)
  246.      */
  247.     private ?string $additionalParameters null;
  248.     /**
  249.      * @ORM\Column(type="datetime", nullable=true)
  250.      */
  251.     private ?\DateTime $dateAmazon null;
  252.     /**
  253.      * @ORM\Column(type="boolean", options={"default" : 0})
  254.      */
  255.     private bool $fba false;
  256.     /**
  257.      * @ORM\Column(type="datetime", nullable=true)
  258.      */
  259.     private ?\DateTime $maxDeliveryDatetime null;
  260.     /**
  261.      * @ORM\Column(type="datetime", nullable=true)
  262.      */
  263.     private ?\DateTime $maxExpeditionDatetime null;
  264.     /**
  265.      * @ORM\Column(type="text", nullable=true)
  266.      */
  267.     private ?string $shipmentChoices null;
  268.     /**
  269.      * @ORM\ManyToOne(targetEntity="App\Entity\System\CodeDiscount")
  270.      *
  271.      * @ORM\JoinColumn(name="code_discount_id", referencedColumnName="id", nullable=true, onDelete="SET NULL")
  272.      */
  273.     private ?CodeDiscount $codeDiscount null;
  274.     /**
  275.      * @ORM\ManyToOne(targetEntity="App\Entity\System\Cart", inversedBy="cartChildren")
  276.      *
  277.      * @ORM\JoinColumn(name="cart_parent_id", referencedColumnName="id_cart", nullable=true)
  278.      */
  279.     private ?Cart $cartParent null;
  280.     /**
  281.      * @var ArrayCollection<int, Cart>|Cart[]
  282.      *
  283.      * @ORM\OneToMany(targetEntity="App\Entity\System\Cart", mappedBy="cartParent")
  284.      */
  285.     private $cartChildren;
  286.     /**
  287.      * @ORM\ManyToOne(targetEntity="App\Entity\System\PaymentMethod")
  288.      *
  289.      * @ORM\JoinColumn(name="payment_method", referencedColumnName="id_payment_method", nullable=true)
  290.      */
  291.     private ?PaymentMethod $paymentMethod null;
  292.     public function __construct()
  293.     {
  294.         $this->currencyId 0;
  295.         $this->guestId 0;
  296.         $this->recyclable false;
  297.         $this->sync false;
  298.         $this->logisticWeight 0;
  299.         $this->cartProducts = new ArrayCollection();
  300.         $this->cartChildren = new ArrayCollection();
  301.         $this->dropshipping false;
  302.         $this->mobile false;
  303.     }
  304.     /**
  305.      * @return int
  306.      */
  307.     public function getId(): int
  308.     {
  309.         return $this->id;
  310.     }
  311.     /**
  312.      * @param int|null $id
  313.      *
  314.      * @return Cart
  315.      */
  316.     public function setIdCart(?int $id): Cart
  317.     {
  318.         $this->id $id;
  319.         return $this;
  320.     }
  321.     /**
  322.      * @return Order|null
  323.      */
  324.     public function getOrder(): ?Order
  325.     {
  326.         return $this->order;
  327.     }
  328.     /**
  329.      * @param Order|null $order
  330.      *
  331.      * @return Cart
  332.      */
  333.     public function setOrder(?Order $order): Cart
  334.     {
  335.         $this->order $order;
  336.         return $this;
  337.     }
  338.     public function getCarrier(): ?Carrier
  339.     {
  340.         return $this->carrier;
  341.     }
  342.     public function setCarrier(?Carrier $carrier): Cart
  343.     {
  344.         $this->carrier $carrier;
  345.         return $this;
  346.     }
  347.     /**
  348.      * @return string
  349.      */
  350.     public function getDeliveryOption(): string
  351.     {
  352.         return $this->deliveryOption;
  353.     }
  354.     /**
  355.      * @param string $deliveryOption
  356.      *
  357.      * @return Cart
  358.      */
  359.     public function setDeliveryOption(string $deliveryOption): self
  360.     {
  361.         $this->deliveryOption $deliveryOption;
  362.         return $this;
  363.     }
  364.     /**
  365.      * @return int
  366.      */
  367.     public function getLanguageId(): int
  368.     {
  369.         return $this->languageId;
  370.     }
  371.     /**
  372.      * @param int $languageId
  373.      *
  374.      * @return Cart
  375.      */
  376.     public function setLanguageId(int $languageId): self
  377.     {
  378.         $this->languageId $languageId;
  379.         return $this;
  380.     }
  381.     public function getAddressDelivery(): ?Address
  382.     {
  383.         if ($this->addressDelivery && $this->addressDelivery->getId() === 0) {
  384.             return null;
  385.         }
  386.         return $this->addressDelivery;
  387.     }
  388.     public function setAddressDelivery(?Address $addressDelivery): Cart
  389.     {
  390.         $this->addressDelivery $addressDelivery;
  391.         return $this;
  392.     }
  393.     /**
  394.      * @deprecated la dirección de facturación es la del cliente del carrito
  395.      */
  396.     public function getAddressInvoice(): ?Address
  397.     {
  398.         if ($this->addressInvoice && $this->addressInvoice->getId() === 0) {
  399.             return null;
  400.         }
  401.         return $this->addressInvoice;
  402.     }
  403.     /**
  404.      * @deprecated la dirección de facturación es la del cliente del carrito
  405.      */
  406.     public function setAddressInvoice(?Address $addressInvoice): Cart
  407.     {
  408.         $this->addressInvoice $addressInvoice;
  409.         return $this;
  410.     }
  411.     /**
  412.      * @return int
  413.      */
  414.     public function getCurrencyId(): int
  415.     {
  416.         return $this->currencyId;
  417.     }
  418.     /**
  419.      * @param int $currencyId
  420.      *
  421.      * @return Cart
  422.      */
  423.     public function setCurrencyId(int $currencyId): self
  424.     {
  425.         $this->currencyId $currencyId;
  426.         return $this;
  427.     }
  428.     public function getCustomer(): ?Customer
  429.     {
  430.         return $this->customer;
  431.     }
  432.     public function setCustomer(?Customer $customer): Cart
  433.     {
  434.         $this->customer $customer;
  435.         return $this;
  436.     }
  437.     /**
  438.      * @return int
  439.      */
  440.     public function getGuestId(): int
  441.     {
  442.         return $this->guestId;
  443.     }
  444.     /**
  445.      * @param int $guestId
  446.      *
  447.      * @return Cart
  448.      */
  449.     public function setGuestId(int $guestId): self
  450.     {
  451.         $this->guestId $guestId;
  452.         return $this;
  453.     }
  454.     /**
  455.      * @return string|null
  456.      */
  457.     public function getSecureKey(): ?string
  458.     {
  459.         return $this->secureKey;
  460.     }
  461.     /**
  462.      * @param string|null $secureKey
  463.      *
  464.      * @return Cart
  465.      */
  466.     public function setSecureKey(?string $secureKey): self
  467.     {
  468.         $this->secureKey $secureKey;
  469.         return $this;
  470.     }
  471.     public function isRecyclable(): bool
  472.     {
  473.         return $this->recyclable;
  474.     }
  475.     public function setRecyclable(bool $recyclable): self
  476.     {
  477.         $this->recyclable $recyclable;
  478.         return $this;
  479.     }
  480.     /**
  481.      * @return \DateTime
  482.      */
  483.     public function getDateUpd(): \DateTime
  484.     {
  485.         return $this->dateUpd;
  486.     }
  487.     /**
  488.      * @param \DateTime $dateUpd
  489.      *
  490.      * @return Cart
  491.      */
  492.     public function setDateUpd(\DateTime $dateUpd): self
  493.     {
  494.         $this->dateUpd $dateUpd;
  495.         return $this;
  496.     }
  497.     /**
  498.      * @return \DateTime
  499.      */
  500.     public function getDateAdd(): \DateTime
  501.     {
  502.         return $this->dateAdd;
  503.     }
  504.     /**
  505.      * @param \DateTime $dateAdd
  506.      *
  507.      * @return Cart
  508.      */
  509.     public function setDateAdd(\DateTime $dateAdd): self
  510.     {
  511.         $this->dateAdd $dateAdd;
  512.         return $this;
  513.     }
  514.     public function isVirtual(): bool
  515.     {
  516.         return $this->virtual;
  517.     }
  518.     public function setVirtual(bool $virtual): self
  519.     {
  520.         $this->virtual $virtual;
  521.         return $this;
  522.     }
  523.     /**
  524.      * @return bool
  525.      */
  526.     public function getSync(): bool
  527.     {
  528.         return $this->sync;
  529.     }
  530.     /**
  531.      * @param bool $sync
  532.      *
  533.      * @return Cart
  534.      */
  535.     public function setSync(bool $sync): self
  536.     {
  537.         $this->sync $sync;
  538.         return $this;
  539.     }
  540.     /**
  541.      * @return int
  542.      */
  543.     public function getSincronateShopConfigurationId(): int
  544.     {
  545.         return $this->sincronateShopConfigurationId;
  546.     }
  547.     /**
  548.      * @param int $sincronateShopConfigurationId
  549.      *
  550.      * @return Cart
  551.      */
  552.     public function setSincronateShopConfigurationId(int $sincronateShopConfigurationId): self
  553.     {
  554.         $this->sincronateShopConfigurationId $sincronateShopConfigurationId;
  555.         return $this;
  556.     }
  557.     public function isMobile(): bool
  558.     {
  559.         return $this->mobile;
  560.     }
  561.     public function setMobile(bool $mobile): self
  562.     {
  563.         $this->mobile $mobile;
  564.         return $this;
  565.     }
  566.     public function isDropshipping(): bool
  567.     {
  568.         return $this->dropshipping;
  569.     }
  570.     public function setDropshipping(bool $dropshipping): self
  571.     {
  572.         $this->dropshipping $dropshipping;
  573.         return $this;
  574.     }
  575.     /**
  576.      * @return string|null
  577.      */
  578.     public function getPayment(): ?string
  579.     {
  580.         return $this->payment;
  581.     }
  582.     /**
  583.      * @param string|null $payment
  584.      *
  585.      * @return Cart
  586.      */
  587.     public function setPayment(?string $payment): self
  588.     {
  589.         $this->payment $payment;
  590.         return $this;
  591.     }
  592.     public function getPaymentMethodType(): ?string
  593.     {
  594.         return $this->paymentMethodType;
  595.     }
  596.     public function setPaymentMethodType(?string $paymentMethodType): Cart
  597.     {
  598.         $this->paymentMethodType $paymentMethodType;
  599.         return $this;
  600.     }
  601.     public function getPaymentMethodId(): ?string
  602.     {
  603.         return $this->paymentMethodId;
  604.     }
  605.     public function setPaymentMethodId(?string $paymentMethodId): Cart
  606.     {
  607.         $this->paymentMethodId $paymentMethodId;
  608.         return $this;
  609.     }
  610.     /**
  611.      * @return PaymentMethod|null
  612.      */
  613.     public function getPackPaymentMethod(): ?PaymentMethod
  614.     {
  615.         return $this->packPaymentMethod;
  616.     }
  617.     /**
  618.      * @param PaymentMethod|null $packPaymentMethod
  619.      *
  620.      * @return Cart
  621.      */
  622.     public function setPackPaymentMethod(?PaymentMethod $packPaymentMethod): Cart
  623.     {
  624.         $this->packPaymentMethod $packPaymentMethod;
  625.         return $this;
  626.     }
  627.     /**
  628.      * @return string|null
  629.      */
  630.     public function getPackStoredPaymentMethodId(): ?string
  631.     {
  632.         return $this->packStoredPaymentMethodId;
  633.     }
  634.     /**
  635.      * @param string|null $packStoredPaymentMethodId
  636.      *
  637.      * @return Cart
  638.      */
  639.     public function setPackStoredPaymentMethodId(?string $packStoredPaymentMethodId): Cart
  640.     {
  641.         $this->packStoredPaymentMethodId $packStoredPaymentMethodId;
  642.         return $this;
  643.     }
  644.     /**
  645.      * @return PaymentMethod|null
  646.      */
  647.     public function getServicesPaymentMethod(): ?PaymentMethod
  648.     {
  649.         return $this->servicesPaymentMethod;
  650.     }
  651.     /**
  652.      * @param PaymentMethod|null $servicesPaymentMethod
  653.      *
  654.      * @return Cart
  655.      */
  656.     public function setServicesPaymentMethod(?PaymentMethod $servicesPaymentMethod): Cart
  657.     {
  658.         $this->servicesPaymentMethod $servicesPaymentMethod;
  659.         return $this;
  660.     }
  661.     /**
  662.      * @return string|null
  663.      */
  664.     public function getServicesStoredPaymentMethodId(): ?string
  665.     {
  666.         return $this->servicesStoredPaymentMethodId;
  667.     }
  668.     /**
  669.      * @param string|null $servicesStoredPaymentMethodId
  670.      *
  671.      * @return Cart
  672.      */
  673.     public function setServicesStoredPaymentMethodId(?string $servicesStoredPaymentMethodId): Cart
  674.     {
  675.         $this->servicesStoredPaymentMethodId $servicesStoredPaymentMethodId;
  676.         return $this;
  677.     }
  678.     /**
  679.      * @return float|null
  680.      */
  681.     public function getTotalProducts(): ?float
  682.     {
  683.         return $this->totalProducts;
  684.     }
  685.     /**
  686.      * @param float|null $totalProducts
  687.      *
  688.      * @return Cart
  689.      */
  690.     public function setTotalProducts(?float $totalProducts): self
  691.     {
  692.         $this->totalProducts $totalProducts;
  693.         return $this;
  694.     }
  695.     /**
  696.      * @return float|null
  697.      */
  698.     public function getTotalShipping(): ?float
  699.     {
  700.         return $this->totalShipping;
  701.     }
  702.     /**
  703.      * @param float|null $totalShipping
  704.      *
  705.      * @return Cart
  706.      */
  707.     public function setTotalShipping(?float $totalShipping): self
  708.     {
  709.         $this->totalShipping $totalShipping;
  710.         return $this;
  711.     }
  712.     /**
  713.      * @param array<CartProduct>|ArrayCollection<int, CartProduct> $cartProducts
  714.      *
  715.      * @return $this
  716.      */
  717.     public function setCartProducts($cartProducts): Cart
  718.     {
  719.         $this->cartProducts $cartProducts;
  720.         return $this;
  721.     }
  722.     public function addCartProduct(CartProduct $cartProduct): Cart
  723.     {
  724.         if (!$this->cartProducts->contains($cartProduct)) {
  725.             $this->cartProducts[] = $cartProduct;
  726.             $cartProduct->setCart($this);
  727.         }
  728.         return $this;
  729.     }
  730.     public function removeCartProduct(CartProduct $cartProduct): Cart
  731.     {
  732.         if ($this->cartProducts->contains($cartProduct)) {
  733.             $this->cartProducts->removeElement($cartProduct);
  734.         }
  735.         return $this;
  736.     }
  737.     /**
  738.      * @param CartProduct[] $cartProducts
  739.      */
  740.     public function addCartProducts(array $cartProducts): void
  741.     {
  742.         foreach ($cartProducts as $cartProduct) {
  743.             $this->cartProducts->add($cartProduct);
  744.         }
  745.     }
  746.     /**
  747.      * @return CartProduct[]|Collection<int, CartProduct>
  748.      */
  749.     public function getCartProducts()
  750.     {
  751.         return $this->cartProducts;
  752.     }
  753.     public function getCarrierComment(): ?string
  754.     {
  755.         return $this->carrierComment;
  756.     }
  757.     public function setCarrierComment(?string $carrierComment): Cart
  758.     {
  759.         $this->carrierComment $carrierComment;
  760.         return $this;
  761.     }
  762.     public function getRefOrderSupplier(): ?string
  763.     {
  764.         return $this->refOrderSupplier;
  765.     }
  766.     public function setRefOrderSupplier(?string $refOrderSupplier): Cart
  767.     {
  768.         $this->refOrderSupplier $refOrderSupplier;
  769.         return $this;
  770.     }
  771.     public function isSystem(): bool
  772.     {
  773.         return $this->system;
  774.     }
  775.     public function setSystem(bool $system): Cart
  776.     {
  777.         $this->system $system;
  778.         return $this;
  779.     }
  780.     public function getSellingChannel(): ?string
  781.     {
  782.         return $this->sellingChannel;
  783.     }
  784.     public function setSellingChannel(?string $sellingChannel): Cart
  785.     {
  786.         $this->sellingChannel $sellingChannel;
  787.         return $this;
  788.     }
  789.     public function getAdditionalParameters(): ?string
  790.     {
  791.         return $this->additionalParameters;
  792.     }
  793.     public function setAdditionalParameters(?string $additionalParameters): Cart
  794.     {
  795.         $this->additionalParameters $additionalParameters;
  796.         return $this;
  797.     }
  798.     public function getDateAmazon(): ?\DateTime
  799.     {
  800.         return $this->dateAmazon;
  801.     }
  802.     public function setDateAmazon(?\DateTime $dateAmazon): Cart
  803.     {
  804.         $this->dateAmazon $dateAmazon;
  805.         return $this;
  806.     }
  807.     public function isFba(): bool
  808.     {
  809.         return $this->fba;
  810.     }
  811.     public function setFba(bool $fba): Cart
  812.     {
  813.         $this->fba $fba;
  814.         return $this;
  815.     }
  816.     public function getMaxDeliveryDatetime(): ?\DateTime
  817.     {
  818.         return $this->maxDeliveryDatetime;
  819.     }
  820.     public function setMaxDeliveryDatetime(?\DateTime $maxDeliveryDatetime): Cart
  821.     {
  822.         $this->maxDeliveryDatetime $maxDeliveryDatetime;
  823.         return $this;
  824.     }
  825.     public function getMaxExpeditionDatetime(): ?\DateTime
  826.     {
  827.         return $this->maxExpeditionDatetime;
  828.     }
  829.     public function setMaxExpeditionDatetime(?\DateTime $maxExpeditionDatetime): Cart
  830.     {
  831.         $this->maxExpeditionDatetime $maxExpeditionDatetime;
  832.         return $this;
  833.     }
  834.     public function getCodeDiscount(): ?CodeDiscount
  835.     {
  836.         if ($this->codeDiscount && $this->codeDiscount->getId() === 0) {
  837.             return null;
  838.         }
  839.         return $this->codeDiscount;
  840.     }
  841.     public function setCodeDiscount(?CodeDiscount $codeDiscount): Cart
  842.     {
  843.         $this->codeDiscount $codeDiscount;
  844.         return $this;
  845.     }
  846.     public function getShipmentChoices(): ?string
  847.     {
  848.         return $this->shipmentChoices;
  849.     }
  850.     public function setShipmentChoices(?string $shipmentChoices): Cart
  851.     {
  852.         $this->shipmentChoices $shipmentChoices;
  853.         return $this;
  854.     }
  855.     public function getCartParent(): ?Cart
  856.     {
  857.         return $this->cartParent;
  858.     }
  859.     public function setCartParent(?Cart $cartParent): Cart
  860.     {
  861.         $this->cartParent $cartParent;
  862.         return $this;
  863.     }
  864.     /**
  865.      * @return Collection<int, Cart>
  866.      */
  867.     public function getCartChildren(): Collection
  868.     {
  869.         return $this->cartChildren;
  870.     }
  871.     public function addCart(Cart $cart): Cart
  872.     {
  873.         if (!$this->cartChildren->contains($cart)) {
  874.             $this->cartChildren[] = $cart;
  875.             $cart->setCartParent($this);
  876.         }
  877.         return $this;
  878.     }
  879.     public function getLogisticWeight(): ?float
  880.     {
  881.         return $this->logisticWeight;
  882.     }
  883.     public function setLogisticWeight(?float $logisticWeight): void
  884.     {
  885.         $this->logisticWeight $logisticWeight;
  886.     }
  887.     public function getPaymentMethod(): ?PaymentMethod
  888.     {
  889.         return $this->paymentMethod;
  890.     }
  891.     public function setPaymentMethod(?PaymentMethod $paymentMethod): Cart
  892.     {
  893.         $this->paymentMethod $paymentMethod;
  894.         return $this;
  895.     }
  896. }