src/Entity/Boutiques.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Trait\CodeTrait;
  4. use App\Repository\BoutiquesRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Entity(repositoryClassBoutiquesRepository::class)]
  9. class Boutiques
  10. {
  11.     use CodeTrait;
  12.     #[ORM\Id]
  13.     #[ORM\GeneratedValue]
  14.     #[ORM\Column()]
  15.     private ?int $id null;
  16.     #[ORM\Column(length255nullabletrue)]
  17.     private ?string $nom null;
  18.     #[ORM\Column(length100)]
  19.     private ?string $ville null;
  20.     #[ORM\Column(length255nullabletrue)]
  21.     private ?string $adresse null;
  22.     #[ORM\Column(length15nullabletrue)]
  23.     private ?string $telephone null;
  24.     #[ORM\Column(length255nullabletrue)]
  25.     private ?string $logo null;
  26.     #[ORM\Column(length255nullabletrue)]
  27.     private ?string $siteweb null;
  28.     #[ORM\OneToMany(mappedBy'shop'targetEntityUser::class)]
  29.     private Collection $users;
  30.     public function __construct()
  31.     {
  32.         $this->users = new ArrayCollection();
  33.     }
  34.     public function getId(): ?int
  35.     {
  36.         return $this->id;
  37.     }
  38.     public function getNom(): ?string
  39.     {
  40.         return $this->nom;
  41.     }
  42.     public function setNom(?string $nom): self
  43.     {
  44.         $this->nom $nom;
  45.         return $this;
  46.     }
  47.     public function getVille(): ?string
  48.     {
  49.         return $this->ville;
  50.     }
  51.     public function setVille(string $ville): self
  52.     {
  53.         $this->ville $ville;
  54.         return $this;
  55.     }
  56.     public function setCode(string $code): self
  57.     {
  58.         $this->code $code;
  59.         return $this;
  60.     }
  61.     public function getAdresse(): ?string
  62.     {
  63.         return $this->adresse;
  64.     }
  65.     public function setAdresse(?string $adresse): self
  66.     {
  67.         $this->adresse $adresse;
  68.         return $this;
  69.     }
  70.     public function getTelephone(): ?string
  71.     {
  72.         return $this->telephone;
  73.     }
  74.     public function setTelephone(?string $telephone): self
  75.     {
  76.         $this->telephone $telephone;
  77.         return $this;
  78.     }
  79.     public function getLogo(): ?string
  80.     {
  81.         return $this->logo;
  82.     }
  83.     public function setLogo(?string $logo): self
  84.     {
  85.         $this->logo $logo;
  86.         return $this;
  87.     }
  88.     public function getSiteweb(): ?string
  89.     {
  90.         return $this->siteweb;
  91.     }
  92.     public function setSiteweb(?string $siteweb): self
  93.     {
  94.         $this->siteweb $siteweb;
  95.         return $this;
  96.     }
  97.     /**
  98.      * @return Collection<int, User>
  99.      */
  100.     public function getUsers(): Collection
  101.     {
  102.         return $this->users;
  103.     }
  104.     public function addUser(User $user): self
  105.     {
  106.         if (!$this->users->contains($user)) {
  107.             $this->users[] = $user;
  108.             $user->setShop($this);
  109.         }
  110.         return $this;
  111.     }
  112.     public function removeUser(User $user): self
  113.     {
  114.         if ($this->users->removeElement($user)) {
  115.             // set the owning side to null (unless already changed)
  116.             if ($user->getShop() === $this) {
  117.                 $user->setShop(null);
  118.             }
  119.         }
  120.         return $this;
  121.     }
  122. }