src/Entity/Products.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Trait\CreatedAtTrait;
  4. use App\Entity\Trait\SlugTrait;
  5. use App\Repository\ProductsRepository;
  6. use Doctrine\Common\Collections\ArrayCollection;
  7. use Doctrine\Common\Collections\Collection;
  8. use Doctrine\DBAL\Types\Types;
  9. use Doctrine\ORM\Mapping as ORM;
  10. use Symfony\Component\Validator\Constraints as Assert;
  11. #[ORM\Entity(repositoryClassProductsRepository::class)]
  12. class Products
  13. {
  14.     use CreatedAtTrait;
  15.     use SlugTrait;
  16.     #[ORM\Id]
  17.     #[ORM\GeneratedValue]
  18.     #[ORM\Column(type'integer')]
  19.     private $id;
  20.     #[ORM\Column(type'string'length255)]
  21.     #[Assert\NotBlank(message'Le nom du produit ne peut pas être vide')]
  22.     #[Assert\Length(
  23.         min2,
  24.         max200,
  25.         minMessage'Le titre doit faire au moins {{ limit }} caractères',
  26.         maxMessage'Le titre ne doit pas faire plus de {{ limit }} caractères'
  27.     )]
  28.     private $name;
  29.     #[ORM\Column(type'text'nullabletrue)]
  30.     private $description;
  31.     #[ORM\Column(type'integer'nullabletrue)]
  32.     private $price;
  33.     #[ORM\Column(type'integer'nullabletrue)]
  34.     #[Assert\PositiveOrZero(message'Le stock ne peut pas être négatif')]
  35.     private $stock;
  36.     #[ORM\ManyToOne(targetEntityCategories::class, inversedBy'products')]
  37.     #[ORM\JoinColumn(nullabletrue)]
  38.     private $categories;
  39.     #[ORM\OneToMany(mappedBy'products'targetEntityImages::class, orphanRemovaltruecascade: ['persist'])]
  40.     private $images;
  41.     #[ORM\OneToMany(mappedBy'products'targetEntityOrdersDetails::class)]
  42.     private $ordersDetails;
  43.     #[ORM\ManyToOne(inversedBy'productsAnswser1')]
  44.     private ?Categories $answer1 null;
  45.     #[ORM\ManyToOne(inversedBy'productsAnswer2')]
  46.     private ?Categories $answer2 null;
  47.     #[ORM\ManyToOne(inversedBy'productsAnswer3')]
  48.     private ?Categories $answer3 null;
  49.     #[ORM\ManyToOne(inversedBy'productsAnswer4')]
  50.     private ?Categories $answer4 null;
  51.     #[ORM\ManyToOne(inversedBy'productsAnswer5')]
  52.     private ?Categories $answer5 null;
  53.     #[ORM\ManyToOne(inversedBy'productsAnswer6')]
  54.     private ?Categories $answer6 null;
  55.     #[ORM\Column(nullabletrue)]
  56.     private ?bool $accessory null;
  57.     #[ORM\ManyToMany(targetEntityself::class, inversedBy'accessories_sources')]
  58.     #[ORM\JoinTable(
  59.         name'products_products',
  60.         joinColumns: [
  61.             new ORM\JoinColumn(name'products_source'referencedColumnName'id')
  62.         ],
  63.         inverseJoinColumns: [
  64.             new ORM\JoinColumn(name'products_target'referencedColumnName'id')
  65.         ]
  66.     )]
  67.     private Collection $accessories;
  68.     #[ORM\ManyToMany(
  69.         targetEntityself::class,
  70.         mappedBy'accessories'
  71.     )]
  72.     private Collection $accessories_sources;
  73.     #[ORM\ManyToMany(targetEntityself::class)]
  74.     #[ORM\JoinTable(name'products_linked')]
  75.     private Collection $linkedProducts;
  76.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  77.     private ?string $header null;
  78.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  79.     private ?string $footer null;
  80.     #[ORM\Column(length255nullabletrue)]
  81.     private ?string $subType null;
  82.     #[ORM\Column(length255nullabletrue)]
  83.     private ?string $capacity null;
  84.     #[ORM\Column(length255nullabletrue)]
  85.     private ?string $length null;
  86.     #[ORM\Column(length255nullabletrue)]
  87.     private ?string $height null;
  88.     #[ORM\Column(length255nullabletrue)]
  89.     private ?string $gas null;
  90.     #[ORM\Column(length255nullabletrue)]
  91.     private ?string $caliber null;
  92.     #[ORM\Column(length255nullabletrue)]
  93.     private ?string $thickness null;
  94.     #[ORM\Column(length255nullabletrue)]
  95.     private ?string $speed null;
  96.     #[ORM\Column(length255nullabletrue)]
  97.     private ?string $thread null;
  98.     #[ORM\Column(length255nullabletrue)]
  99.     private ?string $title null;
  100.     #[ORM\Column(length255nullabletrue)]
  101.     private ?string $subTitle null;
  102.     #[ORM\Column(length255nullabletrue)]
  103.     private ?string $accessoryTxt null;
  104.     #[ORM\Column(length255nullabletrue)]
  105.     private ?string $weight null;
  106.     #[ORM\Column(length255nullabletrue)]
  107.     private ?string $mainReference null;
  108.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  109.     private ?string $donneesTechniques null;
  110.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  111.     private ?string $videoProduit null;
  112.     #[ORM\Column(length255nullabletrue)]
  113.     private ?string $categorie1 null;
  114.     #[ORM\Column(length255nullabletrue)]
  115.     private ?string $categorie2 null;
  116.     #[ORM\Column(length255nullabletrue)]
  117.     private ?string $categorie3 null;
  118.     #[ORM\Column(length255nullabletrue)]
  119.     private ?string $derniereCategorie null;
  120.     #[ORM\Column(length255nullabletrue)]
  121.     private ?string $graduation null;
  122.     #[ORM\Column(length255nullabletrue)]
  123.     private ?string $inPort null;
  124.     #[ORM\Column(length255nullabletrue)]
  125.     private ?string $outPort null;
  126.     #[ORM\Column(nullabletrue)]
  127.     private ?bool $boolGraduation null;
  128.     #[ORM\Column(nullabletrue)]
  129.     private ?bool $boolInPort null;
  130.     #[ORM\Column(nullabletrue)]
  131.     private ?bool $boolOutPort null;
  132.     #[ORM\Column(length255nullabletrue)]
  133.     private ?string $flowPressure null;
  134.     #[ORM\Column(length255nullabletrue)]
  135.     private ?string $maximumPressure null;
  136.     #[ORM\Column(length255nullabletrue)]
  137.     private ?string $drillingThickness null;
  138.     #[ORM\Column(length255nullabletrue)]
  139.     private ?string $pressureInBar null;
  140.     #[ORM\Column(length255nullabletrue)]
  141.     private ?string $accessoryType null;
  142.     #[ORM\Column(length255nullabletrue)]
  143.     private ?string $driftThickness null;
  144.     #[ORM\Column(length255nullabletrue)]
  145.     private ?string $gougingThickness null;
  146.     #[ORM\Column(length255nullabletrue)]
  147.     private ?string $speedGl null;
  148.     #[ORM\Column(length255nullabletrue)]
  149.     private ?string $subSubType null;
  150.     #[ORM\ManyToMany(targetEntityself::class)]
  151.     #[ORM\JoinTable(name'accessories_webapp')]
  152.     private Collection $accessories_webapp;
  153.     #[ORM\ManyToMany(
  154.     targetEntityself::class,
  155.     mappedBy'accessories_webapp'
  156.     )]
  157.     private Collection $accessories_webapp_sources;
  158.     #[ORM\OneToMany(mappedBy'product'targetEntityProductAccessories::class)]
  159.     private Collection $productAccessories;
  160.     public function __construct()
  161.     {
  162.         $this->images = new ArrayCollection();
  163.         $this->ordersDetails = new ArrayCollection();
  164.         $this->created_at = new \DateTimeImmutable();
  165.         $this->accessories = new ArrayCollection();
  166.         $this->linkedProducts = new ArrayCollection();
  167.         $this->accessories_webapp = new ArrayCollection();
  168.         $this->productAccessories = new ArrayCollection();
  169.         $this->accessories_webapp_sources = new ArrayCollection();
  170.         $this->accessories_sources = new ArrayCollection();
  171.     }
  172.     public function getId(): ?int
  173.     {
  174.         return $this->id;
  175.     }
  176.     public function getName(): ?string
  177.     {
  178.         return $this->name;
  179.     }
  180.     public function setName(string $name): self
  181.     {
  182.         $this->name $name;
  183.         return $this;
  184.     }
  185.     public function getDescription(): ?string
  186.     {
  187.         if (!$this->description) {
  188.             return "";
  189.         }
  190.         return $this->description;
  191.     }
  192.     public function setDescription(string $description): self
  193.     {
  194.         $this->description $description;
  195.         return $this;
  196.     }
  197.     public function getPrice(): ?int
  198.     {
  199.         return $this->price;
  200.     }
  201.     public function setPrice(int $price): self
  202.     {
  203.         $this->price $price;
  204.         return $this;
  205.     }
  206.     public function getStock(): ?int
  207.     {
  208.         return $this->stock;
  209.     }
  210.     public function setStock(int $stock): self
  211.     {
  212.         $this->stock $stock;
  213.         return $this;
  214.     }
  215.     public function getCategories(): ?Categories
  216.     {
  217.         return $this->categories;
  218.     }
  219.     public function setCategories(?Categories $categories): self
  220.     {
  221.         $this->categories $categories;
  222.         return $this;
  223.     }
  224.     /**
  225.      * @return Collection|Images[]
  226.      */
  227.     public function getImages(): Collection
  228.     {
  229.         return $this->images;
  230.     }
  231.     public function addImage(Images $image): self
  232.     {
  233.         if (!$this->images->contains($image)) {
  234.             $this->images[] = $image;
  235.             $image->setProducts($this);
  236.         }
  237.         return $this;
  238.     }
  239.     public function removeImage(Images $image): self
  240.     {
  241.         if ($this->images->removeElement($image)) {
  242.             // set the owning side to null (unless already changed)
  243.             if ($image->getProducts() === $this) {
  244.                 $image->setProducts(null);
  245.             }
  246.         }
  247.         return $this;
  248.     }
  249.     /**
  250.      * @return Collection|OrdersDetails[]
  251.      */
  252.     public function getOrdersDetails(): Collection
  253.     {
  254.         return $this->ordersDetails;
  255.     }
  256.     public function addOrdersDetail(OrdersDetails $ordersDetail): self
  257.     {
  258.         if (!$this->ordersDetails->contains($ordersDetail)) {
  259.             $this->ordersDetails[] = $ordersDetail;
  260.             $ordersDetail->setProducts($this);
  261.         }
  262.         return $this;
  263.     }
  264.     public function removeOrdersDetail(OrdersDetails $ordersDetail): self
  265.     {
  266.         if ($this->ordersDetails->removeElement($ordersDetail)) {
  267.             // set the owning side to null (unless already changed)
  268.             if ($ordersDetail->getProducts() === $this) {
  269.                 $ordersDetail->setProducts(null);
  270.             }
  271.         }
  272.         return $this;
  273.     }
  274.     public function getAnswer1(): ?Categories
  275.     {
  276.         return $this->answer1;
  277.     }
  278.     public function setAnswer1(?Categories $answer1): static
  279.     {
  280.         $this->answer1 $answer1;
  281.         return $this;
  282.     }
  283.     public function getAnswer2(): ?Categories
  284.     {
  285.         return $this->answer2;
  286.     }
  287.     public function setAnswer2(?Categories $answer2): static
  288.     {
  289.         $this->answer2 $answer2;
  290.         return $this;
  291.     }
  292.     public function getAnswer3(): ?Categories
  293.     {
  294.         return $this->answer3;
  295.     }
  296.     public function setAnswer3(?Categories $answer3): static
  297.     {
  298.         $this->answer3 $answer3;
  299.         return $this;
  300.     }
  301.     public function getAnswer4(): ?Categories
  302.     {
  303.         return $this->answer4;
  304.     }
  305.     public function setAnswer4(?Categories $answer4): static
  306.     {
  307.         $this->answer4 $answer4;
  308.         return $this;
  309.     }
  310.     public function getAnswer5(): ?Categories
  311.     {
  312.         return $this->answer5;
  313.     }
  314.     public function setAnswer5(?Categories $answer5): static
  315.     {
  316.         $this->answer5 $answer5;
  317.         return $this;
  318.     }
  319.     public function getAnswer6(): ?Categories
  320.     {
  321.         return $this->answer6;
  322.     }
  323.     public function setAnswer6(?Categories $answer6): static
  324.     {
  325.         $this->answer6 $answer6;
  326.         return $this;
  327.     }
  328.     public function isAccessory(): ?bool
  329.     {
  330.         return $this->accessory;
  331.     }
  332.     public function setAccessory(?bool $accessory): static
  333.     {
  334.         $this->accessory $accessory;
  335.         return $this;
  336.     }
  337.     /**
  338.      * @return Collection<int, self>
  339.      */
  340.     public function getAccessories(): Collection
  341.     {
  342.         return $this->accessories;
  343.     }
  344.     /**
  345.      * @return Collection<int, Products>
  346.      */
  347.     public function getAccessoriesSources(): Collection
  348.     {
  349.         return $this->accessories_sources;
  350.     }
  351.     public function addAccessory(self $accessory): static
  352.     {
  353.         if (!$this->accessories->contains($accessory)) {
  354.             $this->accessories->add($accessory);
  355.         }
  356.         return $this;
  357.     }
  358.     public function removeAccessory(self $accessory): static
  359.     {
  360.         $this->accessories->removeElement($accessory);
  361.         return $this;
  362.     }
  363.     /**
  364.      * @return Collection<int, self>
  365.      */
  366.     public function getLinkedProducts(): Collection
  367.     {
  368.         return $this->linkedProducts;
  369.     }
  370.     public function addLinkedProduct(self $linkedProduct): static
  371.     {
  372.         if (!$this->linkedProducts->contains($linkedProduct)) {
  373.             $this->linkedProducts->add($linkedProduct);
  374.         }
  375.         return $this;
  376.     }
  377.     public function removeLinkedProduct(self $linkedProduct): static
  378.     {
  379.         $this->linkedProducts->removeElement($linkedProduct);
  380.         return $this;
  381.     }
  382.     public function getHeader(): ?string
  383.     {
  384.         return $this->header;
  385.     }
  386.     public function setHeader(?string $header): static
  387.     {
  388.         $this->header $header;
  389.         return $this;
  390.     }
  391.     public function getFooter(): ?string
  392.     {
  393.         return $this->footer;
  394.     }
  395.     public function setFooter(?string $footer): static
  396.     {
  397.         $this->footer $footer;
  398.         return $this;
  399.     }
  400.     public function getSubType(): ?string
  401.     {
  402.         return $this->subType;
  403.     }
  404.     public function setSubType(?string $subType): static
  405.     {
  406.         $this->subType $subType;
  407.         return $this;
  408.     }
  409.     public function getCapacity(): ?string
  410.     {
  411.         return $this->capacity;
  412.     }
  413.     public function setCapacity(?string $capacity): static
  414.     {
  415.         $this->capacity $capacity;
  416.         return $this;
  417.     }
  418.     public function getLength(): ?string
  419.     {
  420.         return $this->length;
  421.     }
  422.     public function setLength(?string $length): static
  423.     {
  424.         $this->length $length;
  425.         return $this;
  426.     }
  427.     public function getHeight(): ?string
  428.     {
  429.         return $this->height;
  430.     }
  431.     public function setHeight(?string $height): static
  432.     {
  433.         $this->height $height;
  434.         return $this;
  435.     }
  436.     public function getGas(): ?string
  437.     {
  438.         return $this->gas;
  439.     }
  440.     public function setGas(?string $gas): static
  441.     {
  442.         $this->gas $gas;
  443.         return $this;
  444.     }
  445.     public function getCaliber(): ?string
  446.     {
  447.         return $this->caliber;
  448.     }
  449.     public function setCaliber(?string $caliber): static
  450.     {
  451.         $this->caliber $caliber;
  452.         return $this;
  453.     }
  454.     public function getThickness(): ?string
  455.     {
  456.         return $this->thickness;
  457.     }
  458.     public function setThickness(?string $thickness): static
  459.     {
  460.         $this->thickness $thickness;
  461.         return $this;
  462.     }
  463.     public function getSpeed(): ?string
  464.     {
  465.         return $this->speed;
  466.     }
  467.     public function setSpeed(?string $speed): static
  468.     {
  469.         $this->speed $speed;
  470.         return $this;
  471.     }
  472.     public function getThread(): ?string
  473.     {
  474.         return $this->thread;
  475.     }
  476.     public function setThread(?string $thread): static
  477.     {
  478.         $this->thread $thread;
  479.         return $this;
  480.     }
  481.     public function getTitle(): ?string
  482.     {
  483.         return $this->title;
  484.     }
  485.     public function setTitle(?string $title): static
  486.     {
  487.         $this->title $title;
  488.         return $this;
  489.     }
  490.     public function getSubTitle(): ?string
  491.     {
  492.         return $this->subTitle;
  493.     }
  494.     public function setSubTitle(?string $subTitle): static
  495.     {
  496.         $this->subTitle $subTitle;
  497.         return $this;
  498.     }
  499.     public function getAccessoryTxt(): ?string
  500.     {
  501.         return $this->accessoryTxt;
  502.     }
  503.     public function setAccessoryTxt(?string $accessoryTxt): static
  504.     {
  505.         $this->accessoryTxt $accessoryTxt;
  506.         return $this;
  507.     }
  508.     public function getWeight(): ?string
  509.     {
  510.         return $this->weight;
  511.     }
  512.     public function setWeight(?string $weight): static
  513.     {
  514.         $this->weight $weight;
  515.         return $this;
  516.     }
  517.     public function getMainReference(): ?string
  518.     {
  519.         return $this->mainReference;
  520.     }
  521.     public function setMainReference(?string $mainReference): static
  522.     {
  523.         $this->mainReference $mainReference;
  524.         return $this;
  525.     }
  526.     public function getDonneesTechniques(): ?string
  527.     {
  528.         return $this->donneesTechniques;
  529.     }
  530.     public function setDonneesTechniques(?string $donneesTechniques): static
  531.     {
  532.         $this->donneesTechniques $donneesTechniques;
  533.         return $this;
  534.     }
  535.     public function getVideoProduit(): ?string
  536.     {
  537.         return $this->videoProduit;
  538.     }
  539.     public function setVideoProduit(?string $videoProduit): static
  540.     {
  541.         $this->videoProduit $videoProduit;
  542.         return $this;
  543.     }
  544.     public function getCategorie1(): ?string
  545.     {
  546.         return $this->categorie1;
  547.     }
  548.     public function setCategorie1(?string $categorie1): static
  549.     {
  550.         $this->categorie1 $categorie1;
  551.         return $this;
  552.     }
  553.     public function getCategorie2(): ?string
  554.     {
  555.         return $this->categorie2;
  556.     }
  557.     public function setCategorie2(?string $categorie2): static
  558.     {
  559.         $this->categorie2 $categorie2;
  560.         return $this;
  561.     }
  562.     public function getCategorie3(): ?string
  563.     {
  564.         return $this->categorie3;
  565.     }
  566.     public function setCategorie3(?string $categorie3): static
  567.     {
  568.         $this->categorie3 $categorie3;
  569.         return $this;
  570.     }
  571.     public function getDerniereCategorie(): ?string
  572.     {
  573.         return $this->derniereCategorie;
  574.     }
  575.     public function setDerniereCategorie(?string $derniereCategorie): static
  576.     {
  577.         $this->derniereCategorie $derniereCategorie;
  578.         return $this;
  579.     }
  580.     public function getGraduation(): ?string
  581.     {
  582.         return $this->graduation;
  583.     }
  584.     public function setGraduation(?string $graduation): static
  585.     {
  586.         $this->graduation $graduation;
  587.         return $this;
  588.     }
  589.     public function getInPort(): ?string
  590.     {
  591.         return $this->inPort;
  592.     }
  593.     public function setInPort(?string $inPort): static
  594.     {
  595.         $this->inPort $inPort;
  596.         return $this;
  597.     }
  598.     public function getOutPort(): ?string
  599.     {
  600.         return $this->outPort;
  601.     }
  602.     public function setOutPort(?string $outPort): static
  603.     {
  604.         $this->outPort $outPort;
  605.         return $this;
  606.     }
  607.     public function isBoolGraduation(): ?bool
  608.     {
  609.         return $this->boolGraduation;
  610.     }
  611.     public function setBoolGraduation(?bool $boolGraduation): static
  612.     {
  613.         $this->boolGraduation $boolGraduation;
  614.         return $this;
  615.     }
  616.     public function isBoolInPort(): ?bool
  617.     {
  618.         return $this->boolInPort;
  619.     }
  620.     public function setBoolInPort(?bool $boolInPort): static
  621.     {
  622.         $this->boolInPort $boolInPort;
  623.         return $this;
  624.     }
  625.     public function isBoolOutPort(): ?bool
  626.     {
  627.         return $this->boolOutPort;
  628.     }
  629.     public function setBoolOutPort(?bool $boolOutPort): static
  630.     {
  631.         $this->boolOutPort $boolOutPort;
  632.         return $this;
  633.     }
  634.     public function getFlowPressure(): ?string
  635.     {
  636.         return $this->flowPressure;
  637.     }
  638.     public function setFlowPressure(?string $flowPressure): static
  639.     {
  640.         $this->flowPressure $flowPressure;
  641.         return $this;
  642.     }
  643.     public function getMaximumPressure(): ?string
  644.     {
  645.         return $this->maximumPressure;
  646.     }
  647.     public function setMaximumPressure(?string $maximumPressure): static
  648.     {
  649.         $this->maximumPressure $maximumPressure;
  650.         return $this;
  651.     }
  652.     public function getDrillingThickness(): ?string
  653.     {
  654.         return $this->drillingThickness;
  655.     }
  656.     public function setDrillingThickness(?string $drillingThickness): static
  657.     {
  658.         $this->drillingThickness $drillingThickness;
  659.         return $this;
  660.     }
  661.     public function getPressureInBar(): ?string
  662.     {
  663.         return $this->pressureInBar;
  664.     }
  665.     public function setPressureInBar(?string $pressureInBar): static
  666.     {
  667.         $this->pressureInBar $pressureInBar;
  668.         return $this;
  669.     }
  670.     public function getAccessoryType(): ?string
  671.     {
  672.         return $this->accessoryType;
  673.     }
  674.     public function setAccessoryType(?string $accessoryType): static
  675.     {
  676.         $this->accessoryType $accessoryType;
  677.         return $this;
  678.     }
  679.     public function getDriftThickness(): ?string
  680.     {
  681.         return $this->driftThickness;
  682.     }
  683.     public function setDriftThickness(?string $driftThickness): static
  684.     {
  685.         $this->driftThickness $driftThickness;
  686.         return $this;
  687.     }
  688.     public function getGougingThickness(): ?string
  689.     {
  690.         return $this->gougingThickness;
  691.     }
  692.     public function setGougingThickness(?string $gougingThickness): static
  693.     {
  694.         $this->gougingThickness $gougingThickness;
  695.         return $this;
  696.     }
  697.     public function getSpeedGl(): ?string
  698.     {
  699.         return $this->speedGl;
  700.     }
  701.     public function setSpeedGl(?string $speedGl): static
  702.     {
  703.         $this->speedGl $speedGl;
  704.         return $this;
  705.     }
  706.     public function getSubSubType(): ?string
  707.     {
  708.         return $this->subSubType;
  709.     }
  710.     public function setSubSubType(?string $subSubType): static
  711.     {
  712.         $this->subSubType $subSubType;
  713.         return $this;
  714.     }
  715.     public function __toString(): string
  716.     {
  717.         return $this->mainReference;
  718.     }
  719.     /**
  720.      * @return Collection<int, self>
  721.      */
  722.     public function getAccessoriesWebapp(): Collection
  723.     {
  724.         return $this->accessories_webapp;
  725.     }
  726.     /**
  727.      * @return Collection<int, Products>
  728.      */
  729.     public function getAccessoriesWebappSources(): Collection
  730.     {
  731.         return $this->accessories_webapp_sources;
  732.     }
  733.     public function addAccessoriesWebapp(self $accessoriesWebapp): static
  734.     {
  735.         if (!$this->accessories_webapp->contains($accessoriesWebapp)) {
  736.             $this->accessories_webapp->add($accessoriesWebapp);
  737.         }
  738.         return $this;
  739.     }
  740.     public function removeAccessoriesWebapp(self $accessoriesWebapp): static
  741.     {
  742.         $this->accessories_webapp->removeElement($accessoriesWebapp);
  743.         return $this;
  744.     }
  745.     /**
  746.      * @return Collection<int, ProductAccessories>
  747.      */
  748.     public function getProductAccessories(): Collection
  749.     {
  750.         return $this->productAccessories;
  751.     }
  752.     public function addProductAccessory(ProductAccessories $productAccessory): static
  753.     {
  754.         if (!$this->productAccessories->contains($productAccessory)) {
  755.             $this->productAccessories->add($productAccessory);
  756.             $productAccessory->setProduct($this);
  757.         }
  758.         return $this;
  759.     }
  760.     public function removeProductAccessory(ProductAccessories $productAccessory): static
  761.     {
  762.         if ($this->productAccessories->removeElement($productAccessory)) {
  763.             // set the owning side to null (unless already changed)
  764.             if ($productAccessory->getProduct() === $this) {
  765.                 $productAccessory->setProduct(null);
  766.             }
  767.         }
  768.         return $this;
  769.     }
  770. }