src/Entity/VenteRechercheMagasins/VenteRechercheMagasinsAlertes.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity\VenteRechercheMagasins;
  3. use App\Entity\Adherent\Magasin;
  4. use App\Entity\Departement;
  5. use App\Entity\Region;
  6. use App\Repository\VenteRechercheMagasins\VenteRechercheMagasinsAlertesRepository;
  7. use Doctrine\Common\Collections\ArrayCollection;
  8. use Doctrine\Common\Collections\Collection;
  9. use Doctrine\ORM\Mapping as ORM;
  10. #[ORM\Entity(repositoryClassVenteRechercheMagasinsAlertesRepository::class)]
  11. class VenteRechercheMagasinsAlertes
  12. {
  13.     #[ORM\Id]
  14.     #[ORM\GeneratedValue]
  15.     #[ORM\Column]
  16.     private ?int $id null;
  17.     #[ORM\ManyToOne]
  18.     #[ORM\JoinColumn(referencedColumnName"k_adherent",nullablefalse)]
  19.     private ?Magasin $magasin null;
  20. //    #[ORM\ManyToOne]
  21. //    #[ORM\JoinColumn(referencedColumnName: "code", nullable: false)]
  22. //    private ?Departement $departement = null;
  23.     #[ORM\Column(length255)]
  24.     private ?string $type null;
  25.     #[ORM\InverseJoinColumn(name'code'referencedColumnName'code')]
  26.     #[ORM\ManyToMany(targetEntityDepartement::class, inversedBy'venteRechercheAlertes')]
  27.     private Collection $departements;
  28.     #[ORM\ManyToMany(targetEntityRegion::class, inversedBy'venteRechercheMagasinsAlertes')]
  29.     private Collection $region;
  30.     public function __construct()
  31.     {
  32.         $this->departements = new ArrayCollection();
  33.         $this->region = new ArrayCollection();
  34.     }
  35.     public function getId(): ?int
  36.     {
  37.         return $this->id;
  38.     }
  39.     public function getMagasin(): ?Magasin
  40.     {
  41.         return $this->magasin;
  42.     }
  43.     public function setMagasin(?Magasin $magasin): static
  44.     {
  45.         $this->magasin $magasin;
  46.         return $this;
  47.     }
  48.     public function getType(): ?string
  49.     {
  50.         return $this->type;
  51.     }
  52.     public function setType(string $type): static
  53.     {
  54.         $this->type $type;
  55.         return $this;
  56.     }
  57.     /**
  58.      * @return Collection<int, Departement>
  59.      */
  60.     public function getDepartements(): Collection
  61.     {
  62.         return $this->departements;
  63.     }
  64.     public function addDepartements(Departement $departements): static
  65.     {
  66.         if (!$this->departements->contains($departements)) {
  67.             $this->departements->add($departements);
  68.         }
  69.         return $this;
  70.     }
  71.     public function removeDepartements(Departement $departements): static
  72.     {
  73.         $this->departements->removeElement($departements);
  74.         return $this;
  75.     }
  76.     /**
  77.      * @return Collection<int, Region>
  78.      */
  79.     public function getRegion(): Collection
  80.     {
  81.         return $this->region;
  82.     }
  83.     public function addRegion(Region $region): static
  84.     {
  85.         if (!$this->region->contains($region)) {
  86.             $this->region->add($region);
  87.         }
  88.         return $this;
  89.     }
  90.     public function removeRegion(Region $region): static
  91.     {
  92.         $this->region->removeElement($region);
  93.         return $this;
  94.     }
  95. }