src/Entity/User/EmailB2B.php line 12

  1. <?php
  2. namespace App\Entity\User;
  3. use App\Entity\CodeEvent;
  4. use App\Repository\User\EmailB2BRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Entity(repositoryClassEmailB2BRepository::class)]
  9. class EmailB2B
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\Column(length255)]
  16.     private ?string $email null;
  17.     #[ORM\ManyToMany(targetEntityCodeEvent::class, inversedBy'emailB2Bs')]
  18.     private Collection $codeEvents;
  19.     public function __construct()
  20.     {
  21.         $this->codeEvents = new ArrayCollection();
  22.     }
  23.     public function getId(): ?int
  24.     {
  25.         return $this->id;
  26.     }
  27.     public function getEmail(): ?string
  28.     {
  29.         return $this->email;
  30.     }
  31.     public function setEmail(string $email): self
  32.     {
  33.         $this->email $email;
  34.         return $this;
  35.     }
  36.     /**
  37.      * @return Collection<int, CodeEvent>
  38.      */
  39.     public function getCodeEvents(): Collection
  40.     {
  41.         return $this->codeEvents;
  42.     }
  43.     public function addCodeEvent(CodeEvent $codeEvent): self
  44.     {
  45.         if (!$this->codeEvents->contains($codeEvent)) {
  46.             $this->codeEvents->add($codeEvent);
  47.         }
  48.         return $this;
  49.     }
  50.     public function removeCodeEvent(CodeEvent $codeEvent): self
  51.     {
  52.         $this->codeEvents->removeElement($codeEvent);
  53.         return $this;
  54.     }
  55. }