src/Entity/Gos/ProductVariant.php line 1146

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Gos;
  3. use App\Entity\Gos\Uniqskills\Certificate;
  4. use App\Entity\Gos\Uniqskills\Course;
  5. use App\Entity\Gos\Uniqskills\Package;
  6. use App\Entity\Gos\VirtualCurrency\ProductVariantVirtualCurrencySettings;
  7. use App\Enum\Product\ProductSourceSystem;
  8. use Doctrine\Common\Collections\ArrayCollection;
  9. use Doctrine\Common\Collections\Collection;
  10. use Doctrine\ORM\Mapping as ORM;
  11. use Doctrine\ORM\Mapping\OrderBy;
  12. use Symfony\Component\HttpFoundation\File\File;
  13. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  14. use JMS\Serializer\Annotation as JMS;
  15. /**
  16.  * ProductVariant
  17.  *
  18.  * @ORM\Table(name="product_variant")
  19.  * @ORM\Entity(repositoryClass="App\Repository\ProductVariantRepository")
  20.  * @ORM\HasLifecycleCallbacks
  21.  * @Vich\Uploadable
  22.  */
  23. class ProductVariant
  24. {
  25.     /**
  26.      * @var int
  27.      *
  28.      * @ORM\Column(name="id", type="integer")
  29.      * @ORM\Id
  30.      * @ORM\GeneratedValue(strategy="AUTO")
  31.      * @JMS\Groups({"PortalSettings"})
  32.      */
  33.     private $id;
  34.     /**
  35.      * @var bool
  36.      *
  37.      * @ORM\Column(name="isVirtual", type="boolean", nullable=true)
  38.      * @JMS\Groups({"PortalSettings"})
  39.      */
  40.     private $isVirtual;
  41.     /**
  42.      * @var bool
  43.      *
  44.      * @ORM\Column(type="boolean", nullable=true)
  45.      */
  46.     private $isTest;
  47.     /**
  48.      * @var string
  49.      *
  50.      * @ORM\Column(type="string", length=255, nullable=true)
  51.      */
  52.     private $productVariantNo;
  53.     /**
  54.      * @var string
  55.      *
  56.      * @ORM\Column(type="string", length=255, nullable=true)
  57.      */
  58.     private $productNumberNoTax;
  59.     /**
  60.      * @var string
  61.      *
  62.      * @ORM\Column(type="string", length=255, nullable=true)
  63.      */
  64.     private $productNumberPartTax;
  65.     /**
  66.      * @var ProductVariant
  67.      *
  68.      * @ORM\ManyToOne(targetEntity=ProductVariant::class)
  69.      * @ORM\JoinColumn(name="bur_funding_product_variant_id", referencedColumnName="id", nullable=true)
  70.      */
  71.     private $burFundingProductVariant;
  72.     /**
  73.      * @var int
  74.      *
  75.      * @ORM\Column(type="integer", nullable=true)
  76.      */
  77.     private $productVariantId;
  78.     /**
  79.      * @var string
  80.      *
  81.      * @ORM\Column(type="string", length=255, nullable=true, unique=true)
  82.      * @JMS\Groups({"PortalSettings"})
  83.      */
  84.     private $productVariantNoComplete;
  85.     /**
  86.      * @var string
  87.      *
  88.      * @ORM\Column(type="string", length=255, nullable=true)
  89.      */
  90.     private $productVariantKey;
  91.     /**
  92.      * @var string
  93.      *
  94.      * @ORM\Column(type="string", length=255)
  95.      */
  96.     private $variantState 'active';
  97.     /**
  98.      * @var string
  99.      *
  100.      * @ORM\Column(type="string", length=255)
  101.      */
  102.     private $tittleOnInvoice;
  103.     /**
  104.      * @var string
  105.      *
  106.      * @ORM\Column(type="string", length=255)
  107.      */
  108.     private $workingTitle;
  109.     /**
  110.      * @var float
  111.      *
  112.      * @ORM\Column(type="float", precision=18, scale=2)
  113.      * @JMS\Groups({"PortalSettings"})
  114.      */
  115.     private $priceNet '0';
  116.     /**
  117.      * @var float
  118.      *
  119.      * @ORM\Column(type="float", precision=18, scale=2, nullable=true)
  120.      * @JMS\Groups({"PortalSettings"})
  121.      */
  122.     private $priceGross '0';
  123.     /**
  124.      * @var string
  125.      *
  126.      * @ORM\Column(type="string", length=255)
  127.      * @JMS\Groups({"PortalSettings"})
  128.      */
  129.     private $tradeName;
  130.     /**
  131.      * @ORM\Column(type="string", length=255, nullable=true)
  132.      */
  133.     private $altTradeName;
  134.     /**
  135.      * @var string
  136.      *
  137.      * @ORM\Column(type="text", nullable=true)
  138.      * @JMS\Groups({"PortalSettings"})
  139.      */
  140.     private $technicalInformations;
  141.     /**
  142.      * @var string
  143.      *
  144.      * @ORM\Column(type="text", nullable=true)
  145.      * @JMS\Groups({"PortalSettings"})
  146.      */
  147.     private $technicalInformationForMail;
  148.     /**
  149.      * @var string
  150.      *
  151.      * @ORM\Column(type="text", nullable=true)
  152.      * @JMS\Groups({"PortalSettings"})
  153.      */
  154.     private $label;
  155.     /**
  156.      * @var bool
  157.      *
  158.      * @ORM\Column(type="boolean", nullable=true)
  159.      * @JMS\Groups({"PortalSettings"})
  160.      */
  161.     private $isGross;
  162.     /**
  163.      * @var string
  164.      *
  165.      * @ORM\Column(type="string", length=255)
  166.      * @JMS\Groups({"PortalSettings"})
  167.      */
  168.     private $currencyCode 'PLN';
  169.     /**
  170.      * @var string
  171.      *
  172.      * @ORM\Column(type="string", length=255, nullable=true)
  173.      * @JMS\Groups({"PortalSettings"})
  174.      */
  175.     private $postageType 'Poczta Polska-wysyƂka AD';
  176.     /**
  177.      * @var float
  178.      *
  179.      * @ORM\Column(type="float", precision=18, scale=2)
  180.      * @JMS\Groups({"PortalSettings"})
  181.      */
  182.     private $postageCost '0';
  183.     /**
  184.      * @var int
  185.      *
  186.      * @ORM\Column(type="integer")
  187.      */
  188.     private $totalWeight '0';
  189.     /**
  190.      * @var int
  191.      *
  192.      * @ORM\Column(type="integer")
  193.      */
  194.     private $seriesType '0';
  195.     /**
  196.      * @var bool
  197.      *
  198.      * @ORM\Column(type="boolean", nullable=true)
  199.      */
  200.     private $isDefault;
  201.     /**
  202.      * @ORM\Column(type="boolean", nullable=true)
  203.      */
  204.     private $taxFreeForBudgetUnit;
  205.     /**
  206.      * @ORM\Column(type="string", length=50, nullable=true)
  207.      */
  208.     private $productNumberForBudgetUnit;
  209.     /**
  210.      * @ORM\Column(type="boolean")
  211.      * @JMS\Groups({"PortalSettings"})
  212.      */
  213.     private $showGrossPrice;
  214.     /**
  215.      * @ORM\Column(type="boolean", nullable=true)
  216.      */
  217.     private $discountOnline;
  218.     /**
  219.      * @ORM\Column(type="float", precision=16, scale=4, nullable=true)
  220.      */
  221.     private $discountValueOnline;
  222.     /**
  223.      * @var bool
  224.      *
  225.      * @ORM\Column(type="boolean", nullable=true)
  226.      * @JMS\Groups({"PortalSettings"})
  227.      */
  228.     private $stateIsAvailible;
  229.     /**
  230.      * @var bool
  231.      *
  232.      * @ORM\Column(type="boolean", nullable=true)
  233.      * @JMS\Groups({"PortalSettings"})
  234.      */
  235.     private $stateIsForcedReservation;
  236.     /**
  237.      * @var bool
  238.      *
  239.      * @ORM\Column(type="boolean", nullable=true)
  240.      * @JMS\Groups({"PortalSettings"})
  241.      */
  242.     private $stateIsProductTest;
  243.     /**
  244.      * @var bool
  245.      *
  246.      * @ORM\Column(type="boolean", nullable=true)
  247.      * @JMS\Groups({"PortalSettings"})
  248.      */
  249.     private $stateIsTrialRecurring;
  250.     /**
  251.      * @var int
  252.      *
  253.      * @ORM\Column(type="integer", nullable=true, options={"default": 3})
  254.      */
  255.     private $trialRecurringDuration 3;
  256.     /**
  257.      * @var ProductVariant
  258.      *
  259.      * @ORM\ManyToOne(targetEntity=ProductVariant::class)
  260.      * @ORM\JoinColumn(name="product_variant_after_trial_recurring_end_id", referencedColumnName="id", nullable=true)
  261.      */
  262.     private $productVariantAfterTrialRecurringEnd;
  263.     /**
  264.      * @ORM\Column(type="boolean", nullable=true)
  265.      */
  266.     private $isAccessWithoutPayment false;
  267.     /**
  268.      * @var bool
  269.      *
  270.      * @ORM\Column(type="boolean", nullable=true)
  271.      */
  272.     private $buyMaxOne;
  273.     /**
  274.      * @var bool
  275.      *
  276.      * @ORM\Column(type="boolean", nullable=true)
  277.      */
  278.     private $isAddition;
  279.     /**
  280.      * @var int
  281.      *
  282.      * @ORM\Column(type="integer")
  283.      */
  284.     private $maxUsers '1';
  285.     /**
  286.      * @var int
  287.      *
  288.      * @ORM\Column(type="integer", nullable=true)
  289.      */
  290.     private $quantity;
  291.     /**
  292.      * @var int
  293.      *
  294.      * @ORM\Column(type="integer", nullable=true)
  295.      */
  296.     private $orderQuantity;
  297.     /**
  298.      * @ORM\Column(type="datetime", nullable=true)
  299.      */
  300.     private $eventDate;
  301.     /**
  302.      * @ORM\ManyToMany(targetEntity="App\Entity\Gos\Product", inversedBy="productVariant")
  303.      * @ORM\JoinTable(name="product_product_variant")
  304.      */
  305.     private $product;
  306.     /**
  307.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\ProductVariantMultiDiscount", mappedBy="productVariant", orphanRemoval=true, cascade={"persist"})
  308.      */
  309.     private $multiDiscount;
  310.     /**
  311.      * @ORM\ManyToMany(targetEntity="App\Entity\Gos\Coupon", mappedBy="productVariant")
  312.      */
  313.     private $coupon;
  314.     /**
  315.      * @ORM\ManyToMany(targetEntity="App\Entity\Gos\ApplicationCoupon", mappedBy="productVariant")
  316.      */
  317.     private $applicationCoupon;
  318.     /**
  319.      * @ORM\ManyToMany(targetEntity="App\Entity\Gos\SalesManagoCoupon", mappedBy="productVariant")
  320.      */
  321.     private $salesManagoCoupons;
  322.     /**
  323.      * @ORM\ManyToMany(targetEntity="App\Entity\Gos\SalesManagoCatalog", inversedBy="productVariants")
  324.      */
  325.     private $salesManagoCatalogs;
  326.     /**
  327.      * @ORM\ManyToMany(targetEntity="App\Entity\Gos\Coupon", mappedBy="gratis")
  328.      */
  329.     private $gratisCoupon;
  330.     /**
  331.      * @ORM\ManyToMany(targetEntity="App\Entity\Gos\Coupon", mappedBy="bundleProducts")
  332.      */
  333.     private $bundleCoupon;
  334.     /**
  335.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\CouponPackProduct", mappedBy="productVariant")
  336.      */
  337.     private $couponPack;
  338.     /**
  339.      * @ORM\ManyToMany(targetEntity="App\Entity\Gos\SalesManagoCoupon", mappedBy="gratis")
  340.      */
  341.     private $salesManagoGratisCoupons;
  342.     /**
  343.      * @ORM\ManyToMany(targetEntity="App\Entity\Gos\PortalSettings", mappedBy="productVariant")
  344.      */
  345.     private $portalSettings;
  346.     /**
  347.      * @ORM\ManyToMany(targetEntity="App\Entity\Gos\ProductVariant", mappedBy="physicalVariant")
  348.      */
  349.     protected $virtualVariant;
  350.     /**
  351.      * @ORM\ManyToMany(targetEntity="App\Entity\Gos\ProductVariant", inversedBy="virtualVariant")
  352.      * @ORM\JoinTable(name="relations_product_variant",
  353.      *      joinColumns={@ORM\JoinColumn(name="virtual_variant_id", referencedColumnName="id")},
  354.      *      inverseJoinColumns={@ORM\JoinColumn(name="physical_variant_id", referencedColumnName="id")}
  355.      *      )
  356.      */
  357.     protected $physicalVariant;
  358.     /**
  359.      * @ORM\ManyToMany(targetEntity="App\Entity\Gos\ProductVariant", mappedBy="exclusiveVariant")
  360.      */
  361.     protected $normalVariant;
  362.     /**
  363.      * @ORM\ManyToMany(targetEntity="App\Entity\Gos\ProductVariant", inversedBy="normalVariant")
  364.      * @ORM\JoinTable(name="product_variant_exclusives",
  365.      *      joinColumns={@ORM\JoinColumn(name="normal_variant_id", referencedColumnName="id")},
  366.      *      inverseJoinColumns={@ORM\JoinColumn(name="exclusive_variant_id", referencedColumnName="id")}
  367.      *      )
  368.      */
  369.     protected $exclusiveVariant;
  370.     /**
  371.      * @ORM\ManyToMany(targetEntity="App\Entity\Gos\ProductVariant", mappedBy="additionalCartVariant")
  372.      */
  373.     protected $basicCartVariant;
  374.     /**
  375.      * @ORM\ManyToMany(targetEntity="App\Entity\Gos\ProductVariant", inversedBy="basicCartVariant")
  376.      * @ORM\JoinTable(name="product_variant_cart_additionals",
  377.      *      joinColumns={@ORM\JoinColumn(name="basic_cart_variant_id", referencedColumnName="id")},
  378.      *      inverseJoinColumns={@ORM\JoinColumn(name="additional_cart_variant_id", referencedColumnName="id")}
  379.      *      )
  380.      */
  381.     protected $additionalCartVariant;
  382.     /**
  383.      * @ORM\ManyToMany(targetEntity="App\Entity\Gos\ProductVariant", mappedBy="additionalCartVariantUpselling")
  384.      */
  385.     protected $basicCartVariantUpselling;
  386.     /**
  387.      * @ORM\ManyToMany(targetEntity="App\Entity\Gos\ProductVariant", inversedBy="basicCartVariantUpselling")
  388.      * @ORM\JoinTable(name="product_variant_cart_additionals_upselling",
  389.      *      joinColumns={@ORM\JoinColumn(name="basic_cart_variant_upselling_id", referencedColumnName="id")},
  390.      *      inverseJoinColumns={@ORM\JoinColumn(name="additional_cart_variant_upselling_id", referencedColumnName="id")}
  391.      *      )
  392.      */
  393.     protected $additionalCartVariantUpselling;
  394.     /**
  395.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\ProductCart", mappedBy="productVariant")
  396.      */
  397.     private $productCart;
  398.     /**
  399.      * @ORM\ManyToMany(targetEntity="App\Entity\Gos\PaymentMethod", inversedBy="productVariant")
  400.      * @ORM\JoinColumn()
  401.      */
  402.     private $paymentMethod;
  403.     /**
  404.      * @ORM\ManyToMany(targetEntity="App\Entity\Gos\PaymentSystem", inversedBy="productVariant")
  405.      * @ORM\JoinColumn()
  406.      */
  407.     private $paymentSystem;
  408.     /**
  409.      * @ORM\ManyToMany(targetEntity="App\Entity\Gos\ClientType", inversedBy="productVariant")
  410.      * @ORM\JoinColumn()
  411.      * @OrderBy({"id" = "DESC"})
  412.      */
  413.     private $clientType;
  414.     /**
  415.      * @ORM\ManyToOne(targetEntity="App\Entity\Gos\Product", inversedBy="masterProductVariant")
  416.      * @ORM\JoinColumn(onDelete="CASCADE")
  417.      */
  418.     private $masterProduct;
  419.     /**
  420.      * @ORM\ManyToOne(targetEntity="App\Entity\Gos\Product", inversedBy="tradeProductVariants")
  421.      * @ORM\JoinColumn(onDelete="CASCADE")
  422.      */
  423.     private $tradeProduct;
  424.     /**
  425.      * @ORM\ManyToMany(targetEntity="App\Entity\Gos\Term", mappedBy="productVariants")
  426.      */
  427.     private $terms;
  428.     /**
  429.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\AccessLevel", mappedBy="productVariant")
  430.      */
  431.     private $accessLevel;
  432.     /**
  433.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\OrderProductVariant", mappedBy="productVariant")
  434.      */
  435.     private $orderProductVariant;
  436.     /**
  437.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\ProductPackItem", mappedBy="productVariant")
  438.      */
  439.     private $productPackItem;
  440.     /**
  441.      * @ORM\OneToMany(targetEntity="EventProductVariantGroupItem", mappedBy="productVariant")
  442.      */
  443.     private $productVariantGroupItems;
  444.     /**
  445.      * @ORM\OneToMany(targetEntity="EventProductVariantGroup", mappedBy="productVariant", cascade={"persist"}, orphanRemoval=true)
  446.      */
  447.     private $productVariantGroups;
  448.     /**
  449.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\CartParticipant", mappedBy="primaryProductVariant")
  450.      */
  451.     private $cartParticipantsPrimary;
  452.     /**
  453.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\Participants", mappedBy="primaryProductVariant")
  454.      */
  455.     private $participantsPrimary;
  456.     /**
  457.      * @ORM\Column(type="datetime")
  458.      */
  459.     private $createdAt;
  460.     /**
  461.      * @ORM\Column(type="datetime", nullable=true)
  462.      */
  463.     private $updatedAt;
  464.     /**
  465.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\ProductVariantDescription", mappedBy="productVariant", orphanRemoval=true, cascade={"persist"})
  466.      */
  467.     private $productVariantDescriptions;
  468.     /**
  469.      * @var string
  470.      *
  471.      * @ORM\Column(type="string", length=255, nullable=true)
  472.      */
  473.     private $subscriptionType;
  474.     /**
  475.      * @var string
  476.      *
  477.      * @ORM\Column(type="string", length=255, nullable=true)
  478.      */
  479.     private $subscriptionPlan;
  480.     /**
  481.      * @ORM\Column(type="string", length=255, nullable=true)
  482.      * @var string
  483.      */
  484.     private $image;
  485.     /**
  486.      * @Vich\UploadableField(mapping="product_images", fileNameProperty="image")
  487.      * @var File
  488.      */
  489.     private $imageFile;
  490.     /**
  491.      * @ORM\Column(type="boolean", options={"default": 0})
  492.      */
  493.     private $defaultProductAssociation 0;
  494.     /**
  495.      * @ORM\Column(type="boolean", options={"default": 0})
  496.      */
  497.     private $promoted 0;
  498.     /**
  499.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\Alert", mappedBy="productVariant")
  500.      */
  501.     private $alerts;
  502.     /**
  503.      * @ORM\Column(type="boolean", options={"default": 0})
  504.      */
  505.     private $isPublished 0;
  506.     /**
  507.      * @ORM\Column(type="boolean", nullable=true)
  508.      */
  509.     private $isGiftable;
  510.     /**
  511.      * @ORM\Column(type="boolean", nullable=true)
  512.      */
  513.     private $isHidden;
  514.     /**
  515.      * @ORM\Column(type="boolean", options={"default": 0})
  516.      */
  517.     private $isPartialPaymentActive 0;
  518.     /**
  519.      * @ORM\ManyToOne(targetEntity="App\Entity\Gos\Country", inversedBy="productVariants")
  520.      * @ORM\JoinColumn()
  521.      */
  522.     private $country;
  523.     /**
  524.      * @ORM\Column(type="integer", options={"default" : 1})
  525.      */
  526.     private $installmentAmount;
  527.     /**
  528.      * @ORM\ManyToOne(targetEntity="App\Entity\Gos\PaymentType", inversedBy="productVariant")
  529.      * @ORM\JoinTable()
  530.      */
  531.     private $paymentType;
  532.     /**
  533.      * @ORM\Column(type="integer", options={"default": 0})
  534.      */
  535.     private $extendedPaymentTime 0;
  536.     /**
  537.      * @ORM\ManyToOne(targetEntity="ProductSubscriptionType", inversedBy="productVariant")
  538.      * @ORM\JoinColumn()
  539.      */
  540.     private $productSubscriptionType;
  541.     /**
  542.      * @ORM\Column(type="text", nullable=true)
  543.      */
  544.     private $summaryUpsellingInfo;
  545.     /**
  546.      * @ORM\ManyToMany(targetEntity="App\Entity\Gos\ProductAssociation", mappedBy="productVariants")
  547.      */
  548.     private $productAssociation;
  549.     /**
  550.      * @ORM\ManyToMany(targetEntity="ProductVariantPack", mappedBy="productVariants")
  551.      */
  552.     private $productVariantPacks;
  553.     /**
  554.      * @ORM\Column(type="integer", nullable=true)
  555.      */
  556.     private $trialDuration;
  557.     /**
  558.      * @ORM\ManyToMany(targetEntity="App\Entity\Gos\Uniqskills\Course", inversedBy="productVariants")
  559.      * @ORM\JoinTable(
  560.      *     name="product_variant_course",
  561.      *     joinColumns={@ORM\JoinColumn(name="product_variant_id", referencedColumnName="id")},
  562.      *     inverseJoinColumns={@ORM\JoinColumn(name="course_id", referencedColumnName="id")}
  563.      * )
  564.      */
  565.     private $courses;
  566.     /**
  567.      * @ORM\ManyToMany(targetEntity="App\Entity\Gos\Uniqskills\Package", inversedBy="productVariants")
  568.      * @ORM\JoinTable(
  569.      *     name="product_variant_package",
  570.      *     joinColumns={@ORM\JoinColumn(name="product_variant_id", referencedColumnName="id")},
  571.      *     inverseJoinColumns={@ORM\JoinColumn(name="package_id", referencedColumnName="id")}
  572.      * )
  573.      */
  574.     private $packages;
  575.     /**
  576.      * @ORM\Column(type="boolean", nullable=true)
  577.      */
  578.     private $requiredPWZ;
  579.     /**
  580.      * @ORM\Column(type="string", length=255, nullable=true)
  581.      */
  582.     private $promoName;
  583.     /**
  584.      * @ORM\ManyToMany(targetEntity="App\Entity\Gos\File", inversedBy="productVariants")
  585.      * @ORM\JoinTable(
  586.      *     name="product_variant_file",
  587.      *     joinColumns={@ORM\JoinColumn(name="product_variant_id", referencedColumnName="id")},
  588.      *     inverseJoinColumns={@ORM\JoinColumn(name="file_id", referencedColumnName="id")}
  589.      * )
  590.      */
  591.     private $files;
  592.     /**
  593.      * @ORM\Column(type="boolean", nullable=true)
  594.      */
  595.     private $isDigital;
  596.     /**
  597.      * @ORM\Column(type="boolean", nullable=true)
  598.      */
  599.     private $blockAccess;
  600.     /**
  601.      * @var int
  602.      *
  603.      * @ORM\Column(type="integer", nullable=true)
  604.      */
  605.     private $mantisUserId;
  606.     /**
  607.      * @ORM\OneToOne(targetEntity="App\Entity\Gos\ProductVariant", inversedBy="originalProductVariant")
  608.      */
  609.     private $productVariantEuVat;
  610.     /**
  611.      * @ORM\OneToOne(targetEntity="App\Entity\Gos\ProductVariant", mappedBy="productVariantEuVat")
  612.      */
  613.     private $originalProductVariant;
  614.     /**
  615.      * @ORM\ManyToOne(targetEntity="App\Entity\Gos\GoogleMerchantFeed", inversedBy="associatedVariants", cascade={"persist"}, fetch="EAGER")
  616.      * @ORM\JoinColumn(name="feed_id", referencedColumnName="id")
  617.      */
  618.     private $googleMerchantFeed;
  619.     /**
  620.      * @ORM\Column(type="integer", nullable=true)
  621.      */
  622.     private $salesVariantBasedTrialDuration;
  623.     /**
  624.      * @ORM\Column(type="string", length=255, nullable=true)
  625.      */
  626.     private $salesVariantBasedTrialInfo;
  627.     /**
  628.      * @ORM\Column(type="boolean", nullable=true)
  629.      */
  630.     private $accessForPaidOnly;
  631.     /**
  632.      * @ORM\Column(type="text", nullable=true)
  633.      */
  634.     private $additionalTextInCart;
  635.     /**
  636.      * @ORM\Column(type="boolean", nullable=true)
  637.      */
  638.     private $isRecurringSubscription;
  639.     /**
  640.      * @ORM\Column(type="string", length=255, nullable=true)
  641.      */
  642.     private $documentDistributionChannel;
  643.     /**
  644.      * @ORM\Column(type="boolean", nullable=true)
  645.      */
  646.     private $hiddenInSBTillPaid;
  647.     /**
  648.      * @ORM\Column(type="boolean", nullable=true)
  649.      */
  650.     private $participantsAddress;
  651.     /**
  652.      * @ORM\Column(type="string", length=255, nullable=true)
  653.      */
  654.     private $participantsAnnouncement;
  655.     /**
  656.      * @ORM\Column(type="boolean", nullable=true, options={"default": 0})
  657.      */
  658.     private $mustHaveAllExclusiveVariants false;
  659.     /**
  660.      * @ORM\OneToOne(targetEntity=Events::class, inversedBy="productVariant", fetch="EAGER")
  661.      * @ORM\JoinColumn(name="events_id", referencedColumnName="id", onDelete="SET NULL")
  662.      */
  663.     private $event;
  664.     /**
  665.      * @ORM\OneToMany(targetEntity=LeadFormResponse::class, mappedBy="productVariant")
  666.      */
  667.     private $leadFormResponses;
  668.     /**
  669.      * @ORM\ManyToMany(targetEntity=LeadFormResponse::class, mappedBy="productVariantsValidation")
  670.      */
  671.     private $leadFormResponseValidations;
  672.     /**
  673.      * @ORM\ManyToMany(targetEntity=NewsletterTemplate::class, mappedBy="productVariantsValidation")
  674.      */
  675.     private $newsletterTemplateValidations;
  676.     /**
  677.      * @ORM\Column(type="string", length=255, nullable=true)
  678.      */
  679.     private $TradeNameSM;
  680.     /**
  681.      * @ORM\Column(type="string", length=255, nullable=true)
  682.      */
  683.     private $commentForMantis;
  684.     /**
  685.      * @ORM\OneToMany(targetEntity=CalendarEvent::class, mappedBy="productVariant")
  686.      */
  687.     private $calendarEvents;
  688.     /**
  689.      * GOS-1481 [only for US] The time (in days) after which the price to be paid returns to the initial
  690.      * @ORM\Column(type="integer", nullable=true)
  691.      */
  692.     private $couponLifetime;
  693.     /**
  694.      * @ORM\Column(type="boolean", nullable=true)
  695.      */
  696.     private $freshMailIntegration;
  697.     /**
  698.      * @ORM\Column(type="string", length=255, nullable=true)
  699.      */
  700.     private $freshMailRecipientListHash;
  701.     /**
  702.      * @ORM\Column(type="text", nullable=true)
  703.      */
  704.     private $orderOnSiteContent;
  705.     /**
  706.      * @ORM\Column(type="boolean", options={"default": 0})
  707.      */
  708.     private $manualUserVerification 0;
  709.     /**
  710.      * @ORM\OneToOne(targetEntity=ProductVariantOrderQuantity::class, mappedBy="productVariant", cascade={"persist", "remove"})
  711.      */
  712.     private $productVariantOrderQuantity;
  713.     /**
  714.      * @ORM\OneToOne(targetEntity=ProductVariantVirtualCurrencySettings::class, mappedBy="productVariant", cascade={"persist", "remove"})
  715.      */
  716.     private $productVariantVirtualCurrencySettings;
  717.     /**
  718.      * @ORM\ManyToMany(targetEntity=PaymentReminders::class, mappedBy="productVariant", orphanRemoval=true, cascade={"persist"})
  719.      */
  720.     private $paymentReminders;
  721.     /**
  722.      * @ORM\OneToMany(targetEntity=ProductVariantUpselling::class, mappedBy="productVariant", orphanRemoval=true, cascade={"persist"})
  723.      */
  724.     private $productVariantUpsellings;
  725.     /**
  726.      * @ORM\OneToMany(targetEntity=ProductVariantUpselling::class, mappedBy="promotedProduct", orphanRemoval=true, cascade={"persist"})
  727.      */
  728.     private $productVariantPromoted;
  729.     /**
  730.      * @ORM\OneToMany(targetEntity=FastLeadTemplate::class, mappedBy="productVariant")
  731.      */
  732.     private $fastLeadTemplates;
  733.     /**
  734.      * @ORM\Column(type="string", length=255, nullable=true)
  735.      */
  736.     private $imageUrlUpselling;
  737.     /**
  738.      * @ORM\Column(type="boolean", nullable=true)
  739.      */
  740.     private $useUploadedImageUpselling;
  741.     /**
  742.      * @ORM\Column(type="string", length=255, nullable=true)
  743.      * @var string
  744.      */
  745.     private $uploadedImageUpselling;
  746.     /**
  747.      * @Vich\UploadableField(mapping="upselling_image", fileNameProperty="uploadedImageUpselling")
  748.      */
  749.     private $imageFileUpselling;
  750.     /**
  751.      * @ORM\Column(type="text", nullable=true)
  752.      */
  753.     private $descriptionUpselling;
  754.     /**
  755.      * @ORM\Column(type="string", length=255, nullable=true)
  756.      */
  757.     private $linkToProductUpselling;
  758.     /**
  759.      * @ORM\ManyToMany(targetEntity=Certificate::class, inversedBy="productVariants")
  760.      */
  761.     private $certificates;
  762.     /**
  763.      * @ORM\Column(type="boolean", nullable=true)
  764.      */
  765.     private $showButtonAdditionalAddress;
  766.     /**
  767.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\Omnibus", mappedBy="productVariant", orphanRemoval=true, cascade={"persist"})
  768.      */
  769.     private $omnibus;
  770.     /**
  771.      * @ORM\Column(type="integer", nullable=true)
  772.      */
  773.     private $maxQuantityInCart;
  774.     /**
  775.      * @ORM\ManyToMany(targetEntity=ShippingType::class, inversedBy="productVariants")
  776.      */
  777.     private $shippingTypes;
  778.     /**
  779.      * @ORM\OneToOne(targetEntity=ProductVariantSize::class, cascade={"persist", "remove"})
  780.      */
  781.     private $size;
  782.     /**
  783.      * @ORM\Column(type="boolean", options={"default": 0})
  784.      */
  785.     private $excludeDefaultShippingType false;
  786.     /**
  787.      * @ORM\Column(type="boolean", options={"default": 0})
  788.      */
  789.     private $isCompletelyDigital false;
  790.     /**
  791.      * @ORM\ManyToMany(targetEntity=CertificatePathElement::class, mappedBy="productVariants")
  792.      */
  793.     private $certificatePathElements;
  794.     /**
  795.      * @ORM\Column(type="boolean", nullable=true)
  796.      */
  797.     private $hasPaperRelease;
  798.     /**
  799.      * @ORM\Column(type="boolean", nullable=true)
  800.      */
  801.     private $isNPWZRequired;
  802.     /**
  803.      * @ORM\Column(type="boolean", options={"default": 0})
  804.      */
  805.     private $isSaleDisabled false;
  806.     /**
  807.      * @ORM\Column(type="text", nullable=true)
  808.      */
  809.     private $technicalInformationForMailTele;
  810.     /**
  811.      * @ORM\OneToMany(targetEntity=AdditionalFile::class, mappedBy="productVariant", orphanRemoval=true, cascade={"persist"}, fetch="EAGER")
  812.      */
  813.     private $additionalFiles;
  814.     /**
  815.      * @ORM\OneToOne(targetEntity=SalesManagoProductVariant::class, mappedBy="productVariant", cascade={"persist", "remove"})
  816.      */
  817.     private $salesManagoProductVariant;
  818.     /**
  819.      * @ORM\ManyToMany(targetEntity=UserFlag::class, mappedBy="productVariants")
  820.      */
  821.     private $userFlags;
  822.     /**
  823.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\ProductVariantReviewLink", mappedBy="productVariant", orphanRemoval=true, cascade={"persist"})
  824.      */
  825.     private $productVariantReviewLinks;
  826.     /**
  827.      * @ORM\ManyToOne(targetEntity=ProductVariant::class, inversedBy="substitution")
  828.      */
  829.     private $original;
  830.     /**
  831.      * @ORM\OneToMany(targetEntity=ProductVariant::class, mappedBy="original")
  832.      */
  833.     private $substitution;
  834.     /**
  835.      * @ORM\OneToMany(targetEntity=AdditionalOptionsByClientType::class, mappedBy="productVariant", orphanRemoval=true, cascade={"persist"}, fetch="EAGER")
  836.      */
  837.     private $additionalOptionsByClientTypes;
  838.     /**
  839.      * @ORM\OneToOne(targetEntity=ProductVariant::class, inversedBy="givenProductVariantForAdditionalAccess", cascade={"persist", "remove"})
  840.      */
  841.     private $additionalAccessProductVariant;
  842.     /**
  843.      * @ORM\OneToOne(targetEntity=ProductVariant::class, mappedBy="additionalAccessProductVariant", cascade={"persist", "remove"})
  844.      */
  845.     private $givenProductVariantForAdditionalAccess;
  846.     /**
  847.      * @ORM\Column(type="text", nullable=true)
  848.      */
  849.     private $additionalInformationForMail;
  850.     /**
  851.      * @ORM\Column(type="integer", nullable=true)
  852.      */
  853.     private $descriptionUpsellingMaxHeight;
  854.     /**
  855.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\ProductVariantEventInfo", mappedBy="productVariant", orphanRemoval=true, cascade={"persist"})
  856.      */
  857.     private $productVariantEventInfos;
  858.     /**
  859.      * @ORM\ManyToOne(targetEntity="App\Entity\Gos\ProductVariant")
  860.      *
  861.      * KtĂłry wariant BC jest odpowiednikiem wariantu FO
  862.      */
  863.     private ?ProductVariant $targetVariant;
  864.     private bool $isPriceGrossCalculated false;
  865.     private int $vatRate 0;
  866.     public function setBCDefaultSettings(
  867.         ?PaymentMethod $paymentMethod,
  868.         ?PaymentType $paymentType
  869.     ): self
  870.     {
  871.         $this
  872.             ->setPriceGross(null//dynamically calculated from net price and VAT rate
  873.             ->setIsGross(false)
  874.             ->setIsDefault(true)
  875.             ->setShowGrossPrice(false)
  876.             ->setMaxUsers(1)
  877.             ->setBuyMaxOne(true)
  878.             ->setPostageType(null)
  879.             ->setDocumentDistributionChannel('E')
  880.             ->addPaymentMethod($paymentMethod)
  881.             ->setPaymentType($paymentType);
  882.         return $this;
  883.     }
  884.     /** @ORM\PrePersist() */
  885.     public function prePersist()
  886.     {
  887.         $this->createdAt = new \DateTime();
  888.         if (is_null($this->installmentAmount))
  889.         {
  890.             $this->installmentAmount 1;
  891.         }
  892.     }
  893.     /** @ORM\PreUpdate() */
  894.     public function preUpdate()
  895.     {
  896.         foreach ($this->paymentMethod as $paymentMethod)
  897.         {
  898.             if (!$this->isActive()
  899.                 || ((($this->getCourses()->isEmpty() && $this->stateIsForcedReservation)
  900.                         || $this->stateIsProductTest) && $paymentMethod->getSlug() !== 'invoice')
  901.             )
  902.             {
  903.                 $this->removePaymentMethod($paymentMethod);
  904.             }
  905.         }
  906.         $this->updatedAt = new \DateTime();
  907.     }
  908.     public function __toString()
  909.     {
  910.         if (empty($this->productVariantNoComplete))
  911.         {
  912.             return (string)$this->id ' ' $this->workingTitle;
  913.         }
  914.         else
  915.         {
  916.             return (string)$this->productVariantNoComplete ' ' $this->workingTitle;
  917.         }
  918.     }
  919.     public function checkIfIsDefaultChecked($isFirst false)
  920.     {
  921.         if ($this->getDefaultProductAssociation())
  922.         {
  923.             return true;
  924.         }
  925.         if ($this->getMasterProduct()->getProductAssociation() instanceof ProductAssociation)
  926.         {
  927.             /** @var ProductVariant $productVariant */
  928.             foreach ($this->getMasterProduct()->getProductAssociation()->getPublishedVariants() as $productVariant)
  929.             {
  930.                 if ($productVariant->getDefaultProductAssociation())
  931.                 {
  932.                     return false;
  933.                 }
  934.             }
  935.             if ($isFirst)
  936.             {
  937.                 return true;
  938.             }
  939.         }
  940.         return false;
  941.     }
  942.     public function getFullPrice($type 'gross'$useCommaSeparator false)
  943.     {
  944.         $price $type == 'gross' $this->getPriceGross() : $this->getPriceNet();
  945.         foreach ($this->getVirtualVariant() as $additional)
  946.         {
  947.             $price += $type == 'gross' $additional->getPriceGross() : $additional->getPriceNet();
  948.         }
  949.         if ($useCommaSeparator)
  950.         {
  951.             $price number_format($price2',''');
  952.         }
  953.         return $price;
  954.     }
  955.     public function getFullPriceAfterCoupon($type 'gross', ?Coupon $coupon$useCommaSeparator false)
  956.     {
  957.         $priceNet   $this->getFullPrice('net');
  958.         $priceGross $this->getFullPrice('gross');
  959.         if ($coupon && $coupon->getCouponType()->getId() == 1)
  960.         {
  961.             if ($coupon->getIsGross())
  962.             {
  963.                 $discount   = (($this->getFullPrice('gross') * $coupon->getDiscount()) / 100);
  964.                 $priceGross $this->getFullPrice('gross') - $discount;
  965.                 $priceNet   $priceGross - (($priceGross $this->getVatRate()) / 100);
  966.             }
  967.             else
  968.             {
  969.                 $discount   = (($this->getFullPrice('net') * $coupon->getDiscount()) / 100);
  970.                 $priceNet   $this->getFullPrice('net') - $discount;
  971.                 $priceGross = (($priceNet $this->getVatRate()) / 100) + $priceNet;
  972.             }
  973.         }
  974.         elseif ($coupon && $coupon->getCouponType()->getId() == 2)
  975.         {
  976.             if ($coupon->getIsGross())
  977.             {
  978.                 $priceGross $this->getFullPrice('gross') - $coupon->getDiscount();
  979.                 $priceNet   $priceGross - (($priceGross $this->getVatRate()) / 100);
  980.             }
  981.             else
  982.             {
  983.                 $priceNet   $this->getFullPrice('net') - $coupon->getDiscount();
  984.                 $priceGross = (($priceNet $this->getVatRate()) / 100) + $priceNet;
  985.             }
  986.         }
  987.         $price round(($type == 'gross') ? $priceGross $priceNet2);
  988.         if ($useCommaSeparator)
  989.         {
  990.             $price number_format($price2',''');
  991.         }
  992.         return $price;
  993.     }
  994.     public function isUniqskillsMultiUserCourse()
  995.     {
  996.         return $this->getIsUniqskillsProduct()
  997.             && $this->getMaxUsers() > 1
  998.             && $this->getBuyMaxOne() === false;
  999.     }
  1000.     public function isEvent()
  1001.     {
  1002.         return $this->getMasterProduct() && $this->getMasterProduct()->getIsEvent();
  1003.     }
  1004.     /**
  1005.      * Check productVariant and AdditionalProductVariants is stateIsAvailible
  1006.      *
  1007.      * @return bool
  1008.      */
  1009.     public function isActive()
  1010.     {
  1011.         // MT-948 - make partial payments work only with selected PVs
  1012.         if ($this->hasPartialPayment() && !$this->getIsPartialPaymentActive())
  1013.         {
  1014.             return false;
  1015.         }
  1016.         if (!$this->checkPaymentMethod())
  1017.         {
  1018.             return false;
  1019.         }
  1020.         if (!$this->checkState())
  1021.         {
  1022.             return false;
  1023.         }
  1024.         if (!$this->checkQuantity())
  1025.         {
  1026.             return false;
  1027.         }
  1028.         if (!$this->checkQuantityVirtualVariant())
  1029.         {
  1030.             return false;
  1031.         }
  1032.         if ($this->isSaleDisabled())
  1033.         {
  1034.             return false;
  1035.         }
  1036.         return true;
  1037.     }
  1038.     public function checkState()
  1039.     {
  1040.         if (!$this->getStateIsAvailible())
  1041.         {
  1042.             return false;
  1043.         }
  1044.         foreach ($this->getVirtualVariant() as $virtualVariant)
  1045.         {
  1046.             if (!$virtualVariant->getStateIsAvailible())
  1047.             {
  1048.                 return false;
  1049.             }
  1050.         }
  1051.         return true;
  1052.     }
  1053.     public function hasPartialPayment(): bool
  1054.     {
  1055.         return ($this->getPaymentType() && $this->getPaymentType()->getSlug() === 'partial-payment');
  1056.     }
  1057.     public function checkPaymentMethod()
  1058.     {
  1059.         foreach ($this->getAdditionalOptionsByClientTypes() as $additionalOptionsByClientType)
  1060.         {
  1061.             if (count($additionalOptionsByClientType->getPaymentMethod()) > 0)
  1062.             {
  1063.                 return true;
  1064.             }
  1065.         }
  1066.         return false;
  1067.     }
  1068.     public function checkQuantity()
  1069.     {
  1070.         if ($this->getQuantity() == || empty($this->getQuantity()))
  1071.         {
  1072.             return true;
  1073.         }
  1074.         if ($this->getQuantity() > $this->getOrderQuantity())
  1075.         {
  1076.             return true;
  1077.         }
  1078.         return false;
  1079.     }
  1080.     public function checkQuantityVirtualVariant()
  1081.     {
  1082.         foreach ($this->getVirtualVariant() as $virtualVariant)
  1083.         {
  1084.             if (
  1085.                 $virtualVariant->getQuantity() != 0
  1086.                 && !empty($virtualVariant->getQuantity())
  1087.                 && $virtualVariant->getQuantity() < $virtualVariant->getOrderQuantity()
  1088.             )
  1089.             {
  1090.                 return false;
  1091.             }
  1092.         }
  1093.         return true;
  1094.     }
  1095.     public function incrementOrderQuantity(): self
  1096.     {
  1097.         $productVariantOrderQuantity $this->getProductVariantOrderQuantity();
  1098.         if (is_null($productVariantOrderQuantity))
  1099.         {
  1100.             $productVariantOrderQuantity = new ProductVariantOrderQuantity();
  1101.             $this->setProductVariantOrderQuantity($productVariantOrderQuantity);
  1102.         }
  1103.         $productVariantOrderQuantity->incrementOrderQuantity();
  1104.         return $this;
  1105.     }
  1106.     public function getQuantityProductsRemainingForSale()
  1107.     {
  1108.         if ($this->getQuantity() == || empty($this->getQuantity()))
  1109.         {
  1110.             return null;
  1111.         }
  1112.         $result $this->getQuantity() - $this->getOrderQuantity();
  1113.         return $result $result 0;
  1114.     }
  1115.     public function getPriceNetDiscountAmount($fullPriceGross$discount$isGross true$fullPriceNet 0)
  1116.     {
  1117.         if ($isGross)
  1118.         {
  1119.             if (empty($fullPriceGross))
  1120.             {
  1121.                 return 0;
  1122.             }
  1123.             $discountValue  = ($this->getPriceGross() / $fullPriceGross) * $discount;
  1124.             $priceGross     $this->getPriceGross() - $discountValue;
  1125.             $vatRate        $this->getVatRate();
  1126.             $vat            = ($priceGross $vatRate) / (100 $vatRate);
  1127.             $priceNet       $priceGross $vat;
  1128.         }
  1129.         else
  1130.         {
  1131.             if (empty($fullPriceNet))
  1132.             {
  1133.                 return 0;
  1134.             }
  1135.             $discountValue = ($this->getPriceNet() / $fullPriceNet) * $discount;
  1136.             $priceNet      $this->getPriceNet() - $discountValue;
  1137.         }
  1138.         return round($priceNet2);
  1139.     }
  1140.     public function getPriceGrossDiscountAmount($fullPriceNet$discount$isGross false$fullPriceGross 0)
  1141.     {
  1142.         if ($isGross)
  1143.         {
  1144.             if (empty($fullPriceGross))
  1145.             {
  1146.                 return 0;
  1147.             }
  1148.             $discountValue  = ($this->getPriceGross() / $fullPriceGross) * $discount;
  1149.             $priceGross     $this->getPriceGross() - $discountValue;
  1150.         }
  1151.         else
  1152.         {
  1153.             if (empty($fullPriceNet))
  1154.             {
  1155.                 return 0;
  1156.             }
  1157.             $discountValue = ($this->getPriceNet() / $fullPriceNet) * $discount;
  1158.             $priceNet      $this->getPriceNet() - $discountValue;
  1159.             $vat           = ($priceNet $this->getVatRate()) / 100;
  1160.             $priceGross    $priceNet $vat;
  1161.         }
  1162.         return round($priceGross2);
  1163.     }
  1164.     public function isPhysical(): bool
  1165.     {
  1166.         if ($this->isVirtual)
  1167.         {
  1168.             return false;
  1169.         }
  1170.         if ($this->totalWeight == 0)
  1171.         {
  1172.             return false;
  1173.         }
  1174.         return true;
  1175.     }
  1176.     public function getAdditionalOptionsByClientType(?ClientType $clientType null): ?AdditionalOptionsByClientType
  1177.     {
  1178.         if (is_null($clientType))
  1179.         {
  1180.             return null;
  1181.         }
  1182.         foreach ($this->getAdditionalOptionsByClientTypes() as $additionalOptionsByClientType)
  1183.         {
  1184.             if ($additionalOptionsByClientType->getClientType() === $clientType)
  1185.             {
  1186.                 return $additionalOptionsByClientType;
  1187.             }
  1188.         }
  1189.         return null;
  1190.     }
  1191.     public function getPaymentMethodsByClientType(?ClientType $clientType): array
  1192.     {
  1193.         $additionalOptionsByClientType $this->getAdditionalOptionsByClientType($clientType);
  1194.         return $additionalOptionsByClientType $additionalOptionsByClientType->getPaymentMethod()->toArray() : [];
  1195.     }
  1196.     public function checkIfProductVariantHavePaymentMethod(?ClientType $clientTypestring $paymentMethodSlug): bool
  1197.     {
  1198.         $paymentMethods $this->getPaymentMethodsByClientType($clientType);
  1199.         foreach ($paymentMethods as $paymentMethod)
  1200.         {
  1201.             if ($paymentMethod->getSlug() === $paymentMethodSlug)
  1202.             {
  1203.                 return true;
  1204.             }
  1205.         }
  1206.         return false;
  1207.     }
  1208.     //------------------------------ setters & getters
  1209.     /**
  1210.      * Constructor
  1211.      */
  1212.     public function __construct()
  1213.     {
  1214.         $this->product                       = new ArrayCollection();
  1215.         $this->coupon                        = new ArrayCollection();
  1216.         $this->applicationCoupon             = new ArrayCollection();
  1217.         $this->gratisCoupon                  = new ArrayCollection();
  1218.         $this->bundleCoupon                  = new ArrayCollection();
  1219.         $this->portalSettings                = new ArrayCollection();
  1220.         $this->virtualVariant                = new ArrayCollection();
  1221.         $this->physicalVariant               = new ArrayCollection();
  1222.         $this->productCart                   = new ArrayCollection();
  1223.         $this->paymentMethod                 = new ArrayCollection();
  1224.         $this->clientType                    = new ArrayCollection();
  1225.         $this->terms                         = new ArrayCollection();
  1226.         $this->accessLevel                   = new ArrayCollection();
  1227.         $this->salesManagoCoupons            = new ArrayCollection();
  1228.         $this->salesManagoCatalogs           = new ArrayCollection();
  1229.         $this->salesManagoGratisCoupons      = new ArrayCollection();
  1230.         $this->orderProductVariant           = new ArrayCollection();
  1231.         $this->couponPack                    = new ArrayCollection();
  1232.         $this->productPackItem               = new ArrayCollection();
  1233.         $this->productAssociation            = new ArrayCollection();
  1234.         $this->productVariantGroupItems      = new ArrayCollection();
  1235.         $this->productVariantGroups          = new ArrayCollection();
  1236.         $this->cartParticipantsPrimary       = new ArrayCollection();
  1237.         $this->participantsPrimary           = new ArrayCollection();
  1238.         $this->productVariantDescriptions    = new ArrayCollection();
  1239.         $this->alerts                        = new ArrayCollection();
  1240.         $this->multiDiscount                 = new ArrayCollection();
  1241.         $this->paymentSystem                 = new ArrayCollection();
  1242.         $this->productVariantPacks           = new ArrayCollection();
  1243.         $this->courses                       = new ArrayCollection();
  1244.         $this->packages                      = new ArrayCollection();
  1245.         $this->files                         = new ArrayCollection();
  1246.         $this->leadFormResponses             = new ArrayCollection();
  1247.         $this->leadFormResponseValidations   = new ArrayCollection();
  1248.         $this->newsletterTemplateValidations = new ArrayCollection();
  1249.         $this->calendarEvents                = new ArrayCollection();
  1250.         $this->paymentReminders              = new ArrayCollection();
  1251.         $this->productVariantUpsellings      = new ArrayCollection();
  1252.         $this->productVariantPromoted        = new ArrayCollection();
  1253.         $this->fastLeadTemplates             = new ArrayCollection();
  1254.         $this->omnibus                       = new ArrayCollection();
  1255.         $this->shippingTypes                 = new ArrayCollection();
  1256.         $this->certificates                  = new ArrayCollection();
  1257.         $this->certificatePathElements       = new ArrayCollection();
  1258.         $this->additionalFiles               = new ArrayCollection();
  1259.         $this->userFlags                     = new ArrayCollection();
  1260.         $this->productVariantReviewLinks     = new ArrayCollection();
  1261.         $this->substitution                  = new ArrayCollection();
  1262.         $this->additionalOptionsByClientTypes = new ArrayCollection();
  1263.         $this->productVariantEventInfos        = new ArrayCollection();
  1264.     }
  1265.     public function __clone()
  1266.     {
  1267.         $this->certificates = new ArrayCollection();
  1268.     }
  1269.     /**
  1270.      * Add product
  1271.      *
  1272.      * @param Product $product
  1273.      *
  1274.      * @return ProductVariant
  1275.      */
  1276.     public function addProduct(Product $product)
  1277.     {
  1278.         if (!$this->product->contains($product))
  1279.         {
  1280.             $product->addProductVariant($this);
  1281.             $this->product[] = $product;
  1282.         }
  1283.         return $this;
  1284.     }
  1285.     /**
  1286.      * Add physicalVariant
  1287.      *
  1288.      * @param ProductVariant $physicalVariant
  1289.      *
  1290.      * @return ProductVariant
  1291.      */
  1292.     public function addPhysicalVariant(ProductVariant $physicalVariant)
  1293.     {
  1294.         if (!$physicalVariant->getVirtualVariant()->contains($this)) {
  1295.             $physicalVariant->addVirtualVariant($this);
  1296.             $this->physicalVariant[] = $physicalVariant;
  1297.         }
  1298.         return $this;
  1299.     }
  1300.     /**
  1301.      * Remove product
  1302.      *
  1303.      * @param Product $product
  1304.      */
  1305.     public function removeProduct(Product $product)
  1306.     {
  1307.         $this->product->removeElement($product);
  1308.     }
  1309.     /**
  1310.      * Get product
  1311.      *
  1312.      * @return Collection
  1313.      */
  1314.     public function getProduct()
  1315.     {
  1316.         return $this->product;
  1317.     }
  1318.     /**
  1319.      * Get id
  1320.      *
  1321.      * @return integer
  1322.      */
  1323.     public function getId()
  1324.     {
  1325.         return $this->id;
  1326.     }
  1327.     /**
  1328.      * Set isVirtual
  1329.      *
  1330.      * @param boolean $isVirtual
  1331.      *
  1332.      * @return ProductVariant
  1333.      */
  1334.     public function setIsVirtual($isVirtual)
  1335.     {
  1336.         $this->isVirtual $isVirtual;
  1337.         return $this;
  1338.     }
  1339.     /**
  1340.      * Get isVirtual
  1341.      *
  1342.      * @return boolean
  1343.      */
  1344.     public function getIsVirtual()
  1345.     {
  1346.         return $this->isVirtual;
  1347.     }
  1348.     /**
  1349.      * Set productVariantNo
  1350.      *
  1351.      * @param integer $productVariantNo
  1352.      *
  1353.      * @return ProductVariant
  1354.      */
  1355.     public function setProductVariantNo($productVariantNo)
  1356.     {
  1357.         $this->productVariantNo $productVariantNo;
  1358.         return $this;
  1359.     }
  1360.     /**
  1361.      * Get productVariantNo
  1362.      *
  1363.      * @return integer
  1364.      */
  1365.     public function getProductVariantNo()
  1366.     {
  1367.         return $this->productVariantNo;
  1368.     }
  1369.     /**
  1370.      * Set productVariantId
  1371.      *
  1372.      * @param integer $productVariantId
  1373.      *
  1374.      * @return ProductVariant
  1375.      */
  1376.     public function setProductVariantId($productVariantId)
  1377.     {
  1378.         $this->productVariantId $productVariantId;
  1379.         return $this;
  1380.     }
  1381.     /**
  1382.      * Get productVariantId
  1383.      *
  1384.      * @return integer
  1385.      */
  1386.     public function getProductVariantId()
  1387.     {
  1388.         return $this->productVariantId;
  1389.     }
  1390.     /**
  1391.      * Set productVariantNoComplete
  1392.      *
  1393.      * @param string $productVariantNoComplete
  1394.      *
  1395.      * @return ProductVariant
  1396.      */
  1397.     public function setProductVariantNoComplete($productVariantNoComplete)
  1398.     {
  1399.         $this->productVariantNoComplete $productVariantNoComplete;
  1400.         return $this;
  1401.     }
  1402.     /**
  1403.      * Get productVariantNoComplete
  1404.      *
  1405.      * @return string
  1406.      */
  1407.     public function getProductVariantNoComplete()
  1408.     {
  1409.         return $this->productVariantNoComplete;
  1410.     }
  1411.     /**
  1412.      * Set productVariantKey
  1413.      *
  1414.      * @param string $productVariantKey
  1415.      *
  1416.      * @return ProductVariant
  1417.      */
  1418.     public function setProductVariantKey($productVariantKey)
  1419.     {
  1420.         $this->productVariantKey $productVariantKey;
  1421.         return $this;
  1422.     }
  1423.     /**
  1424.      * Get productVariantKey
  1425.      *
  1426.      * @return string
  1427.      */
  1428.     public function getProductVariantKey()
  1429.     {
  1430.         return $this->productVariantKey;
  1431.     }
  1432.     /**
  1433.      * Set variantState
  1434.      *
  1435.      * @param string $variantState
  1436.      *
  1437.      * @return ProductVariant
  1438.      */
  1439.     public function setVariantState($variantState)
  1440.     {
  1441.         $this->variantState $variantState;
  1442.         return $this;
  1443.     }
  1444.     /**
  1445.      * Get variantState
  1446.      *
  1447.      * @return string
  1448.      */
  1449.     public function getVariantState()
  1450.     {
  1451.         return $this->variantState;
  1452.     }
  1453.     /**
  1454.      * Set tittleOnInvoice
  1455.      *
  1456.      * @param string $tittleOnInvoice
  1457.      *
  1458.      * @return ProductVariant
  1459.      */
  1460.     public function setTittleOnInvoice(string $tittleOnInvoice): self
  1461.     {
  1462.         $this->tittleOnInvoice mb_substr($tittleOnInvoice0255'UTF-8');
  1463.         return $this;
  1464.     }
  1465.     /**
  1466.      * Get tittleOnInvoice
  1467.      *
  1468.      * @return string
  1469.      */
  1470.     public function getTittleOnInvoice()
  1471.     {
  1472.         return $this->tittleOnInvoice;
  1473.     }
  1474.     /**
  1475.      * Set workingTitle
  1476.      *
  1477.      * @param string $workingTitle
  1478.      *
  1479.      * @return ProductVariant
  1480.      */
  1481.     public function setWorkingTitle($workingTitle)
  1482.     {
  1483.         $this->workingTitle $workingTitle;
  1484.         return $this;
  1485.     }
  1486.     /**
  1487.      * Get workingTitle
  1488.      *
  1489.      * @return string
  1490.      */
  1491.     public function getWorkingTitle()
  1492.     {
  1493.         return $this->workingTitle;
  1494.     }
  1495.     /**
  1496.      * Set priceNet
  1497.      *
  1498.      * @param float $priceNet
  1499.      *
  1500.      * @return ProductVariant
  1501.      */
  1502.     public function setPriceNet($priceNet)
  1503.     {
  1504.         $this->priceNet $priceNet;
  1505.         return $this;
  1506.     }
  1507.     /**
  1508.      * Get priceNet
  1509.      *
  1510.      * @return float
  1511.      */
  1512.     public function getPriceNet()
  1513.     {
  1514.         return $this->priceNet;
  1515.     }
  1516.     /**
  1517.      * Set priceGross
  1518.      *
  1519.      * @param float|null $priceGross
  1520.      *
  1521.      * @return ProductVariant
  1522.      */
  1523.     public function setPriceGross($priceGross)
  1524.     {
  1525.         $this->priceGross $priceGross;
  1526.         return $this;
  1527.     }
  1528.     /**
  1529.      * UWAGA! Cena brutto jest dynamicznie obliczana na podstawie typu klienta i kraju w ProductVariantPriceListener
  1530.      *
  1531.      * @return float
  1532.      */
  1533.     public function getPriceGross()
  1534.     {
  1535.         return $this->priceGross;
  1536.     }
  1537.     /**
  1538.      * Set isGross
  1539.      *
  1540.      * @param boolean $isGross
  1541.      *
  1542.      * @return ProductVariant
  1543.      */
  1544.     public function setIsGross($isGross)
  1545.     {
  1546.         $this->isGross $isGross;
  1547.         return $this;
  1548.     }
  1549.     /**
  1550.      * Get isGross
  1551.      *
  1552.      * @return boolean
  1553.      */
  1554.     public function getIsGross()
  1555.     {
  1556.         return $this->isGross;
  1557.     }
  1558.     /**
  1559.      * Set currencyCode
  1560.      *
  1561.      * @param string $currencyCode
  1562.      *
  1563.      * @return ProductVariant
  1564.      */
  1565.     public function setCurrencyCode($currencyCode)
  1566.     {
  1567.         $this->currencyCode $currencyCode;
  1568.         return $this;
  1569.     }
  1570.     /**
  1571.      * Get currencyCode
  1572.      *
  1573.      * @return string
  1574.      */
  1575.     public function getCurrencyCode()
  1576.     {
  1577.         return $this->currencyCode;
  1578.     }
  1579.     /**
  1580.      * Set postageType
  1581.      *
  1582.      * @param string $postageType
  1583.      *
  1584.      * @return ProductVariant
  1585.      */
  1586.     public function setPostageType($postageType)
  1587.     {
  1588.         $this->postageType $postageType;
  1589.         return $this;
  1590.     }
  1591.     /**
  1592.      * Get postageType
  1593.      *
  1594.      * @return string
  1595.      */
  1596.     public function getPostageType()
  1597.     {
  1598.         return $this->postageType;
  1599.     }
  1600.     /**
  1601.      * Set postageCost
  1602.      *
  1603.      * @param float $postageCost
  1604.      *
  1605.      * @return ProductVariant
  1606.      */
  1607.     public function setPostageCost($postageCost)
  1608.     {
  1609.         $this->postageCost $postageCost;
  1610.         return $this;
  1611.     }
  1612.     /**
  1613.      * Get postageCost
  1614.      *
  1615.      * @return float
  1616.      */
  1617.     public function getPostageCost()
  1618.     {
  1619.         return $this->postageCost;
  1620.     }
  1621.     /**
  1622.      * Set totalWeight
  1623.      *
  1624.      * @param integer $totalWeight
  1625.      *
  1626.      * @return ProductVariant
  1627.      */
  1628.     public function setTotalWeight($totalWeight)
  1629.     {
  1630.         $this->totalWeight $totalWeight;
  1631.         return $this;
  1632.     }
  1633.     /**
  1634.      * Get totalWeight
  1635.      *
  1636.      * @return integer
  1637.      */
  1638.     public function getTotalWeight()
  1639.     {
  1640.         return $this->totalWeight;
  1641.     }
  1642.     /**
  1643.      * Set seriesType
  1644.      *
  1645.      * @param integer $seriesType
  1646.      *
  1647.      * @return ProductVariant
  1648.      */
  1649.     public function setSeriesType($seriesType)
  1650.     {
  1651.         $this->seriesType $seriesType;
  1652.         return $this;
  1653.     }
  1654.     /**
  1655.      * Get seriesType
  1656.      *
  1657.      * @return integer
  1658.      */
  1659.     public function getSeriesType()
  1660.     {
  1661.         return $this->seriesType;
  1662.     }
  1663.     /**
  1664.      * Set createdAt
  1665.      *
  1666.      * @param \DateTime $createdAt
  1667.      *
  1668.      * @return ProductVariant
  1669.      */
  1670.     public function setCreatedAt($createdAt)
  1671.     {
  1672.         $this->createdAt $createdAt;
  1673.         return $this;
  1674.     }
  1675.     /**
  1676.      * Get createdAt
  1677.      *
  1678.      * @return \DateTime
  1679.      */
  1680.     public function getCreatedAt()
  1681.     {
  1682.         return $this->createdAt;
  1683.     }
  1684.     /**
  1685.      * Set updatedAt
  1686.      *
  1687.      * @param \DateTime $updatedAt
  1688.      *
  1689.      * @return ProductVariant
  1690.      */
  1691.     public function setUpdatedAt($updatedAt)
  1692.     {
  1693.         $this->updatedAt $updatedAt;
  1694.         return $this;
  1695.     }
  1696.     /**
  1697.      * Get updatedAt
  1698.      *
  1699.      * @return \DateTime
  1700.      */
  1701.     public function getUpdatedAt()
  1702.     {
  1703.         return $this->updatedAt;
  1704.     }
  1705.     /**
  1706.      * Add virtualVariant
  1707.      *
  1708.      * @param ProductVariant $virtualVariant
  1709.      *
  1710.      * @return ProductVariant
  1711.      */
  1712.     public function addVirtualVariant(ProductVariant $virtualVariant)
  1713.     {
  1714.         $this->virtualVariant[] = $virtualVariant;
  1715.         return $this;
  1716.     }
  1717.     public function resetVirtualVariants(): self
  1718.     {
  1719.         foreach ($this->virtualVariant as $virtualVariant) {
  1720.             $virtualVariant->removePhysicalVariant($this);
  1721.         }
  1722.         return $this;
  1723.     }
  1724.     /**
  1725.      * Remove virtualVariant
  1726.      *
  1727.      * @param ProductVariant $virtualVariant
  1728.      */
  1729.     public function removeVirtualVariant(ProductVariant $virtualVariant)
  1730.     {
  1731.         $this->virtualVariant->removeElement($virtualVariant);
  1732.         return $this;
  1733.     }
  1734.     /**
  1735.      * Get virtualVariant
  1736.      *
  1737.      * @return Collection
  1738.      */
  1739.     public function getVirtualVariant()
  1740.     {
  1741.         return $this->virtualVariant;
  1742.     }
  1743.     /**
  1744.      * Remove physicalVariant
  1745.      *
  1746.      * @param ProductVariant $physicalVariant
  1747.      */
  1748.     public function removePhysicalVariant(ProductVariant $physicalVariant)
  1749.     {
  1750.         $physicalVariant->removeVirtualVariant($this);
  1751.         $this->physicalVariant->removeElement($physicalVariant);
  1752.     }
  1753.     /**
  1754.      * Get physicalVariant
  1755.      *
  1756.      * @return Collection
  1757.      */
  1758.     public function getPhysicalVariant()
  1759.     {
  1760.         return $this->physicalVariant;
  1761.     }
  1762.     /**
  1763.      * Add productCart
  1764.      *
  1765.      * @param \App\Entity\Gos\ProductCart $productCart
  1766.      *
  1767.      * @return ProductVariant
  1768.      */
  1769.     public function addProductCart(\App\Entity\Gos\ProductCart $productCart)
  1770.     {
  1771.         $this->productCart[] = $productCart;
  1772.         return $this;
  1773.     }
  1774.     /**
  1775.      * Remove productCart
  1776.      *
  1777.      * @param \App\Entity\Gos\ProductCart $cart
  1778.      */
  1779.     public function removeProductCart(\App\Entity\Gos\ProductCart $productCart)
  1780.     {
  1781.         $this->productCart->removeElement($productCart);
  1782.     }
  1783.     /**
  1784.      * Get productCart
  1785.      *
  1786.      * @return Collection
  1787.      */
  1788.     public function getProductCart()
  1789.     {
  1790.         return $this->productCart;
  1791.     }
  1792.     /**
  1793.      * Set isDefault
  1794.      *
  1795.      * @param boolean $isDefault
  1796.      *
  1797.      * @return ProductVariant
  1798.      */
  1799.     public function setIsDefault($isDefault)
  1800.     {
  1801.         $this->isDefault $isDefault;
  1802.         return $this;
  1803.     }
  1804.     /**
  1805.      * Get isDefault
  1806.      *
  1807.      * @return boolean
  1808.      */
  1809.     public function getIsDefault()
  1810.     {
  1811.         return $this->isDefault;
  1812.     }
  1813.     /**
  1814.      * Set paymentMethod
  1815.      *
  1816.      * @param PaymentMethod $paymentMethod
  1817.      *
  1818.      * @return ProductVariant
  1819.      */
  1820.     public function setPaymentMethod(PaymentMethod $paymentMethod null)
  1821.     {
  1822.         $this->paymentMethod $paymentMethod;
  1823.         return $this;
  1824.     }
  1825.     /**
  1826.      * Get paymentMethod
  1827.      *
  1828.      * @return Collection
  1829.      */
  1830.     public function getPaymentMethod()
  1831.     {
  1832.         return $this->paymentMethod;
  1833.     }
  1834.     /**
  1835.      * Add paymentMethod
  1836.      *
  1837.      * @param PaymentMethod $paymentMethod
  1838.      *
  1839.      * @return ProductVariant
  1840.      */
  1841.     public function addPaymentMethod(PaymentMethod $paymentMethod)
  1842.     {
  1843.         if (!$this->paymentMethod->contains($paymentMethod))
  1844.         {
  1845.             $this->paymentMethod[] = $paymentMethod;
  1846.         }
  1847.         return $this;
  1848.     }
  1849.     /**
  1850.      * Remove paymentMethod
  1851.      *
  1852.      * @param PaymentMethod $paymentMethod
  1853.      */
  1854.     public function removePaymentMethod(PaymentMethod $paymentMethod)
  1855.     {
  1856.         $this->paymentMethod->removeElement($paymentMethod);
  1857.     }
  1858.     /**
  1859.      * Add clientType
  1860.      *
  1861.      * @param ClientType $clientType
  1862.      *
  1863.      * @return ProductVariant
  1864.      */
  1865.     public function addClientType(ClientType $clientType)
  1866.     {
  1867.         if (!$this->clientType->contains($clientType)) {
  1868.             $this->clientType[] = $clientType;
  1869.         }
  1870.         return $this;
  1871.     }
  1872.     /**
  1873.      * Remove clientType
  1874.      *
  1875.      * @param ClientType $clientType
  1876.      */
  1877.     public function removeClientType(ClientType $clientType)
  1878.     {
  1879.         $this->clientType->removeElement($clientType);
  1880.     }
  1881.     /**
  1882.      * Get clientType
  1883.      *
  1884.      * @return Collection
  1885.      */
  1886.     public function getClientType()
  1887.     {
  1888.         return $this->clientType;
  1889.     }
  1890.     /**
  1891.      * Set taxFreeForBudgetUnit
  1892.      *
  1893.      * @param boolean $taxFreeForBudgetUnit
  1894.      *
  1895.      * @return ProductVariant
  1896.      */
  1897.     public function setTaxFreeForBudgetUnit($taxFreeForBudgetUnit)
  1898.     {
  1899.         $this->taxFreeForBudgetUnit $taxFreeForBudgetUnit;
  1900.         return $this;
  1901.     }
  1902.     /**
  1903.      * Get taxFreeForBudgetUnit
  1904.      *
  1905.      * @return boolean
  1906.      */
  1907.     public function getTaxFreeForBudgetUnit()
  1908.     {
  1909.         return $this->taxFreeForBudgetUnit;
  1910.     }
  1911.     /**
  1912.      * Set productNumberForBudgetUnit
  1913.      *
  1914.      * @param string $productNumberForBudgetUnit
  1915.      *
  1916.      * @return ProductVariant
  1917.      */
  1918.     public function setProductNumberForBudgetUnit($productNumberForBudgetUnit)
  1919.     {
  1920.         $this->productNumberForBudgetUnit $productNumberForBudgetUnit;
  1921.         return $this;
  1922.     }
  1923.     /**
  1924.      * Get productNumberForBudgetUnit
  1925.      *
  1926.      * @return string
  1927.      */
  1928.     public function getProductNumberForBudgetUnit()
  1929.     {
  1930.         return $this->productNumberForBudgetUnit;
  1931.     }
  1932.     /**
  1933.      * Add coupon
  1934.      *
  1935.      * @param Coupon $coupon
  1936.      *
  1937.      * @return ProductVariant
  1938.      */
  1939.     public function addCoupon(Coupon $coupon)
  1940.     {
  1941.         if (!$this->coupon->contains($coupon)) {
  1942.             $this->coupon[] = $coupon;
  1943.         }
  1944.         return $this;
  1945.     }
  1946.     /**
  1947.      * Remove coupon
  1948.      *
  1949.      * @param Coupon $coupon
  1950.      */
  1951.     public function removeCoupon(Coupon $coupon)
  1952.     {
  1953.         $this->coupon->removeElement($coupon);
  1954.     }
  1955.     /**
  1956.      * Get coupon
  1957.      *
  1958.      * @return Collection
  1959.      */
  1960.     public function getCoupon()
  1961.     {
  1962.         return $this->coupon;
  1963.     }
  1964.     /**
  1965.      * Add coupon
  1966.      *
  1967.      * @param ApplicationCoupon $applicationCoupon
  1968.      *
  1969.      * @return ProductVariant
  1970.      */
  1971.     public function addApplicationCoupon(ApplicationCoupon $applicationCoupon)
  1972.     {
  1973.         if (!$this->applicationCoupon->contains($applicationCoupon)) {
  1974.             $this->applicationCoupon[] = $applicationCoupon;
  1975.         }
  1976.         return $this;
  1977.     }
  1978.     /**
  1979.      * Remove coupon
  1980.      *
  1981.      * @param ApplicationCoupon $applicationCoupon
  1982.      */
  1983.     public function removeApplicationCoupon(ApplicationCoupon $applicationCoupon)
  1984.     {
  1985.         $this->applicationCoupon->removeElement($applicationCoupon);
  1986.     }
  1987.     /**
  1988.      * Get coupon
  1989.      *
  1990.      * @return Collection
  1991.      */
  1992.     public function getApplicationCoupon()
  1993.     {
  1994.         return $this->applicationCoupon;
  1995.     }
  1996.     /**
  1997.      * Add salesManagoCoupon
  1998.      *
  1999.      * @param SalesManagoCoupon $salesManagoCoupon
  2000.      *
  2001.      * @return ProductVariant
  2002.      */
  2003.     public function addSalesManagoCoupon(SalesManagoCoupon $salesManagoCoupon)
  2004.     {
  2005.         if (!$this->salesManagoCoupons->contains($salesManagoCoupon)) {
  2006.             $this->salesManagoCoupons[] = $salesManagoCoupon;
  2007.             $salesManagoCoupon->addProductVariant($this);
  2008.         }
  2009.         return $this;
  2010.     }
  2011.     /**
  2012.      * Remove salesManagoCoupon
  2013.      *
  2014.      * @param SalesManagoCoupon $salesManagoCoupon
  2015.      */
  2016.     public function removeSalesManagoCoupon(SalesManagoCoupon $salesManagoCoupon)
  2017.     {
  2018.         $this->salesManagoCoupons->removeElement($salesManagoCoupon);
  2019.     }
  2020.     /**
  2021.      * Get salesManagoCoupons
  2022.      *
  2023.      * @return Collection
  2024.      */
  2025.     public function getSalesManagoCoupons()
  2026.     {
  2027.         return $this->salesManagoCoupons;
  2028.     }
  2029.     /**
  2030.      * Add salesManagoGratisCoupon
  2031.      *
  2032.      * @param SalesManagoCoupon $salesManagoGratisCoupon
  2033.      *
  2034.      * @return ProductVariant
  2035.      */
  2036.     public function addSalesManagoGratisCoupon(SalesManagoCoupon $salesManagoGratisCoupon)
  2037.     {
  2038.         if (!$this->salesManagoGratisCoupons->contains($salesManagoGratisCoupon)) {
  2039.             $this->salesManagoGratisCoupons[] = $salesManagoGratisCoupon;
  2040.         }
  2041.         return $this;
  2042.     }
  2043.     /**
  2044.      * Remove salesManagoGratisCoupon
  2045.      *
  2046.      * @param SalesManagoCoupon $salesManagoGratisCoupon
  2047.      */
  2048.     public function removeSalesManagoGratisCoupon(SalesManagoCoupon $salesManagoGratisCoupon)
  2049.     {
  2050.         $this->salesManagoGratisCoupons->removeElement($salesManagoGratisCoupon);
  2051.     }
  2052.     /**
  2053.      * Get salesManagoGratisCoupons
  2054.      *
  2055.      * @return Collection
  2056.      */
  2057.     public function getSalesManagoGratisCoupons()
  2058.     {
  2059.         return $this->salesManagoGratisCoupons;
  2060.     }
  2061.     /**
  2062.      * Set tradeName
  2063.      *
  2064.      * @param string $tradeName
  2065.      *
  2066.      * @return ProductVariant
  2067.      */
  2068.     public function setTradeName($tradeName)
  2069.     {
  2070.         $this->tradeName $tradeName;
  2071.         if(!$this->getTradeNameSM()){
  2072.             $this->setTradeNameSM($tradeName);
  2073.         }
  2074.         return $this;
  2075.     }
  2076.     /**
  2077.      * Get tradeName
  2078.      *
  2079.      * @return string
  2080.      */
  2081.     public function getTradeName()
  2082.     {
  2083.         return $this->tradeName;
  2084.     }
  2085.     /**
  2086.      * Set technicalInformations
  2087.      *
  2088.      * @param string $technicalInformations
  2089.      *
  2090.      * @return ProductVariant
  2091.      */
  2092.     public function setTechnicalInformations($technicalInformations)
  2093.     {
  2094.         $this->technicalInformations $technicalInformations;
  2095.         return $this;
  2096.     }
  2097.     /**
  2098.      * Get technicalInformations
  2099.      *
  2100.      * @return string
  2101.      */
  2102.     public function getTechnicalInformations()
  2103.     {
  2104.         return $this->technicalInformations;
  2105.     }
  2106.     /**
  2107.      * Set technicalInformationForMail
  2108.      *
  2109.      * @param string $technicalInformationForMail
  2110.      * @return ProductVariant
  2111.      */
  2112.     public function setTechnicalInformationForMail($technicalInformationForMail)
  2113.     {
  2114.         $this->technicalInformationForMail $technicalInformationForMail;
  2115.         return $this;
  2116.     }
  2117.     /**
  2118.      * Get technicalInformationForMail
  2119.      *
  2120.      * @return string
  2121.      */
  2122.     public function getTechnicalInformationForMail()
  2123.     {
  2124.         return $this->technicalInformationForMail;
  2125.     }
  2126.     /**
  2127.      * Set discountOnline
  2128.      *
  2129.      * @param boolean $discountOnline
  2130.      *
  2131.      * @return ProductVariant
  2132.      */
  2133.     public function setDiscountOnline($discountOnline)
  2134.     {
  2135.         $this->discountOnline $discountOnline;
  2136.         return $this;
  2137.     }
  2138.     /**
  2139.      * Get discountOnline
  2140.      *
  2141.      * @return boolean
  2142.      */
  2143.     public function getDiscountOnline()
  2144.     {
  2145.         return $this->discountOnline;
  2146.     }
  2147.     /**
  2148.      * Set discountValueOnline
  2149.      *
  2150.      * @param float $discountValueOnline
  2151.      *
  2152.      * @return ProductVariant
  2153.      */
  2154.     public function setDiscountValueOnline($discountValueOnline)
  2155.     {
  2156.         $this->discountValueOnline $discountValueOnline;
  2157.         return $this;
  2158.     }
  2159.     /**
  2160.      * Get discountValueOnline
  2161.      *
  2162.      * @return float
  2163.      */
  2164.     public function getDiscountValueOnline()
  2165.     {
  2166.         return $this->discountValueOnline;
  2167.     }
  2168.     /**
  2169.      * Set masterProduct
  2170.      *
  2171.      * @param Product $masterProduct
  2172.      *
  2173.      * @return ProductVariant
  2174.      */
  2175.     public function setMasterProduct(Product $masterProduct null)
  2176.     {
  2177.         //        $masterProduct->addMasterProductVariant($this);
  2178.         $this->masterProduct $masterProduct;
  2179.         $this->setTradeProduct($masterProduct); //master product is a trade product unless set elsewhere
  2180.         return $this;
  2181.     }
  2182.     /**
  2183.      * Get masterProduct
  2184.      *
  2185.      * @return Product
  2186.      */
  2187.     public function getMasterProduct()
  2188.     {
  2189.         return $this->masterProduct;
  2190.     }
  2191.     public function setTradeProduct(Product $tradeProduct null): self
  2192.     {
  2193.         $this->tradeProduct $tradeProduct;
  2194.         return $this;
  2195.     }
  2196.     public function getTradeProduct(): ?Product
  2197.     {
  2198.         return $this->tradeProduct;
  2199.     }
  2200.     /**
  2201.      * Set showGrossPrice
  2202.      *
  2203.      * @param boolean $showGrossPrice
  2204.      *
  2205.      * @return ProductVariant
  2206.      */
  2207.     public function setShowGrossPrice($showGrossPrice)
  2208.     {
  2209.         $this->showGrossPrice $showGrossPrice;
  2210.         return $this;
  2211.     }
  2212.     /**
  2213.      * Get showGrossPrice
  2214.      *
  2215.      * @return boolean
  2216.      */
  2217.     public function getShowGrossPrice()
  2218.     {
  2219.         return $this->showGrossPrice;
  2220.     }
  2221.     /**
  2222.      * Add gratisCoupon
  2223.      *
  2224.      * @param Coupon $gratisCoupon
  2225.      *
  2226.      * @return ProductVariant
  2227.      */
  2228.     public function addGratisCoupon(Coupon $gratisCoupon)
  2229.     {
  2230.         if (!$this->gratisCoupon->contains($gratisCoupon)) {
  2231.             $this->gratisCoupon[] = $gratisCoupon;
  2232.         }
  2233.         return $this;
  2234.     }
  2235.     /**
  2236.      * Remove gratisCoupon
  2237.      *
  2238.      * @param Coupon $gratisCoupon
  2239.      */
  2240.     public function removeGratisCoupon(Coupon $gratisCoupon)
  2241.     {
  2242.         $this->gratisCoupon->removeElement($gratisCoupon);
  2243.     }
  2244.     /**
  2245.      * Get gratisCoupon
  2246.      *
  2247.      * @return Collection
  2248.      */
  2249.     public function getGratisCoupon()
  2250.     {
  2251.         return $this->gratisCoupon;
  2252.     }
  2253.     /**
  2254.      * Add bundleCoupon
  2255.      *
  2256.      * @param Coupon $bundleCoupon
  2257.      * @return ProductVariant
  2258.      */
  2259.     public function addBundleCoupon(Coupon $bundleCoupon)
  2260.     {
  2261.         if (!$this->bundleCoupon->contains($bundleCoupon)) {
  2262.             $this->bundleCoupon[] = $bundleCoupon;
  2263.         }
  2264.         return $this;
  2265.     }
  2266.     /**
  2267.      * Remove bundleCoupon
  2268.      *
  2269.      * @param Coupon $bundleCoupon
  2270.      */
  2271.     public function removeBundleCoupon(Coupon $bundleCoupon)
  2272.     {
  2273.         $this->bundleCoupon->removeElement($bundleCoupon);
  2274.     }
  2275.     /**
  2276.      * Get bundleCoupon
  2277.      *
  2278.      * @return Collection
  2279.      */
  2280.     public function getBundleCoupon()
  2281.     {
  2282.         return $this->bundleCoupon;
  2283.     }
  2284.     /**
  2285.      * Set couponPack
  2286.      *
  2287.      * @param CouponPackProduct $couponPack
  2288.      * @return ProductVariant
  2289.      */
  2290.     public function setCouponPack(\App\Entity\Gos\CouponPackProduct $couponPack)
  2291.     {
  2292.         $this->couponPack $couponPack;
  2293.         return $this;
  2294.     }
  2295.     /**
  2296.      * Get couponPack
  2297.      *
  2298.      * @return CouponPackProduct
  2299.      */
  2300.     public function getCouponPack()
  2301.     {
  2302.         return $this->couponPack;
  2303.     }
  2304.     /**
  2305.      * Add portalSetting
  2306.      *
  2307.      * @param PortalSettings $portalSetting
  2308.      *
  2309.      * @return ProductVariant
  2310.      */
  2311.     public function addPortalSetting(PortalSettings $portalSetting)
  2312.     {
  2313.         if (!$this->portalSettings->contains($portalSetting))
  2314.         {
  2315.             $this->portalSettings[] = $portalSetting;
  2316.             $portalSetting->addProductVariant($this);
  2317.         }
  2318.         return $this;
  2319.     }
  2320.     /**
  2321.      * Remove portalSetting
  2322.      *
  2323.      * @param PortalSettings $portalSetting
  2324.      */
  2325.     public function removePortalSetting(PortalSettings $portalSetting)
  2326.     {
  2327.         $this->portalSettings->removeElement($portalSetting);
  2328.         $portalSetting->removeProductVariant($this);
  2329.     }
  2330.     /**
  2331.      * Get portalSettings
  2332.      *
  2333.      * @return Collection
  2334.      */
  2335.     public function getPortalSettings()
  2336.     {
  2337.         return $this->portalSettings;
  2338.     }
  2339.     /**
  2340.      * Set stateIsAvailible
  2341.      *
  2342.      * @param boolean $stateIsAvailible
  2343.      *
  2344.      * @return ProductVariant
  2345.      */
  2346.     public function setStateIsAvailible($stateIsAvailible)
  2347.     {
  2348.         $this->stateIsAvailible $stateIsAvailible;
  2349.         return $this;
  2350.     }
  2351.     /**
  2352.      * Get stateIsAvailible
  2353.      *
  2354.      * @return boolean
  2355.      */
  2356.     public function getStateIsAvailible()
  2357.     {
  2358.         return $this->stateIsAvailible;
  2359.     }
  2360.     /**
  2361.      * Set stateIsForcedReservation
  2362.      *
  2363.      * @param boolean $stateIsForcedReservation
  2364.      *
  2365.      * @return ProductVariant
  2366.      */
  2367.     public function setStateIsForcedReservation($stateIsForcedReservation)
  2368.     {
  2369.         $this->stateIsForcedReservation $stateIsForcedReservation;
  2370.         return $this;
  2371.     }
  2372.     /**
  2373.      * Get stateIsForcedReservation
  2374.      *
  2375.      * @return boolean
  2376.      */
  2377.     public function getStateIsForcedReservation()
  2378.     {
  2379.         return $this->stateIsForcedReservation;
  2380.     }
  2381.     /**
  2382.      * Set stateIsProductTest
  2383.      *
  2384.      * @param boolean $stateIsProductTest
  2385.      *
  2386.      * @return ProductVariant
  2387.      */
  2388.     public function setStateIsProductTest($stateIsProductTest)
  2389.     {
  2390.         $this->stateIsProductTest $stateIsProductTest;
  2391.         return $this;
  2392.     }
  2393.     /**
  2394.      * Get stateIsProductTest
  2395.      *
  2396.      * @return boolean
  2397.      */
  2398.     public function getStateIsProductTest()
  2399.     {
  2400.         return $this->stateIsProductTest;
  2401.     }
  2402.     /**
  2403.      * Set stateIsTrialRecurring
  2404.      *
  2405.      * @param boolean $stateIsTrialRecurring
  2406.      *
  2407.      * @return ProductVariant
  2408.      */
  2409.     public function setStateIsTrialRecurring($stateIsTrialRecurring)
  2410.     {
  2411.         $this->stateIsTrialRecurring $stateIsTrialRecurring;
  2412.         return $this;
  2413.     }
  2414.     /**
  2415.      * Get stateIsTrialRecurring
  2416.      *
  2417.      * @return boolean|null
  2418.      */
  2419.     public function getStateIsTrialRecurring()
  2420.     {
  2421.         return $this->stateIsTrialRecurring;
  2422.     }
  2423.     /**
  2424.      * Set trialRecurringDuration
  2425.      *
  2426.      * @param int $trialRecurringDuration
  2427.      *
  2428.      * @return ProductVariant
  2429.      */
  2430.     public function setTrialRecurringDuration($trialRecurringDuration)
  2431.     {
  2432.         $this->trialRecurringDuration $trialRecurringDuration;
  2433.         return $this;
  2434.     }
  2435.     /**
  2436.      * Get trialRecurringDuration
  2437.      *
  2438.      * @return int|null
  2439.      */
  2440.     public function getTrialRecurringDuration()
  2441.     {
  2442.         return $this->trialRecurringDuration;
  2443.     }
  2444.     /**
  2445.      * Set productVariantAfterTrialRecurringEnd
  2446.      *
  2447.      * @param ProductVariant $productVariantAfterTrialRecurringEnd
  2448.      * @return ProductVariant
  2449.      */
  2450.     public function setProductVariantAfterTrialRecurringEnd($productVariantAfterTrialRecurringEnd)
  2451.     {
  2452.         $this->productVariantAfterTrialRecurringEnd $productVariantAfterTrialRecurringEnd;
  2453.         return $this;
  2454.     }
  2455.     /**
  2456.      * Get productVariantAfterTrialRecurringEnd
  2457.      *
  2458.      * @return ProductVariant|null
  2459.      */
  2460.     public function getProductVariantAfterTrialRecurringEnd()
  2461.     {
  2462.         return $this->productVariantAfterTrialRecurringEnd;
  2463.     }
  2464.     /**
  2465.      * Add term
  2466.      *
  2467.      * @param \App\Entity\Gos\Term $term
  2468.      *
  2469.      * @return ProductVariant
  2470.      */
  2471.     public function addTerm(Term $term)
  2472.     {
  2473.         if (!$this->terms->contains($term)) {
  2474.             $term->addProductVariant($this);
  2475.             $this->terms[] = $term;
  2476.         }
  2477.         return $this;
  2478.     }
  2479.     /**
  2480.      * Remove term
  2481.      *
  2482.      * @param \App\Entity\Gos\Term $term
  2483.      */
  2484.     public function removeTerm(Term $term)
  2485.     {
  2486.         $term->removeProductVariant($this);
  2487.         $this->terms->removeElement($term);
  2488.     }
  2489.     /**
  2490.      * Get terms
  2491.      *
  2492.      * @return Collection
  2493.      */
  2494.     public function getTerms()
  2495.     {
  2496.         return $this->terms;
  2497.     }
  2498.     /**
  2499.      * Add accessLevel
  2500.      *
  2501.      * @param \App\Entity\Gos\AccessLevel $accessLevel
  2502.      *
  2503.      * @return ProductVariant
  2504.      */
  2505.     public function addAccessLevel(\App\Entity\Gos\AccessLevel $accessLevel)
  2506.     {
  2507.         if (!$this->accessLevel->contains($accessLevel)) {
  2508.             $this->accessLevel[] = $accessLevel;
  2509.             $accessLevel->setProductVariant($this);
  2510.         }
  2511.         return $this;
  2512.     }
  2513.     /**
  2514.      * Remove accessLevel
  2515.      *
  2516.      * @param \App\Entity\Gos\AccessLevel $accessLevel
  2517.      */
  2518.     public function removeAccessLevel(\App\Entity\Gos\AccessLevel $accessLevel)
  2519.     {
  2520.         $this->accessLevel->removeElement($accessLevel);
  2521.     }
  2522.     /**
  2523.      * Get accessLevel
  2524.      *
  2525.      * @return Collection
  2526.      */
  2527.     public function getAccessLevel()
  2528.     {
  2529.         return $this->accessLevel;
  2530.     }
  2531.     /**
  2532.      * Set buyMaxOne
  2533.      *
  2534.      * @param boolean $buyMaxOne
  2535.      *
  2536.      * @return ProductVariant
  2537.      */
  2538.     public function setBuyMaxOne($buyMaxOne)
  2539.     {
  2540.         $this->buyMaxOne $buyMaxOne;
  2541.         return $this;
  2542.     }
  2543.     /**
  2544.      * Get buyMaxOne
  2545.      *
  2546.      * @return boolean
  2547.      */
  2548.     public function getBuyMaxOne()
  2549.     {
  2550.         return $this->buyMaxOne;
  2551.     }
  2552.     /**
  2553.      * Set maxUsers
  2554.      *
  2555.      * @param integer $maxUsers
  2556.      *
  2557.      * @return ProductVariant
  2558.      */
  2559.     public function setMaxUsers($maxUsers)
  2560.     {
  2561.         $this->maxUsers $maxUsers;
  2562.         return $this;
  2563.     }
  2564.     /**
  2565.      * Get maxUsers
  2566.      *
  2567.      * @return integer
  2568.      */
  2569.     public function getMaxUsers()
  2570.     {
  2571.         return $this->maxUsers;
  2572.     }
  2573.     /**
  2574.      * Add orderProductVariant
  2575.      *
  2576.      * @param \App\Entity\Gos\OrderProductVariant $orderProductVariant
  2577.      *
  2578.      * @return ProductVariant
  2579.      */
  2580.     public function addOrderProductVariant(\App\Entity\Gos\OrderProductVariant $orderProductVariant)
  2581.     {
  2582.         if (!$this->orderProductVariant->contains($orderProductVariant)) {
  2583.             $this->orderProductVariant[] = $orderProductVariant;
  2584.             $orderProductVariant->setProductVariant($this);
  2585.         }
  2586.         return $this;
  2587.     }
  2588.     /**
  2589.      * Remove orderProductVariant
  2590.      *
  2591.      * @param \App\Entity\Gos\OrderProductVariant $orderProductVariant
  2592.      */
  2593.     public function removeOrderProductVariant(\App\Entity\Gos\OrderProductVariant $orderProductVariant)
  2594.     {
  2595.         $this->orderProductVariant->removeElement($orderProductVariant);
  2596.     }
  2597.     /**
  2598.      * Get orderProductVariant
  2599.      *
  2600.      * @return Collection
  2601.      */
  2602.     public function getOrderProductVariant()
  2603.     {
  2604.         return $this->orderProductVariant;
  2605.     }
  2606.     /**
  2607.      * Set isAddition
  2608.      *
  2609.      * @param boolean $isAddition
  2610.      *
  2611.      * @return ProductVariant
  2612.      */
  2613.     public function setIsAddition($isAddition)
  2614.     {
  2615.         $this->isAddition $isAddition;
  2616.         return $this;
  2617.     }
  2618.     /**
  2619.      * Get isAddition
  2620.      *
  2621.      * @return boolean
  2622.      */
  2623.     public function getIsAddition()
  2624.     {
  2625.         return $this->isAddition;
  2626.     }
  2627.     public function addCouponPack(CouponPackProduct $couponPack): self
  2628.     {
  2629.         if (!$this->couponPack->contains($couponPack)) {
  2630.             $this->couponPack[] = $couponPack;
  2631.             $couponPack->setProductVariant($this);
  2632.         }
  2633.         return $this;
  2634.     }
  2635.     public function removeCouponPack(CouponPackProduct $couponPack): self
  2636.     {
  2637.         if ($this->couponPack->contains($couponPack)) {
  2638.             $this->couponPack->removeElement($couponPack);
  2639.             // set the owning side to null (unless already changed)
  2640.             if ($couponPack->getProductVariant() === $this) {
  2641.                 $couponPack->setProductVariant(null);
  2642.             }
  2643.         }
  2644.         return $this;
  2645.     }
  2646.     public function getQuantity(): ?int
  2647.     {
  2648.         return $this->quantity;
  2649.     }
  2650.     public function setQuantity(int $quantity): self
  2651.     {
  2652.         $this->quantity $quantity;
  2653.         return $this;
  2654.     }
  2655.     public function getOrderQuantity(): ?int
  2656.     {
  2657.         return $this->getProductVariantOrderQuantity() ? $this->getProductVariantOrderQuantity()->getOrderQuantity() : 0;
  2658.     }
  2659.     public function setOrderQuantity(int $orderQuantity): self
  2660.     {
  2661.         $this->orderQuantity $orderQuantity;
  2662.         return $this;
  2663.     }
  2664.     /**
  2665.      * @return Collection|ProductPackItem[]
  2666.      */
  2667.     public function getProductPackItem(): Collection
  2668.     {
  2669.         return $this->productPackItem;
  2670.     }
  2671.     public function addProductPackItem(ProductPackItem $productPackItem): self
  2672.     {
  2673.         if (!$this->productPackItem->contains($productPackItem)) {
  2674.             $this->productPackItem[] = $productPackItem;
  2675.             $productPackItem->setProductVariant($this);
  2676.         }
  2677.         return $this;
  2678.     }
  2679.     public function removeProductPackItem(ProductPackItem $productPackItem): self
  2680.     {
  2681.         if ($this->productPackItem->contains($productPackItem)) {
  2682.             $this->productPackItem->removeElement($productPackItem);
  2683.             // set the owning side to null (unless already changed)
  2684.             if ($productPackItem->getProductVariant() === $this) {
  2685.                 $productPackItem->setProductVariant(null);
  2686.             }
  2687.         }
  2688.         return $this;
  2689.     }
  2690.     /**
  2691.      * @return Collection|EventProductVariantGroupItem[]
  2692.      */
  2693.     public function getProductVariantGroupItems(): Collection
  2694.     {
  2695.         return $this->productVariantGroupItems;
  2696.     }
  2697.     public function addProductVariantGroupItem(EventProductVariantGroupItem $productVariantGroupItem): self
  2698.     {
  2699.         if (!$this->productVariantGroupItems->contains($productVariantGroupItem)) {
  2700.             $this->productVariantGroupItems[] = $productVariantGroupItem;
  2701.             $productVariantGroupItem->setProductVariant($this);
  2702.         }
  2703.         return $this;
  2704.     }
  2705.     public function removeProductVariantGroupItem(EventProductVariantGroupItem $productVariantGroupItem): self
  2706.     {
  2707.         if ($this->productVariantGroupItems->contains($productVariantGroupItem)) {
  2708.             $this->productVariantGroupItems->removeElement($productVariantGroupItem);
  2709.             // set the owning side to null (unless already changed)
  2710.             if ($productVariantGroupItem->getProductVariant() === $this) {
  2711.                 $productVariantGroupItem->setProductVariant(null);
  2712.             }
  2713.         }
  2714.         return $this;
  2715.     }
  2716.     /**
  2717.      * @return Collection|EventProductVariantGroup[]
  2718.      */
  2719.     public function getProductVariantGroups(): Collection
  2720.     {
  2721.         return $this->productVariantGroups;
  2722.     }
  2723.     public function addProductVariantGroup(EventProductVariantGroup $productVariantGroup): self
  2724.     {
  2725.         if (!$this->productVariantGroups->contains($productVariantGroup)) {
  2726.             $this->productVariantGroups[] = $productVariantGroup;
  2727.             $productVariantGroup->setProductVariant($this);
  2728.         }
  2729.         return $this;
  2730.     }
  2731.     public function removeProductVariantGroup(EventProductVariantGroup $productVariantGroup): self
  2732.     {
  2733.         if ($this->productVariantGroups->contains($productVariantGroup)) {
  2734.             $this->productVariantGroups->removeElement($productVariantGroup);
  2735.             // set the owning side to null (unless already changed)
  2736.             if ($productVariantGroup->getProductVariant() === $this) {
  2737.                 $productVariantGroup->setProductVariant(null);
  2738.             }
  2739.         }
  2740.         return $this;
  2741.     }
  2742.     public function getCartParticipantsPrimary(): Collection
  2743.     {
  2744.         return $this->cartParticipantsPrimary;
  2745.     }
  2746.     public function setCartParticipantsPrimary(?CartParticipant $cartParticipantsPrimary): self
  2747.     {
  2748.         $this->cartParticipantsPrimary $cartParticipantsPrimary;
  2749.         // set (or unset) the owning side of the relation if necessary
  2750.         $newPrimaryProductVariant $cartParticipantsPrimary === null null $this;
  2751.         if ($newPrimaryProductVariant !== $cartParticipantsPrimary->getPrimaryProductVariant()) {
  2752.             $cartParticipantsPrimary->setPrimaryProductVariant($newPrimaryProductVariant);
  2753.         }
  2754.         return $this;
  2755.     }
  2756.     public function addCartParticipantsPrimary(CartParticipant $cartParticipantsPrimary): self
  2757.     {
  2758.         if (!$this->cartParticipantsPrimary->contains($cartParticipantsPrimary)) {
  2759.             $this->cartParticipantsPrimary[] = $cartParticipantsPrimary;
  2760.             $cartParticipantsPrimary->setPrimaryProductVariant($this);
  2761.         }
  2762.         return $this;
  2763.     }
  2764.     public function removeCartParticipantsPrimary(CartParticipant $cartParticipantsPrimary): self
  2765.     {
  2766.         if ($this->cartParticipantsPrimary->contains($cartParticipantsPrimary)) {
  2767.             $this->cartParticipantsPrimary->removeElement($cartParticipantsPrimary);
  2768.             // set the owning side to null (unless already changed)
  2769.             if ($cartParticipantsPrimary->getPrimaryProductVariant() === $this) {
  2770.                 $cartParticipantsPrimary->setPrimaryProductVariant(null);
  2771.             }
  2772.         }
  2773.         return $this;
  2774.     }
  2775.     public function getParticipantsPrimary()
  2776.     {
  2777.         return $this->participantsPrimary;
  2778.     }
  2779.     public function setParticipantsPrimary(?Participants $participantsPrimary): self
  2780.     {
  2781.         $this->participantsPrimary $participantsPrimary;
  2782.         // set (or unset) the owning side of the relation if necessary
  2783.         $newPrimaryProductVariant $participantsPrimary === null null $this;
  2784.         if ($newPrimaryProductVariant !== $participantsPrimary->getPrimaryProductVariant()) {
  2785.             $participantsPrimary->setPrimaryProductVariant($newPrimaryProductVariant);
  2786.         }
  2787.         return $this;
  2788.     }
  2789.     public function addParticipantsPrimary(Participants $participantsPrimary): self
  2790.     {
  2791.         if (!$this->participantsPrimary->contains($participantsPrimary)) {
  2792.             $this->participantsPrimary[] = $participantsPrimary;
  2793.             $participantsPrimary->setPrimaryProductVariant($this);
  2794.         }
  2795.         return $this;
  2796.     }
  2797.     public function removeParticipantsPrimary(Participants $participantsPrimary): self
  2798.     {
  2799.         if ($this->participantsPrimary->contains($participantsPrimary)) {
  2800.             $this->participantsPrimary->removeElement($participantsPrimary);
  2801.             // set the owning side to null (unless already changed)
  2802.             if ($participantsPrimary->getPrimaryProductVariant() === $this) {
  2803.                 $participantsPrimary->setPrimaryProductVariant(null);
  2804.             }
  2805.         }
  2806.         return $this;
  2807.     }
  2808.     /**
  2809.      * @return Collection|ProductVariantDescription[]
  2810.      */
  2811.     public function getProductVariantDescriptions(): Collection
  2812.     {
  2813.         return $this->productVariantDescriptions;
  2814.     }
  2815.     public function addProductVariantDescription(ProductVariantDescription $productVariantDescription): self
  2816.     {
  2817.         if (!$this->productVariantDescriptions->contains($productVariantDescription)) {
  2818.             $this->productVariantDescriptions[] = $productVariantDescription;
  2819.             $productVariantDescription->setProductVariant($this);
  2820.         }
  2821.         return $this;
  2822.     }
  2823.     public function removeProductVariantDescription(ProductVariantDescription $productVariantDescription): self
  2824.     {
  2825.         if ($this->productVariantDescriptions->contains($productVariantDescription)) {
  2826.             $this->productVariantDescriptions->removeElement($productVariantDescription);
  2827.             // set the owning side to null (unless already changed)
  2828.             if ($productVariantDescription->getProductVariant() === $this) {
  2829.                 $productVariantDescription->setProductVariant(null);
  2830.             }
  2831.         }
  2832.         return $this;
  2833.     }
  2834.     public function getSubscriptionType(): ?string
  2835.     {
  2836.         return $this->subscriptionType;
  2837.     }
  2838.     public function setSubscriptionType(string $subscriptionType): self
  2839.     {
  2840.         $this->subscriptionType $subscriptionType;
  2841.         return $this;
  2842.     }
  2843.     public function getSubscriptionPlan(): ?string
  2844.     {
  2845.         return $this->subscriptionPlan;
  2846.     }
  2847.     public function setSubscriptionPlan(string $subscriptionPlan): self
  2848.     {
  2849.         $this->subscriptionPlan $subscriptionPlan;
  2850.         return $this;
  2851.     }
  2852.     public function setImageFile(File $imageFile null)
  2853.     {
  2854.         $this->imageFile $imageFile;
  2855.         // VERY IMPORTANT:
  2856.         // It is required that at least one field changes if you are using Doctrine,
  2857.         // otherwise the event listeners won't be called and the file is lost
  2858.         if ($imageFile)
  2859.         {
  2860.             // if 'updatedAt' is not defined in your entity, use another property
  2861.             $this->updatedAt = new \DateTime('now');
  2862.         }
  2863.     }
  2864.     public function getImageFile()
  2865.     {
  2866.         return $this->imageFile;
  2867.     }
  2868.     public function setImage($image)
  2869.     {
  2870.         $this->image $image;
  2871.     }
  2872.     public function getImage()
  2873.     {
  2874.         return $this->image;
  2875.     }
  2876.     public function getPromoted(): ?bool
  2877.     {
  2878.         return $this->promoted;
  2879.     }
  2880.     public function setPromoted(bool $promoted): self
  2881.     {
  2882.         $this->promoted $promoted;
  2883.         return $this;
  2884.     }
  2885.     public function getLabel(): ?string
  2886.     {
  2887.         return $this->label;
  2888.     }
  2889.     public function setLabel(?string $label): self
  2890.     {
  2891.         $this->label $label;
  2892.         return $this;
  2893.     }
  2894.     public function getEventDate(): ?\DateTimeInterface
  2895.     {
  2896.         return $this->eventDate;
  2897.     }
  2898.     public function setEventDate(?\DateTimeInterface $eventDate): self
  2899.     {
  2900.         $this->eventDate $eventDate;
  2901.         return $this;
  2902.     }
  2903.     public function getProductNumberNoTax(): ?string
  2904.     {
  2905.         return $this->productNumberNoTax;
  2906.     }
  2907.     public function setProductNumberNoTax(?string $productNumberNoTax): self
  2908.     {
  2909.         $this->productNumberNoTax $productNumberNoTax;
  2910.         return $this;
  2911.     }
  2912.     public function getProductNumberPartTax(): ?string
  2913.     {
  2914.         return $this->productNumberPartTax;
  2915.     }
  2916.     public function setProductNumberPartTax(?string $productNumberPartTax): self
  2917.     {
  2918.         $this->productNumberPartTax $productNumberPartTax;
  2919.         return $this;
  2920.     }
  2921.     public function getBurFundingProductVariant(): ?ProductVariant
  2922.     {
  2923.         return $this->burFundingProductVariant;
  2924.     }
  2925.     public function setBurFundingProductVariant(?ProductVariant $burFundingProductVariant): self
  2926.     {
  2927.         $this->burFundingProductVariant $burFundingProductVariant;
  2928.         return $this;
  2929.     }
  2930.     /**
  2931.      * @return Collection|Alert[]
  2932.      */
  2933.     public function getAlerts(): Collection
  2934.     {
  2935.         return $this->alerts;
  2936.     }
  2937.     public function addAlert(Alert $alert): self
  2938.     {
  2939.         if (!$this->alerts->contains($alert)) {
  2940.             $this->alerts[] = $alert;
  2941.             $alert->setProductVariant($this);
  2942.         }
  2943.         return $this;
  2944.     }
  2945.     public function removeAlert(Alert $alert): self
  2946.     {
  2947.         if ($this->alerts->contains($alert)) {
  2948.             $this->alerts->removeElement($alert);
  2949.             // set the owning side to null (unless already changed)
  2950.             if ($alert->getProductVariant() === $this) {
  2951.                 $alert->setProductVariant(null);
  2952.             }
  2953.         }
  2954.         return $this;
  2955.     }
  2956.     public function getQuantityLeft(): int
  2957.     {
  2958.         if ($this->quantity == 0)
  2959.         {
  2960.             return 999;
  2961.         }
  2962.         return $this->quantity $this->orderQuantity;
  2963.     }
  2964.     public function getIsPublished(): ?bool
  2965.     {
  2966.         return $this->isPublished;
  2967.     }
  2968.     public function setIsPublished(bool $isPublished): self
  2969.     {
  2970.         $this->isPublished $isPublished;
  2971.         return $this;
  2972.     }
  2973.     public function getIsTest(): ?bool
  2974.     {
  2975.         return $this->isTest;
  2976.     }
  2977.     public function setIsTest(?bool $isTest): self
  2978.     {
  2979.         $this->isTest $isTest;
  2980.         return $this;
  2981.     }
  2982.     public function getIsGiftable(): ?bool
  2983.     {
  2984.         return $this->isGiftable;
  2985.     }
  2986.     public function setIsGiftable(?bool $isGiftable): self
  2987.     {
  2988.         $this->isGiftable $isGiftable;
  2989.         return $this;
  2990.     }
  2991.     public function getIsHidden(): ?bool
  2992.     {
  2993.         return $this->isHidden;
  2994.     }
  2995.     public function setIsHidden(?bool $isHidden): self
  2996.     {
  2997.         $this->isHidden $isHidden;
  2998.         return $this;
  2999.     }
  3000.     public function getIsPartialPaymentActive(): ?bool
  3001.     {
  3002.         return $this->isPartialPaymentActive;
  3003.     }
  3004.     public function setIsPartialPaymentActive(bool $isPartialPaymentActive): self
  3005.     {
  3006.         $this->isPartialPaymentActive $isPartialPaymentActive;
  3007.         return $this;
  3008.     }
  3009.     public function getInstallmentAmount(): ?int
  3010.     {
  3011.         return $this->installmentAmount;
  3012.     }
  3013.     public function setInstallmentAmount(int $installmentAmount): self
  3014.     {
  3015.         $this->installmentAmount $installmentAmount;
  3016.         return $this;
  3017.     }
  3018.     public function getCountry(): ?Country
  3019.     {
  3020.         return $this->country;
  3021.     }
  3022.     public function setCountry(?Country $country): self
  3023.     {
  3024.         $this->country $country;
  3025.         return $this;
  3026.     }
  3027.     public function getPaymentType(): ?PaymentType
  3028.     {
  3029.         return $this->paymentType;
  3030.     }
  3031.     public function setPaymentType(?PaymentType $paymentType): self
  3032.     {
  3033.         $this->paymentType $paymentType;
  3034.         return $this;
  3035.     }
  3036.     public function getExtendedPaymentTime(): ?int
  3037.     {
  3038.         return $this->extendedPaymentTime;
  3039.     }
  3040.     public function setExtendedPaymentTime(int $extendedPaymentTime): self
  3041.     {
  3042.         $this->extendedPaymentTime $extendedPaymentTime;
  3043.         return $this;
  3044.     }
  3045.     public function getProductSubscriptionType(): ?ProductSubscriptionType
  3046.     {
  3047.         return $this->productSubscriptionType;
  3048.     }
  3049.     public function setProductSubscriptionType(?ProductSubscriptionType $productSubscriptionType): self
  3050.     {
  3051.         $this->productSubscriptionType $productSubscriptionType;
  3052.         return $this;
  3053.     }
  3054.     /**
  3055.      * @return Collection|ProductVariantMultiDiscount[]
  3056.      */
  3057.     public function getMultiDiscount(): Collection
  3058.     {
  3059.         return $this->multiDiscount;
  3060.     }
  3061.     public function addMultiDiscount(ProductVariantMultiDiscount $multiDiscount): self
  3062.     {
  3063.         if (!$this->multiDiscount->contains($multiDiscount)) {
  3064.             $this->multiDiscount[] = $multiDiscount;
  3065.             $multiDiscount->setProductVariant($this);
  3066.         }
  3067.         return $this;
  3068.     }
  3069.     public function removeMultiDiscount(ProductVariantMultiDiscount $multiDiscount): self
  3070.     {
  3071.         if ($this->multiDiscount->contains($multiDiscount)) {
  3072.             $this->multiDiscount->removeElement($multiDiscount);
  3073.             // set the owning side to null (unless already changed)
  3074.             if ($multiDiscount->getProductVariant() === $this) {
  3075.                 $multiDiscount->setProductVariant(null);
  3076.             }
  3077.         }
  3078.         return $this;
  3079.     }
  3080.     public function getDefaultProductAssociation(): ?bool
  3081.     {
  3082.         return $this->defaultProductAssociation;
  3083.     }
  3084.     public function setDefaultProductAssociation(bool $defaultProductAssociation): self
  3085.     {
  3086.         $this->defaultProductAssociation $defaultProductAssociation;
  3087.         return $this;
  3088.     }
  3089.     public function getIsUniqskillsProduct()
  3090.     {
  3091.         if ($this->getCourses()->isEmpty())
  3092.             return false;
  3093.         return true;
  3094.     }
  3095.     public function getCourseSubscriptions()
  3096.     {
  3097.         if ($this->getIsUniqskillsProduct() and !$this->getIsVirtual())
  3098.         {
  3099.             $country $this->getCountry();
  3100.             $product $this->getMasterProduct();
  3101.             $productVariants $product->getProductVariant()->toArray();
  3102.             return array_filter($productVariants, function($variant) use ($country) {
  3103.                 /** @var $variant ProductVariant */
  3104.                 return (
  3105.                     $variant->getCountry() === $country
  3106.                     && $variant->isActive()
  3107.                     && !$variant->getIsHidden()
  3108.                 );
  3109.             });
  3110.         }
  3111.         return [];
  3112.     }
  3113.     public function getSummaryUpsellingInfo(): ?string
  3114.     {
  3115.         return $this->summaryUpsellingInfo;
  3116.     }
  3117.     public function setSummaryUpsellingInfo(?string $summaryUpsellingInfo): self
  3118.     {
  3119.         $this->summaryUpsellingInfo $summaryUpsellingInfo;
  3120.         return $this;
  3121.     }
  3122.     public function getProductAssociation(): Collection
  3123.     {
  3124.         return $this->productAssociation;
  3125.     }
  3126.     public function getSingleProductAssociation()
  3127.     {
  3128.         if (!empty($this->productAssociation))
  3129.         {
  3130.             return $this->productAssociation->first();
  3131.         }
  3132.         return $this->getMasterProduct()->getProductAssociation()->first();
  3133.     }
  3134.     public function addProductAssociation(?ProductAssociation $productAssociation): self
  3135.     {
  3136.         if (!$this->productAssociation->contains($productAssociation)) {
  3137.             $this->productAssociation[] = $productAssociation;
  3138.         }
  3139.         return $this;
  3140.     }
  3141.     public function removeProductAssociation(?ProductAssociation $productAssociation): self
  3142.     {
  3143.         if($this->productAssociation->contains($productAssociation)) {
  3144.             $this->productAssociation->removeElement($productAssociation);
  3145.         }
  3146.         return $this;
  3147.     }
  3148.     /**
  3149.      * @return Collection|PaymentSystem[]
  3150.      */
  3151.     public function getPaymentSystem(): Collection
  3152.     {
  3153.         return $this->paymentSystem;
  3154.     }
  3155.     public function addPaymentSystem(PaymentSystem $paymentSystem): self
  3156.     {
  3157.         if (!$this->paymentSystem->contains($paymentSystem)) {
  3158.             $this->paymentSystem[] = $paymentSystem;
  3159.         }
  3160.         return $this;
  3161.     }
  3162.     public function removePaymentSystem(PaymentSystem $paymentSystem): self
  3163.     {
  3164.         if ($this->paymentSystem->contains($paymentSystem)) {
  3165.             $this->paymentSystem->removeElement($paymentSystem);
  3166.         }
  3167.         return $this;
  3168.     }
  3169.     public function getAltTradeName(): ?string
  3170.     {
  3171.         return $this->altTradeName;
  3172.     }
  3173.     public function setAltTradeName(?string $altTradeName): self
  3174.     {
  3175.         $this->altTradeName $altTradeName;
  3176.         return $this;
  3177.     }
  3178.     public function getSubscriptionCartDescription(): ?string
  3179.     {
  3180.         return $this->getAltTradeName() ?? $this->getTradeName();
  3181.     }
  3182.     /**
  3183.      * @return Collection|ProductVariantPack[]
  3184.      */
  3185.     public function getProductVariantPacks(): Collection
  3186.     {
  3187.         return $this->productVariantPacks;
  3188.     }
  3189.     public function addProductVariantPack(ProductVariantPack $productVariantPack): self
  3190.     {
  3191.         if (!$this->productVariantPacks->contains($productVariantPack)) {
  3192.             $this->productVariantPacks[] = $productVariantPack;
  3193.             $productVariantPack->addProductVariant($this);
  3194.         }
  3195.         return $this;
  3196.     }
  3197.     public function removeProductVariantPack(ProductVariantPack $productVariantPack): self
  3198.     {
  3199.         if ($this->productVariantPacks->contains($productVariantPack)) {
  3200.             $this->productVariantPacks->removeElement($productVariantPack);
  3201.             $productVariantPack->removeProductVariant($this);
  3202.         }
  3203.         return $this;
  3204.     }
  3205.     public function getTrialDuration(): ?int
  3206.     {
  3207.         return $this->trialDuration;
  3208.     }
  3209.     public function setTrialDuration(?int $trialDuration): self
  3210.     {
  3211.         $this->trialDuration $trialDuration;
  3212.         return $this;
  3213.     }
  3214.     /**
  3215.      * @return Collection|Course[]
  3216.      */
  3217.     public function getCourses(): Collection
  3218.     {
  3219.         return $this->courses;
  3220.     }
  3221.     public function addCourse(Course $course): self
  3222.     {
  3223.         if (!$this->courses->contains($course)) {
  3224.             $this->courses[] = $course;
  3225.         }
  3226.         return $this;
  3227.     }
  3228.     public function removeCourse(Course $course): self
  3229.     {
  3230.         if ($this->courses->contains($course)) {
  3231.             $this->courses->removeElement($course);
  3232.         }
  3233.         return $this;
  3234.     }
  3235.     /**
  3236.      * @return Collection|Package[]
  3237.      */
  3238.     public function getPackages(): Collection
  3239.     {
  3240.         return $this->packages;
  3241.     }
  3242.     public function addPackage(Package $package): self
  3243.     {
  3244.         if (!$this->packages->contains($package)) {
  3245.             $this->packages[] = $package;
  3246.         }
  3247.         return $this;
  3248.     }
  3249.     public function removePackage(Package $package): self
  3250.     {
  3251.         if ($this->packages->contains($package)) {
  3252.             $this->packages->removeElement($package);
  3253.         }
  3254.         return $this;
  3255.     }
  3256.     /**
  3257.      * @return Collection|\App\Entity\Gos\File[]
  3258.      */
  3259.     public function getFiles(): Collection
  3260.     {
  3261.         return $this->files;
  3262.     }
  3263.     public function addFile(\App\Entity\Gos\File $file): self
  3264.     {
  3265.         if (!$this->files->contains($file)) {
  3266.             $this->files[] = $file;
  3267.         }
  3268.         return $this;
  3269.     }
  3270.     public function removeFile(\App\Entity\Gos\File $file): self
  3271.     {
  3272.         if ($this->files->contains($file)) {
  3273.             $this->files->removeElement($file);
  3274.         }
  3275.         return $this;
  3276.     }
  3277.     public function getRequiredPWZ(): ?bool
  3278.     {
  3279.         return $this->requiredPWZ;
  3280.     }
  3281.     public function setRequiredPWZ(bool $requiredPWZ): self
  3282.     {
  3283.         $this->requiredPWZ $requiredPWZ;
  3284.         return $this;
  3285.     }
  3286.     public function getPromoName(): ?string
  3287.     {
  3288.         return $this->promoName;
  3289.     }
  3290.     public function setPromoName(?string $promoName): self
  3291.     {
  3292.         if (strpos($promoName'Dostęp do platformy z treƛciami szkoleniowymi:') !== false)
  3293.             $promoName str_replace("Dostęp do platformy z treƛciami szkoleniowymi:"""$promoName);
  3294.         elseif(strpos($promoName'Dostęp do platformy z treƛciami szkoleniowymi.') !== false)
  3295.             $promoName str_replace("Dostęp do platformy z treƛciami szkoleniowymi."""$promoName);
  3296.         elseif(strpos($promoName'Dostęp do platformy z treƛciami szkoleniowymi') !== false)
  3297.             $promoName str_replace("Dostęp do platformy z treƛciami szkoleniowymi."""$promoName);
  3298.         elseif(strpos($promoName'Acceso al curso certificado:') !== false)
  3299.             $promoName str_replace("Acceso al curso certificado:"""$promoName);
  3300.         elseif(strpos($promoName'Acceso al curso certificado.') !== false)
  3301.             $promoName str_replace("Acceso al curso certificado."""$promoName);
  3302.         elseif(strpos($promoName'Acceso al curso certificado') !== false)
  3303.             $promoName str_replace("Acceso al curso certificado"""$promoName);
  3304.         $promoName trim($promoName);
  3305.         $this->promoName $promoName;
  3306.         return $this;
  3307.     }
  3308.     public function getIsDigital(): ?bool
  3309.     {
  3310.         return $this->isDigital;
  3311.     }
  3312.     public function setIsDigital(?bool $isDigital): self
  3313.     {
  3314.         $this->isDigital $isDigital;
  3315.         return $this;
  3316.     }
  3317.     public function getBlockAccess(): ?bool
  3318.     {
  3319.         return $this->blockAccess;
  3320.     }
  3321.     public function setBlockAccess(?bool $blockAccess): self
  3322.     {
  3323.         $this->blockAccess $blockAccess;
  3324.         return $this;
  3325.     }
  3326.     public function getMantisUserId(): ?int
  3327.     {
  3328.         return $this->mantisUserId;
  3329.     }
  3330.     public function setMantisUserId(?int $mantisUserId): self
  3331.     {
  3332.         $this->mantisUserId $mantisUserId;
  3333.         return $this;
  3334.     }
  3335.     public function getGoogleMerchantFeed(): ?GoogleMerchantFeed
  3336.     {
  3337.         return $this->googleMerchantFeed;
  3338.     }
  3339.     public function setGoogleMerchantFeed(?GoogleMerchantFeed $googleMerchantFeed): self
  3340.     {
  3341.         $this->googleMerchantFeed $googleMerchantFeed;
  3342.         return $this;
  3343.     }
  3344.     public function getProductVariantEuVat(): ?ProductVariant
  3345.     {
  3346.         return $this->productVariantEuVat;
  3347.     }
  3348.     public function setProductVariantEuVat(?ProductVariant $productVariantEuVat): self
  3349.     {
  3350.         $this->productVariantEuVat $productVariantEuVat;
  3351.         return $this;
  3352.     }
  3353.     public function getOriginalProductVariant(): ?ProductVariant
  3354.     {
  3355.         return $this->originalProductVariant;
  3356.     }
  3357.     public function setOriginalProductVariant(?ProductVariant $originalProductVariant): self
  3358.     {
  3359.         $this->originalProductVariant $originalProductVariant;
  3360.         return $this;
  3361.     }
  3362.     public function isSalesVariantBasedTrial(): bool
  3363.     {
  3364.         return $this->salesVariantBasedTrialDuration !== null && $this->salesVariantBasedTrialDuration 0;
  3365.     }
  3366.     public function getSalesVariantBasedTrialDuration(): ?int
  3367.     {
  3368.         return $this->salesVariantBasedTrialDuration;
  3369.     }
  3370.     public function setSalesVariantBasedTrialDuration(?int $salesVariantBasedTrialDuration): self
  3371.     {
  3372.         $this->salesVariantBasedTrialDuration $salesVariantBasedTrialDuration;
  3373.         return $this;
  3374.     }
  3375.     public function getSalesVariantBasedTrialInfo(): ?string
  3376.     {
  3377.         return $this->salesVariantBasedTrialInfo;
  3378.     }
  3379.     public function setSalesVariantBasedTrialInfo(?string $salesVariantBasedTrialInfo): self
  3380.     {
  3381.         $this->salesVariantBasedTrialInfo $salesVariantBasedTrialInfo;
  3382.         return $this;
  3383.     }
  3384.     public function getAccessForPaidOnly(): ?bool
  3385.     {
  3386.         return $this->accessForPaidOnly;
  3387.     }
  3388.     public function setAccessForPaidOnly(?bool $accessForPaidOnly): self
  3389.     {
  3390.         $this->accessForPaidOnly $accessForPaidOnly;
  3391.         return $this;
  3392.     }
  3393.     public function getAdditionalTextInCart(): ?string
  3394.     {
  3395.         return $this->additionalTextInCart;
  3396.     }
  3397.     public function setAdditionalTextInCart(?string $additionalTextInCart): self
  3398.     {
  3399.         $this->additionalTextInCart $additionalTextInCart;
  3400.         return $this;
  3401.     }
  3402.     public function getIsRecurringSubscription(): ?bool
  3403.     {
  3404.         return $this->isRecurringSubscription;
  3405.     }
  3406.     public function setIsRecurringSubscription(?bool $isRecurringSubscription): self
  3407.     {
  3408.         $this->isRecurringSubscription $isRecurringSubscription;
  3409.         return $this;
  3410.     }
  3411.     public function getDocumentDistributionChannel(): ?string
  3412.     {
  3413.         return $this->documentDistributionChannel;
  3414.     }
  3415.     public function setDocumentDistributionChannel(?string $documentDistributionChannel): self
  3416.     {
  3417.         $this->documentDistributionChannel $documentDistributionChannel;
  3418.         return $this;
  3419.     }
  3420.     public function getHiddenInSBTillPaid(): ?bool
  3421.     {
  3422.         return $this->hiddenInSBTillPaid;
  3423.     }
  3424.     public function setHiddenInSBTillPaid(?bool $hiddenInSBTillPaid): self
  3425.     {
  3426.         $this->hiddenInSBTillPaid $hiddenInSBTillPaid;
  3427.         return $this;
  3428.     }
  3429.     public function getParticipantsAddress(): ?bool
  3430.     {
  3431.         return $this->participantsAddress;
  3432.     }
  3433.     public function setParticipantsAddress(?bool $participantsAddress): self
  3434.     {
  3435.         $this->participantsAddress $participantsAddress;
  3436.         return $this;
  3437.     }
  3438.     public function getParticipantsAnnouncement(): ?string
  3439.     {
  3440.         return $this->participantsAnnouncement;
  3441.     }
  3442.     public function setParticipantsAnnouncement(?string $participantsAnnouncement): self
  3443.     {
  3444.         $this->participantsAnnouncement $participantsAnnouncement;
  3445.         return $this;
  3446.     }
  3447.     /**
  3448.      * Add exclusiveVariant
  3449.      *
  3450.      * @param ProductVariant $exclusiveVariant
  3451.      *
  3452.      * @return ProductVariant
  3453.      */
  3454.     public function addExclusiveVariant(ProductVariant $exclusiveVariant)
  3455.     {
  3456.         $exclusiveVariant->addNormalVariant($this);
  3457.         $this->exclusiveVariant[] = $exclusiveVariant;
  3458.         return $this;
  3459.     }
  3460.     /**
  3461.      * Remove exclusiveVariant
  3462.      *
  3463.      * @param ProductVariant $exclusiveVariant
  3464.      */
  3465.     public function removeExclusiveVariant(ProductVariant $exclusiveVariant)
  3466.     {
  3467.         $exclusiveVariant->removeNormalVariant($this);
  3468.         $this->exclusiveVariant->removeElement($exclusiveVariant);
  3469.     }
  3470.     /**
  3471.      * Get exclusiveVariant
  3472.      *
  3473.      * @return Collection
  3474.      */
  3475.     public function getExclusiveVariant()
  3476.     {
  3477.         return $this->exclusiveVariant;
  3478.     }
  3479.     /**
  3480.      * Add normalVariant
  3481.      *
  3482.      * @param ProductVariant $normalVariant
  3483.      *
  3484.      * @return ProductVariant
  3485.      */
  3486.     public function addNormalVariant(ProductVariant $normalVariant)
  3487.     {
  3488.         $this->normalVariant[] = $normalVariant;
  3489.         return $this;
  3490.     }
  3491.     /**
  3492.      * Remove normalVariant
  3493.      *
  3494.      * @param ProductVariant $normalVariant
  3495.      */
  3496.     public function removeNormalVariant(ProductVariant $normalVariant)
  3497.     {
  3498.         $this->normalVariant->removeElement($normalVariant);
  3499.     }
  3500.     /**
  3501.      * Get normalVariant
  3502.      *
  3503.      * @return Collection
  3504.      */
  3505.     public function getNormalVariant()
  3506.     {
  3507.         return $this->normalVariant;
  3508.     }
  3509.     /**
  3510.      * Add additionalCartVariant
  3511.      *
  3512.      * @param ProductVariant $additionalCartVariant
  3513.      *
  3514.      * @return ProductVariant
  3515.      */
  3516.     public function addAdditionalCartVariant(ProductVariant $additionalCartVariant): ProductVariant
  3517.     {
  3518.         $additionalCartVariant->addBasicCartVariant($this);
  3519.         $this->additionalCartVariant[] = $additionalCartVariant;
  3520.         return $this;
  3521.     }
  3522.     /**
  3523.      * Remove additionalCartVariant
  3524.      *
  3525.      * @param ProductVariant $additionalCartVariant
  3526.      */
  3527.     public function removeAdditionalCartVariant(ProductVariant $additionalCartVariant)
  3528.     {
  3529.         $additionalCartVariant->removeBasicCartVariant($this);
  3530.         $this->additionalCartVariant->removeElement($additionalCartVariant);
  3531.     }
  3532.     /**
  3533.      * Get additionalCartVariant
  3534.      *
  3535.      * @return Collection
  3536.      */
  3537.     public function getAdditionalCartVariant(): ?Collection
  3538.     {
  3539.         return $this->additionalCartVariant;
  3540.     }
  3541.     /**
  3542.      * Add basicCartVariant
  3543.      *
  3544.      * @param ProductVariant $basicCartVariant
  3545.      *
  3546.      * @return ProductVariant
  3547.      */
  3548.     public function addBasicCartVariant(ProductVariant $basicCartVariant): ProductVariant
  3549.     {
  3550.         $this->basicCartVariant[] = $basicCartVariant;
  3551.         return $this;
  3552.     }
  3553.     /**
  3554.      * Remove basicCartVariant
  3555.      *
  3556.      * @param ProductVariant $basicCartVariant
  3557.      */
  3558.     public function removeBasicCartVariant(ProductVariant $basicCartVariant)
  3559.     {
  3560.         $this->basicCartVariant->removeElement($basicCartVariant);
  3561.     }
  3562.     /**
  3563.      * Get basicCartVariant
  3564.      *
  3565.      * @return Collection
  3566.      */
  3567.     public function getBasicCartVariant(): ?Collection
  3568.     {
  3569.         return $this->basicCartVariant;
  3570.     }
  3571.     /**
  3572.      * Add additionalCartVariantUpselling
  3573.      *
  3574.      * @param ProductVariant $additionalCartVariantUpselling
  3575.      *
  3576.      * @return ProductVariant
  3577.      */
  3578.     public function addAdditionalCartVariantUpselling(ProductVariant $additionalCartVariantUpselling): ProductVariant
  3579.     {
  3580.         $additionalCartVariantUpselling->addBasicCartVariantUpselling($this);
  3581.         $this->additionalCartVariantUpselling[] = $additionalCartVariantUpselling;
  3582.         return $this;
  3583.     }
  3584.     /**
  3585.      * Remove additionalCartVariantUpselling
  3586.      *
  3587.      * @param ProductVariant $additionalCartVariantUpselling
  3588.      */
  3589.     public function removeAdditionalCartVariantUpselling(ProductVariant $additionalCartVariantUpselling)
  3590.     {
  3591.         $additionalCartVariantUpselling->removeBasicCartVariantUpselling($this);
  3592.         $this->additionalCartVariantUpselling->removeElement($additionalCartVariantUpselling);
  3593.     }
  3594.     /**
  3595.      * Get additionalCartVariantUpselling
  3596.      *
  3597.      * @return Collection
  3598.      */
  3599.     public function getAdditionalCartVariantUpselling(): ?Collection
  3600.     {
  3601.         return $this->additionalCartVariantUpselling;
  3602.     }
  3603.     /**
  3604.      * Add basicCartVariantUpselling
  3605.      *
  3606.      * @param ProductVariant $basicCartVariantUpselling
  3607.      *
  3608.      * @return ProductVariant
  3609.      */
  3610.     public function addBasicCartVariantUpselling(ProductVariant $basicCartVariantUpselling): ProductVariant
  3611.     {
  3612.         $this->basicCartVariantUpselling[] = $basicCartVariantUpselling;
  3613.         return $this;
  3614.     }
  3615.     /**
  3616.      * Remove basicCartVariantUpselling
  3617.      *
  3618.      * @param ProductVariant $basicCartVariantUpselling
  3619.      */
  3620.     public function removeBasicCartVariantUpselling(ProductVariant $basicCartVariantUpselling)
  3621.     {
  3622.         $this->basicCartVariantUpselling->removeElement($basicCartVariantUpselling);
  3623.     }
  3624.     /**
  3625.      * Get basicCartVariantUpselling
  3626.      *
  3627.      * @return Collection
  3628.      */
  3629.     public function getBasicCartVariantUpselling(): ?Collection
  3630.     {
  3631.         return $this->basicCartVariantUpselling;
  3632.     }
  3633.     public function getMustHaveAllExclusiveVariants(): ?bool
  3634.     {
  3635.         return $this->mustHaveAllExclusiveVariants;
  3636.     }
  3637.     public function setMustHaveAllExclusiveVariants(?bool $mustHaveAllExclusiveVariants): self
  3638.     {
  3639.         $this->mustHaveAllExclusiveVariants $mustHaveAllExclusiveVariants;
  3640.         return $this;
  3641.     }
  3642.     public function getEvent(): ?Events
  3643.     {
  3644.         return $this->event;
  3645.     }
  3646.     public function setEvent(?Events $event): self
  3647.     {
  3648.         $this->event $event;
  3649.         return $this;
  3650.     }
  3651.     /**
  3652.      * @return Collection|LeadFormResponse[]
  3653.      */
  3654.     public function getLeadFormResponses(): Collection
  3655.     {
  3656.         return $this->leadFormResponses;
  3657.     }
  3658.     public function addLeadFormResponse(LeadFormResponse $leadFormResponse): self
  3659.     {
  3660.         if (!$this->leadFormResponses->contains($leadFormResponse)) {
  3661.             $this->leadFormResponses[] = $leadFormResponse;
  3662.             $leadFormResponse->setProductVariant($this);
  3663.         }
  3664.         return $this;
  3665.     }
  3666.     public function removeLeadFormResponse(LeadFormResponse $leadFormResponse): self
  3667.     {
  3668.         if ($this->leadFormResponses->contains($leadFormResponse)) {
  3669.             $this->leadFormResponses->removeElement($leadFormResponse);
  3670.             // set the owning side to null (unless already changed)
  3671.             if ($leadFormResponse->getProductVariant() === $this) {
  3672.                 $leadFormResponse->setProductVariant(null);
  3673.             }
  3674.         }
  3675.         return $this;
  3676.     }
  3677.     /**
  3678.      * @return Collection|LeadFormResponse[]
  3679.      */
  3680.     public function getLeadFormResponseValidations(): Collection
  3681.     {
  3682.         return $this->leadFormResponseValidations;
  3683.     }
  3684.     public function addLeadFormResponseValidation(LeadFormResponse $leadFormResponseValidation): self
  3685.     {
  3686.         if (!$this->leadFormResponseValidations->contains($leadFormResponseValidation)) {
  3687.             $this->leadFormResponseValidations[] = $leadFormResponseValidation;
  3688.             $leadFormResponseValidation->addProductVariantsValidation($this);
  3689.         }
  3690.         return $this;
  3691.     }
  3692.     public function removeLeadFormResponseValidation(LeadFormResponse $leadFormResponseValidation): self
  3693.     {
  3694.         if ($this->leadFormResponseValidations->contains($leadFormResponseValidation)) {
  3695.             $this->leadFormResponseValidations->removeElement($leadFormResponseValidation);
  3696.             // set the owning side to null (unless already changed)
  3697.             if ($leadFormResponseValidation->getProductVariantsValidation()->contains($this)) {
  3698.                 $leadFormResponseValidation->removeProductVariantsValidation($this);
  3699.             }
  3700.         }
  3701.         return $this;
  3702.     }
  3703.     /**
  3704.      * @return Collection|NewsletterTemplate[]
  3705.      */
  3706.     public function getNewsletterTemplateValidations(): Collection
  3707.     {
  3708.         return $this->newsletterTemplateValidations;
  3709.     }
  3710.     public function addNewsletterTemplateValidation(NewsletterTemplate $newsletterTemplateValidation): self
  3711.     {
  3712.         if (!$this->newsletterTemplateValidations->contains($newsletterTemplateValidation)) {
  3713.             $this->newsletterTemplateValidations[] = $newsletterTemplateValidation;
  3714.             $newsletterTemplateValidation->getProductVariantsValidation()->add($this);
  3715.         }
  3716.         return $this;
  3717.     }
  3718.     public function removeNewsletterTemplateValidation(NewsletterTemplate $newsletterTemplateValidation): self
  3719.     {
  3720.         if ($this->newsletterTemplateValidations->contains($newsletterTemplateValidation)) {
  3721.             $this->newsletterTemplateValidations->removeElement($newsletterTemplateValidation);
  3722.             // set the owning side to null (unless already changed)
  3723.             if ($newsletterTemplateValidation->getProductVariantsValidation()->contains($this)) {
  3724.                 $newsletterTemplateValidation->getProductVariantsValidation()->removeElement($this);
  3725.             }
  3726.         }
  3727.         return $this;
  3728.     }
  3729.     public function getTradeNameSM(): ?string
  3730.     {
  3731.         return $this->TradeNameSM;
  3732.     }
  3733.     public function setTradeNameSM(?string $TradeNameSM): self
  3734.     {
  3735.         $this->TradeNameSM $TradeNameSM;
  3736.         return $this;
  3737.     }
  3738.     public function getCommentForMantis(): ?string
  3739.     {
  3740.         return $this->commentForMantis;
  3741.     }
  3742.     public function setCommentForMantis(?string $commentForMantis): self
  3743.     {
  3744.         $this->commentForMantis $commentForMantis;
  3745.         return $this;
  3746.     }
  3747.     public function isNetflixVariant(): bool
  3748.     {
  3749.         foreach ($this->getPortalSettings() as $portalSetting)
  3750.         {
  3751.             if(!$portalSetting->getIsNetflixPortal()){
  3752.                 return false;
  3753.             }
  3754.         }
  3755.         return true;
  3756.     }
  3757.     /**
  3758.      * @return Collection|CalendarEvent[]
  3759.      */
  3760.     public function getCalendarEvents(): Collection
  3761.     {
  3762.         return $this->calendarEvents;
  3763.     }
  3764.     public function addCalendarEvent(CalendarEvent $calendarEvent): self
  3765.     {
  3766.         if (!$this->calendarEvents->contains($calendarEvent)) {
  3767.             $this->calendarEvents[] = $calendarEvent;
  3768.             $calendarEvent->setProductVariant($this);
  3769.         }
  3770.         return $this;
  3771.     }
  3772.     public function removeCalendarEvent(CalendarEvent $calendarEvent): self
  3773.     {
  3774.         if ($this->calendarEvents->contains($calendarEvent)) {
  3775.             $this->calendarEvents->removeElement($calendarEvent);
  3776.             // set the owning side to null (unless already changed)
  3777.             if ($calendarEvent->getProductVariant() === $this) {
  3778.                 $calendarEvent->setProductVariant(null);
  3779.             }
  3780.         }
  3781.         return $this;
  3782.     }
  3783.     public function getCouponLifetime(): ?int
  3784.     {
  3785.         return $this->couponLifetime;
  3786.     }
  3787.     public function setCouponLifetime(?int $couponLifetime): self
  3788.     {
  3789.         $this->couponLifetime $couponLifetime;
  3790.         return $this;
  3791.     }
  3792.     public function getFreshMailIntegration(): ?bool
  3793.     {
  3794.         return $this->freshMailIntegration;
  3795.     }
  3796.     public function setFreshMailIntegration(?bool $freshMailIntegration): self
  3797.     {
  3798.         $this->freshMailIntegration $freshMailIntegration;
  3799.         return $this;
  3800.     }
  3801.     public function getFreshMailRecipientListHash(): ?string
  3802.     {
  3803.         return $this->freshMailRecipientListHash;
  3804.     }
  3805.     public function setFreshMailRecipientListHash(?string $freshMailRecipientListHash): self
  3806.     {
  3807.         $this->freshMailRecipientListHash $freshMailRecipientListHash;
  3808.         return $this;
  3809.     }
  3810.     public function getOrderOnSiteContent(): ?string
  3811.     {
  3812.         return $this->orderOnSiteContent;
  3813.     }
  3814.     public function setOrderOnSiteContent(?string $orderOnSiteContent): self
  3815.     {
  3816.         $this->orderOnSiteContent $orderOnSiteContent;
  3817.         return $this;
  3818.     }
  3819.     public function getManualUserVerification(): ?bool
  3820.     {
  3821.         return $this->manualUserVerification;
  3822.     }
  3823.     public function setManualUserVerification(bool $manualUserVerification): self
  3824.     {
  3825.         $this->manualUserVerification $manualUserVerification;
  3826.         return $this;
  3827.     }
  3828.     public function getProductVariantOrderQuantity(): ?ProductVariantOrderQuantity
  3829.     {
  3830.         return $this->productVariantOrderQuantity;
  3831.     }
  3832.     public function setProductVariantOrderQuantity(ProductVariantOrderQuantity $productVariantOrderQuantity): self
  3833.     {
  3834.         $this->productVariantOrderQuantity $productVariantOrderQuantity;
  3835.         // set the owning side of the relation if necessary
  3836.         if ($productVariantOrderQuantity->getProductVariant() !== $this) {
  3837.             $productVariantOrderQuantity->setProductVariant($this);
  3838.         }
  3839.         return $this;
  3840.     }
  3841.     public function getProductVariantVirtualCurrencySettings(): ?ProductVariantVirtualCurrencySettings
  3842.     {
  3843.         return $this->productVariantVirtualCurrencySettings;
  3844.     }
  3845.     public function setProductVariantVirtualCurrencySettings(ProductVariantVirtualCurrencySettings $productVariantVirtualCurrencySettings): self
  3846.     {
  3847.         $this->productVariantVirtualCurrencySettings $productVariantVirtualCurrencySettings;
  3848.         // set the owning side of the relation if necessary
  3849.         if ($productVariantVirtualCurrencySettings->getProductVariant() !== $this) {
  3850.             $productVariantVirtualCurrencySettings->setProductVariant($this);
  3851.         }
  3852.         return $this;
  3853.     }
  3854.     /**
  3855.      * @return Collection|PaymentReminders[]
  3856.      */
  3857.     public function getPaymentReminders(): Collection
  3858.     {
  3859.         return $this->paymentReminders;
  3860.     }
  3861.     public function addPaymentReminder(PaymentReminders $paymentReminder): self
  3862.     {
  3863.         if (!$this->paymentReminders->contains($paymentReminder)) {
  3864.             $this->paymentReminders[] = $paymentReminder;
  3865.             $paymentReminder->addProductVariant($this);
  3866.         }
  3867.         return $this;
  3868.     }
  3869.     public function removePaymentReminder(PaymentReminders $paymentReminder): self
  3870.     {
  3871.         if ($this->paymentReminders->contains($paymentReminder)) {
  3872.             $this->paymentReminders->removeElement($paymentReminder);
  3873.             $paymentReminder->removeProductVariant($this);
  3874.         }
  3875.         return $this;
  3876.     }
  3877.     /**
  3878.      * @return Collection|ProductVariantUpselling[]
  3879.      */
  3880.     public function getProductVariantUpsellings(): Collection
  3881.     {
  3882.         return $this->productVariantUpsellings;
  3883.     }
  3884.     public function addProductVariantUpselling(ProductVariantUpselling $productVariantUpselling): self
  3885.     {
  3886.         if (!$this->productVariantUpsellings->contains($productVariantUpselling)) {
  3887.             $this->productVariantUpsellings[] = $productVariantUpselling;
  3888.             $productVariantUpselling->setProductVariant($this);
  3889.         }
  3890.         return $this;
  3891.     }
  3892.     public function removeProductVariantUpselling(ProductVariantUpselling $productVariantUpselling): self
  3893.     {
  3894.         if ($this->productVariantUpsellings->contains($productVariantUpselling)) {
  3895.             $this->productVariantUpsellings->removeElement($productVariantUpselling);
  3896.             // set the owning side to null (unless already changed)
  3897.             if ($productVariantUpselling->getProductVariant() === $this) {
  3898.                 $productVariantUpselling->setProductVariant(null);
  3899.             }
  3900.         }
  3901.         return $this;
  3902.     }
  3903.     /**
  3904.      * @return Collection|ProductVariantUpselling[]
  3905.      */
  3906.     public function getProductVariantPromoted(): Collection
  3907.     {
  3908.         return $this->productVariantPromoted;
  3909.     }
  3910.     public function addProductVariantPromoted(ProductVariantUpselling $productVariantUpselling): self
  3911.     {
  3912.         if (!$this->productVariantPromoted->contains($productVariantUpselling)) {
  3913.             $this->productVariantPromoted[] = $productVariantUpselling;
  3914.             $productVariantUpselling->setPromotedProduct($this);
  3915.         }
  3916.         return $this;
  3917.     }
  3918.     public function removeProductVariantPromoted(ProductVariantUpselling $productVariantUpselling): self
  3919.     {
  3920.         $this->productVariantPromoted->removeElement($productVariantUpselling);
  3921.         return $this;
  3922.     }
  3923.     /**
  3924.      * @return Collection|FastLeadTemplate[]
  3925.      */
  3926.     public function getFastLeadTemplates(): Collection
  3927.     {
  3928.         return $this->fastLeadTemplates;
  3929.     }
  3930.     public function addFastLeadTemplate(FastLeadTemplate $fastLeadTemplate): self
  3931.     {
  3932.         if (!$this->fastLeadTemplates->contains($fastLeadTemplate)) {
  3933.             $this->fastLeadTemplates[] = $fastLeadTemplate;
  3934.             $fastLeadTemplate->setProductVariant($this);
  3935.         }
  3936.         return $this;
  3937.     }
  3938.     public function removeFastLeadTemplate(FastLeadTemplate $fastLeadTemplate): self
  3939.     {
  3940.         if ($this->fastLeadTemplates->contains($fastLeadTemplate)) {
  3941.             $this->fastLeadTemplates->removeElement($fastLeadTemplate);
  3942.             // set the owning side to null (unless already changed)
  3943.             if ($fastLeadTemplate->getProductVariant() === $this) {
  3944.                 $fastLeadTemplate->setProductVariant(null);
  3945.             }
  3946.         }
  3947.         return $this;
  3948.     }
  3949.     public function getImageUrlUpselling(): ?string
  3950.     {
  3951.         return $this->imageUrlUpselling;
  3952.     }
  3953.     public function setImageUrlUpselling(?string $imageUrlUpselling): self
  3954.     {
  3955.         $this->imageUrlUpselling $imageUrlUpselling;
  3956.         return $this;
  3957.     }
  3958.     public function getUseUploadedImageUpselling(): ?bool
  3959.     {
  3960.         return $this->useUploadedImageUpselling;
  3961.     }
  3962.     public function setUseUploadedImageUpselling(bool $useUploadedImageUpselling): self
  3963.     {
  3964.         $this->useUploadedImageUpselling $useUploadedImageUpselling;
  3965.         return $this;
  3966.     }
  3967.     public function setImageFileUpselling(?File $imageFileUpselling null)
  3968.     {
  3969.         $this->imageFileUpselling $imageFileUpselling;
  3970.     }
  3971.     public function getImageFileUpselling(): ?File
  3972.     {
  3973.         return $this->imageFileUpselling;
  3974.     }
  3975.     public function setUploadedImageUpselling(?string $uploadedImageUpselling)
  3976.     {
  3977.         $this->uploadedImageUpselling $uploadedImageUpselling;
  3978.     }
  3979.     public function getUploadedImageUpselling()
  3980.     {
  3981.         return $this->uploadedImageUpselling;
  3982.     }
  3983.     public function getDescriptionUpselling(): ?string
  3984.     {
  3985.         return $this->descriptionUpselling;
  3986.     }
  3987.     public function setDescriptionUpselling(?string $descriptionUpselling): self
  3988.     {
  3989.         $this->descriptionUpselling $descriptionUpselling;
  3990.         return $this;
  3991.     }
  3992.     public function getLinkToProductUpselling()
  3993.     {
  3994.         return $this->linkToProductUpselling;
  3995.     }
  3996.     public function setLinkToProductUpselling($linkToProductUpselling): self
  3997.     {
  3998.         $this->linkToProductUpselling $linkToProductUpselling;
  3999.         return $this;
  4000.     }
  4001.     public function getCertificates(): Collection
  4002.     {
  4003.         return $this->certificates;
  4004.     }
  4005.     public function addCertificate(Certificate $certificate): self
  4006.     {
  4007.         if (!$this->certificates->contains($certificate)) {
  4008.             $this->certificates[] = $certificate;
  4009.             $certificate->getProductVariants()->add($this);
  4010.         }
  4011.         return $this;
  4012.     }
  4013.     public function removeCertificate(Certificate $certificate): self
  4014.     {
  4015.         if ($this->certificates->contains($certificate)) {
  4016.             $this->certificates->removeElement($certificate);
  4017.             if ($certificate->getProductVariants()->contains($this)) {
  4018.                 $certificate->getProductVariants()->removeElement($this);
  4019.             }
  4020.         }
  4021.         return $this;
  4022.     }
  4023.     public function getShowButtonAdditionalAddress(): ?bool
  4024.     {
  4025.         return $this->showButtonAdditionalAddress;
  4026.     }
  4027.     public function setShowButtonAdditionalAddress(?bool $showButtonAdditionalAddress): self
  4028.     {
  4029.         $this->showButtonAdditionalAddress $showButtonAdditionalAddress;
  4030.         return $this;
  4031.     }
  4032.     /**
  4033.      * @return Collection|Omnibus[]
  4034.      */
  4035.     public function getOmnibus(): Collection
  4036.     {
  4037.         return $this->omnibus;
  4038.     }
  4039.     public function addOmnibus(Omnibus $omnibus): self
  4040.     {
  4041.         if (!$this->omnibus->contains($omnibus)) {
  4042.             $this->omnibus[] = $omnibus;
  4043.             $omnibus->setProductVariant($this);
  4044.         }
  4045.         return $this;
  4046.     }
  4047.     public function removeOmnibus(Omnibus $omnibus): self
  4048.     {
  4049.         if ($this->omnibus->contains($omnibus)) {
  4050.             $this->omnibus->removeElement($omnibus);
  4051.         }
  4052.         return $this;
  4053.     }
  4054.     /**
  4055.      * @return bool
  4056.      */
  4057.     public function getIsAccessWithoutPayment(): ?bool
  4058.     {
  4059.         return $this->isAccessWithoutPayment;
  4060.     }
  4061.     /**
  4062.      * @param bool $isAccessWithoutPayment
  4063.      */
  4064.     public function setIsAccessWithoutPayment(?bool $isAccessWithoutPayment): void
  4065.     {
  4066.         $this->isAccessWithoutPayment $isAccessWithoutPayment;
  4067.     }
  4068.     public function getMaxQuantityInCart(): ?int
  4069.     {
  4070.         return $this->maxQuantityInCart;
  4071.     }
  4072.     public function setMaxQuantityInCart(?int $maxQuantityInCart): self
  4073.     {
  4074.         $this->maxQuantityInCart $maxQuantityInCart;
  4075.         return $this;
  4076.     }
  4077.     /**
  4078.      * @return Collection|ShippingType[]
  4079.      */
  4080.     public function getShippingTypes(): Collection
  4081.     {
  4082.         return $this->shippingTypes;
  4083.     }
  4084.     public function addShippingType(ShippingType $shippingType): self
  4085.     {
  4086.         if (!$this->shippingTypes->contains($shippingType)) {
  4087.             $this->shippingTypes[] = $shippingType;
  4088.         }
  4089.         return $this;
  4090.     }
  4091.     public function removeShippingType(ShippingType $shippingType): self
  4092.     {
  4093.         if ($this->shippingTypes->contains($shippingType)) {
  4094.             $this->shippingTypes->removeElement($shippingType);
  4095.         }
  4096.         return $this;
  4097.     }
  4098.     public function getSize(): ?ProductVariantSize
  4099.     {
  4100.         return $this->size;
  4101.     }
  4102.     public function setSize(?ProductVariantSize $size): self
  4103.     {
  4104.         $this->size $size;
  4105.         return $this;
  4106.     }
  4107.     public function getExcludeDefaultShippingType(): ?bool
  4108.     {
  4109.         return $this->excludeDefaultShippingType;
  4110.     }
  4111.     public function setExcludeDefaultShippingType(bool $excludeDefaultShippingType): self
  4112.     {
  4113.         $this->excludeDefaultShippingType $excludeDefaultShippingType;
  4114.         return $this;
  4115.     }
  4116.     public function isShippingVariant(): bool
  4117.     {
  4118.         return
  4119.             !$this->getIsCompletelyDigital() &&
  4120.             !$this->getIsVirtual() &&
  4121.             !$this->isEvent() &&
  4122.             !$this->getIsUniqskillsProduct();
  4123.     }
  4124.     public function getIsCompletelyDigital(): ?bool
  4125.     {
  4126.         return $this->isCompletelyDigital;
  4127.     }
  4128.     public function setIsCompletelyDigital(bool $isCompletelyDigital): self
  4129.     {
  4130.         $this->isCompletelyDigital $isCompletelyDigital;
  4131.         return $this;
  4132.     }
  4133.     /**
  4134.      * @return Collection|CertificatePathElement[]
  4135.      */
  4136.     public function getCertificatePathElements(): Collection
  4137.     {
  4138.         return $this->certificatePathElements;
  4139.     }
  4140.     public function addCertificatePathElement(CertificatePathElement $certificatePathElement): self
  4141.     {
  4142.         if (!$this->certificatePathElements->contains($certificatePathElement)) {
  4143.             $this->certificatePathElements[] = $certificatePathElement;
  4144.             $certificatePathElement->addProductVariant($this);
  4145.         }
  4146.         return $this;
  4147.     }
  4148.     public function removeCertificatePathElement(CertificatePathElement $certificatePathElement): self
  4149.     {
  4150.         if ($this->certificatePathElements->contains($certificatePathElement)) {
  4151.             $this->certificatePathElements->removeElement($certificatePathElement);
  4152.             $certificatePathElement->removeProductVariant($this);
  4153.         }
  4154.         return $this;
  4155.     }
  4156.     public function hasPaperRelease(): ?bool
  4157.     {
  4158.         return $this->hasPaperRelease;
  4159.     }
  4160.     public function setHasPaperRelease(?bool $hasPaperRelease): self
  4161.     {
  4162.         $this->hasPaperRelease $hasPaperRelease;
  4163.         return $this;
  4164.     }
  4165.     public function getIsNPWZRequired(): ?bool
  4166.     {
  4167.         return $this->isNPWZRequired !== false;
  4168.     }
  4169.     public function setIsNPWZRequired(?bool $isNPWZRequired): self
  4170.     {
  4171.         $this->isNPWZRequired $isNPWZRequired;
  4172.         return $this;
  4173.     }
  4174.     public function isSaleDisabled(): ?bool
  4175.     {
  4176.         return $this->isSaleDisabled;
  4177.     }
  4178.     public function setIsSaleDisabled(bool $isSaleDisabled): self
  4179.     {
  4180.         $this->isSaleDisabled $isSaleDisabled;
  4181.         return $this;
  4182.     }
  4183.     public function getTechnicalInformationForMailTele(): ?string
  4184.     {
  4185.         return $this->technicalInformationForMailTele;
  4186.     }
  4187.     public function setTechnicalInformationForMailTele(?string $technicalInformationForMailTele): self
  4188.     {
  4189.         $this->technicalInformationForMailTele $technicalInformationForMailTele;
  4190.         return $this;
  4191.     }
  4192.     /**
  4193.      * @return Collection|AdditionalFile[]
  4194.      */
  4195.     public function getAdditionalFiles(): Collection
  4196.     {
  4197.         return $this->additionalFiles;
  4198.     }
  4199.     public function addAdditionalFile(AdditionalFile $additionalFile): self
  4200.     {
  4201.         if (!$this->additionalFiles->contains($additionalFile)) {
  4202.             $this->additionalFiles[] = $additionalFile;
  4203.             $additionalFile->setProductVariant($this);
  4204.         }
  4205.         return $this;
  4206.     }
  4207.     public function removeAdditionalFile(AdditionalFile $additionalFile): self
  4208.     {
  4209.         if ($this->additionalFiles->contains($additionalFile)) {
  4210.             $this->additionalFiles->removeElement($additionalFile);
  4211.             // set the owning side to null (unless already changed)
  4212.             if ($additionalFile->getProductVariant() === $this) {
  4213.                 $additionalFile->setProductVariant(null);
  4214.             }
  4215.         }
  4216.         return $this;
  4217.     }
  4218.     public function addSalesManagoCatalog(SalesManagoCatalog $salesManagoCatalog): self
  4219.     {
  4220.         if (!$this->salesManagoCatalogs->contains($salesManagoCatalog))
  4221.         {
  4222.             $this->salesManagoCatalogs[] = $salesManagoCatalog;
  4223.         }
  4224.         return $this;
  4225.     }
  4226.     public function removeSalesManagoCatalog(SalesManagoCatalog $salesManagoCatalog): self
  4227.     {
  4228.         if ($this->salesManagoCatalogs->contains($salesManagoCatalog))
  4229.         {
  4230.             $this->salesManagoCatalogs->removeElement($salesManagoCatalog);
  4231.         }
  4232.         return $this;
  4233.     }
  4234.     public function getSalesManagoCatalogs(): Collection
  4235.     {
  4236.         return $this->salesManagoCatalogs;
  4237.     }
  4238.     public function getSalesManagoProductVariant(): ?SalesManagoProductVariant
  4239.     {
  4240.         return $this->salesManagoProductVariant;
  4241.     }
  4242.     public function setSalesManagoProductVariant(SalesManagoProductVariant $salesManagoProductVariant): self
  4243.     {
  4244.         $this->salesManagoProductVariant $salesManagoProductVariant;
  4245.         // set the owning side of the relation if necessary
  4246.         if ($salesManagoProductVariant->getProductVariant() !== $this) {
  4247.             $salesManagoProductVariant->setProductVariant($this);
  4248.         }
  4249.         return $this;
  4250.     }
  4251.     /**
  4252.      * @return Collection|UserFlag[]
  4253.      */
  4254.     public function getUserFlags(): Collection
  4255.     {
  4256.         return $this->userFlags;
  4257.     }
  4258.     public function addUserFlag(UserFlag $userFlag): self
  4259.     {
  4260.         if (!$this->userFlags->contains($userFlag)) {
  4261.             $this->userFlags[] = $userFlag;
  4262.             $userFlag->addProductVariant($this);
  4263.         }
  4264.         return $this;
  4265.     }
  4266.     public function removeUserFlag(UserFlag $userFlag): self
  4267.     {
  4268.         if ($this->userFlags->contains($userFlag)) {
  4269.             $this->userFlags->removeElement($userFlag);
  4270.             $userFlag->removeProductVariant($this);
  4271.         }
  4272.         return $this;
  4273.     }
  4274.     public function getProductVariantReviewLinks(): Collection
  4275.     {
  4276.         return $this->productVariantReviewLinks;
  4277.     }
  4278.     public function addProductVariantReviewLink(ProductVariantReviewLink $productVariantReviewLink): self
  4279.     {
  4280.         if (!$this->productVariantReviewLinks->contains($productVariantReviewLink))
  4281.         {
  4282.             $this->productVariantReviewLinks[] = $productVariantReviewLink;
  4283.             $productVariantReviewLink->setProductVariant($this);
  4284.         }
  4285.         return $this;
  4286.     }
  4287.     public function removeProductVariantReviewLink(ProductVariantReviewLink $productVariantReviewLink): self
  4288.     {
  4289.         if ($this->productVariantReviewLinks->contains($productVariantReviewLink))
  4290.         {
  4291.             $this->productVariantReviewLinks->removeElement($productVariantReviewLink);
  4292.             // set the owning side to null (unless already changed)
  4293.             if ($productVariantReviewLink->getProductVariant() === $this)
  4294.             {
  4295.                 $productVariantReviewLink->setProductVariant(null);
  4296.             }
  4297.         }
  4298.         return $this;
  4299.     }
  4300.     public function getOriginal(): ?self
  4301.     {
  4302.         return $this->original;
  4303.     }
  4304.     public function setOriginal(?self $original): self
  4305.     {
  4306.         $this->original $original;
  4307.         return $this;
  4308.     }
  4309.     /**
  4310.      * @return Collection|self[]
  4311.      */
  4312.     public function getSubstitution(): Collection
  4313.     {
  4314.         return $this->substitution;
  4315.     }
  4316.     public function addSubstitution(self $substitution): self
  4317.     {
  4318.         if (!$this->substitution->contains($substitution)) {
  4319.             $this->substitution[] = $substitution;
  4320.             $substitution->setOriginal($this);
  4321.         }
  4322.         return $this;
  4323.     }
  4324.     public function removeSubstitution(self $substitution): self
  4325.     {
  4326.         if ($this->substitution->contains($substitution)) {
  4327.             $this->substitution->removeElement($substitution);
  4328.             // set the owning side to null (unless already changed)
  4329.             if ($substitution->getOriginal() === $this) {
  4330.                 $substitution->setOriginal(null);
  4331.             }
  4332.         }
  4333.         return $this;
  4334.     }
  4335.     public function isMagazine(): ?bool
  4336.     {
  4337.         if (
  4338.             $this->getMasterProduct()->getProductGosType()
  4339.             && $this->getMasterProduct()->getProductGosType()->getName() === 'czasopismo'
  4340.         )
  4341.         {
  4342.             return true;
  4343.         }
  4344.         if (
  4345.             $this->getMasterProduct()->getProductType()
  4346.             && $this->getMasterProduct()->getProductType()->getProductMainType()
  4347.             && $this->getMasterProduct()->getProductType()->getProductMainType()->getSlug() === 'czasopisma'
  4348.         )
  4349.         {
  4350.             return true;
  4351.         }
  4352.         if (
  4353.             $this->getMasterProduct()->getProductType()
  4354.             && stripos($this->getMasterProduct()->getProductType()->getName(), 'czasopism') !== false
  4355.         )
  4356.         {
  4357.             return true;
  4358.         }
  4359.         return null;
  4360.     }
  4361.     /**
  4362.      * @return Collection|AdditionalOptionsByClientType[]
  4363.      */
  4364.     public function getAdditionalOptionsByClientTypes(): Collection
  4365.     {
  4366.         return $this->additionalOptionsByClientTypes;
  4367.     }
  4368.     public function addAdditionalOptionsByClientType(AdditionalOptionsByClientType $additionalOptionsByClientType): self
  4369.     {
  4370.         if (!$this->additionalOptionsByClientTypes->contains($additionalOptionsByClientType)) {
  4371.             $this->additionalOptionsByClientTypes[] = $additionalOptionsByClientType;
  4372.             $additionalOptionsByClientType->setProductVariant($this);
  4373.         }
  4374.         return $this;
  4375.     }
  4376.     public function removeAdditionalOptionsByClientType(AdditionalOptionsByClientType $additionalOptionsByClientType): self
  4377.     {
  4378.         if ($this->additionalOptionsByClientTypes->contains($additionalOptionsByClientType)) {
  4379.             $this->additionalOptionsByClientTypes->removeElement($additionalOptionsByClientType);
  4380.             // set the owning side to null (unless already changed)
  4381.             if ($additionalOptionsByClientType->getProductVariant() === $this) {
  4382.                 $additionalOptionsByClientType->setProductVariant(null);
  4383.             }
  4384.         }
  4385.         return $this;
  4386.     }
  4387.     public function getAdditionalAccessProductVariant(): ?self
  4388.     {
  4389.         return $this->additionalAccessProductVariant;
  4390.     }
  4391.     public function setAdditionalAccessProductVariant(?self $additionalAccessProductVariant): self
  4392.     {
  4393.         $this->additionalAccessProductVariant $additionalAccessProductVariant;
  4394.         return $this;
  4395.     }
  4396.     public function getGivenProductVariantForAdditionalAccess(): ?self
  4397.     {
  4398.         return $this->givenProductVariantForAdditionalAccess;
  4399.     }
  4400.     public function setGivenProductVariantForAdditionalAccess(?self $givenProductVariantForAdditionalAccess): self
  4401.     {
  4402.         $this->givenProductVariantForAdditionalAccess $givenProductVariantForAdditionalAccess;
  4403.         // set (or unset) the owning side of the relation if necessary
  4404.         $newAdditionalAccessProductVariant null === $givenProductVariantForAdditionalAccess null $this;
  4405.         if ($givenProductVariantForAdditionalAccess->getAdditionalAccessProductVariant() !== $newAdditionalAccessProductVariant) {
  4406.             $givenProductVariantForAdditionalAccess->setAdditionalAccessProductVariant($newAdditionalAccessProductVariant);
  4407.         }
  4408.         return $this;
  4409.     }
  4410.     public function getAdditionalInformationForMail(): ?string
  4411.     {
  4412.         return $this->additionalInformationForMail;
  4413.     }
  4414.     public function setAdditionalInformationForMail(?string $additionalInformationForMail): self
  4415.     {
  4416.         $this->additionalInformationForMail $additionalInformationForMail;
  4417.         return $this;
  4418.     }
  4419.     public function findPortalSettings(): ?PortalSettings
  4420.     {
  4421.         $portalSettings = !$this->getPortalSettings()->isEmpty() ?
  4422.             $this->getPortalSettings()->first() :
  4423.             null;
  4424.         if ($portalSettings === null) {
  4425.             $masterProduct $this->getMasterProduct();
  4426.             /** @var ProductAssociation $productAssociation */
  4427.             foreach ($masterProduct->getProductAssociation() as $productAssociation) {
  4428.                 if ($productAssociation->getPortalSettings() !== null) {
  4429.                     return $productAssociation->getPortalSettings();
  4430.                 }
  4431.             }
  4432.         }
  4433.         return $portalSettings;
  4434.     }
  4435.     public function expandVariantNumberWithFundings(): array
  4436.     {
  4437.         if (!preg_match('#^(\d+)/(.*)$#'$this->getProductVariantNoComplete(), $matches)) {
  4438.             return [$this->getProductVariantNoComplete()];
  4439.         }
  4440.         $numeric $matches[1];
  4441.         $suffix  $matches[2];
  4442.         return [
  4443.             $this->getProductVariantNoComplete(), // bez dofinansowania
  4444.             $numeric '0/' $suffix,            // dofinansowanie 100%
  4445.             $numeric '3/' $suffix,            // dofinansowanie >= 70%
  4446.         ];
  4447.     }
  4448.     public function getDescriptionUpsellingMaxHeight(): ?int
  4449.     {
  4450.         return $this->descriptionUpsellingMaxHeight;
  4451.     }
  4452.     public function setDescriptionUpsellingMaxHeight(?int $descriptionUpsellingMaxHeight): self
  4453.     {
  4454.         $this->descriptionUpsellingMaxHeight $descriptionUpsellingMaxHeight;
  4455.         return $this;
  4456.     }
  4457.     public function isTestProduct(): bool
  4458.     {
  4459.         return $this->getVariantState() === 'Product test';
  4460.     }
  4461.     public function isPriceGrossCalculated(): bool
  4462.     {
  4463.         return $this->isPriceGrossCalculated;
  4464.     }
  4465.     /**
  4466.      * UWAGA! Stawka VAT jest dynamicznie ustawiana na podstawie typu klienta i kraju w ProductVariantPriceListener
  4467.      * @return int
  4468.      */
  4469.     public function getVatRate(): int
  4470.     {
  4471.         return $this->vatRate;
  4472.     }
  4473.     public function getSourceSystem(): ProductSourceSystem
  4474.     {
  4475.         return $this->getMasterProduct()->getSourceSystem();
  4476.     }
  4477.     public function getProductVariantEventInfos(): Collection
  4478.     {
  4479.         return $this->productVariantEventInfos;
  4480.     }
  4481.     public function getProductVariantEventInfo(): ?ProductVariantEventInfo
  4482.     {
  4483.         return $this->getProductVariantEventInfos()->first() !== false $this->getProductVariantEventInfos()->first() : null;
  4484.     }
  4485.     public function addProductVariantEventInfo(ProductVariantEventInfo $productVariantEventInfo): self
  4486.     {
  4487.         if (!$this->productVariantEventInfos->contains($productVariantEventInfo)) {
  4488.             $this->productVariantEventInfos[] = $productVariantEventInfo;
  4489.             $productVariantEventInfo->setProductVariant($this);
  4490.         }
  4491.         return $this;
  4492.     }
  4493.     public function removeProductVariantEventInfo(ProductVariantEventInfo $productVariantEventInfo): self
  4494.     {
  4495.         if ($this->productVariantEventInfos->contains($productVariantEventInfo)) {
  4496.             $this->productVariantEventInfos->removeElement($productVariantEventInfo);
  4497.             // set the owning side to null (unless already changed)
  4498.             if ($productVariantEventInfo->getProductVariant() === $this) {
  4499.                 $productVariantEventInfo->setProductVariant(null);
  4500.             }
  4501.         }
  4502.         return $this;
  4503.     }
  4504.     public function getTargetVariant(): ?self
  4505.     {
  4506.         return $this->targetVariant;
  4507.     }
  4508.     public function setTargetVariant(?self $targetVariant): self
  4509.     {
  4510.         $this->targetVariant $targetVariant;
  4511.         return $this;
  4512.     }
  4513. }