src/Entity/CodeEvent.php line 15

  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Metadata\ApiResource;
  4. use App\Entity\User\EmailB2B;
  5. use App\Repository\CodeEventRepository;
  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. #[ORM\Entity(repositoryClassCodeEventRepository::class)]
  11. #[ApiResource]
  12. class CodeEvent
  13. {
  14.     #[ORM\Id]
  15.     #[ORM\GeneratedValue]
  16.     #[ORM\Column]
  17.     private ?int $id null;
  18.     #[ORM\Column(length255)]
  19.     private ?string $name null;
  20.     #[ORM\Column(length255)]
  21.     private ?string $nameInApp null;
  22.     /** Nom de l'entreprise (affiché dans le mail B2B / Brevo NOM_CLIENT_B2B). */
  23.     #[ORM\Column(length255nullabletrue)]
  24.     private ?string $companyName null;
  25.     #[ORM\Column(typeTypes::DATE_MUTABLE)]
  26.     private ?\DateTimeInterface $dateEnd null;
  27.     #[ORM\Column(length255)]
  28.     private ?string $filenameLogo null;
  29.     #[ORM\Column(length255)]
  30.     private ?string $country null;
  31.     #[ORM\Column(length255nullabletrue)]
  32.     private ?string $filenameTemplate null;
  33.     #[ORM\Column(length255nullabletrue)]
  34.     private ?string $filenameTemplateVertical null;
  35.     #[ORM\Column(length255nullabletrue)]
  36.     private ?string $filenameAddonPhoto null;
  37.     #[ORM\Column]
  38.     private ?int $maxCode null;
  39.     #[ORM\ManyToMany(targetEntityEmailB2B::class, mappedBy'codeEvents')]
  40.     private Collection $emailB2Bs;
  41.     #[ORM\OneToMany(mappedBy'codeEvent'targetEntityCodeB2BClient::class)]
  42.     private Collection $codeB2BClients;
  43.     #[ORM\Column]
  44.     private ?int $size null;
  45.     public function __construct()
  46.     {
  47.         $this->emailB2Bs = new ArrayCollection();
  48.         $this->codeB2BClients = new ArrayCollection();
  49.     }
  50.     public function getId(): ?int
  51.     {
  52.         return $this->id;
  53.     }
  54.     public function getName(): ?string
  55.     {
  56.         return $this->name;
  57.     }
  58.     public function setName(string $name): self
  59.     {
  60.         $this->name $name;
  61.         return $this;
  62.     }
  63.     public function getNameInApp(): ?string
  64.     {
  65.         return $this->nameInApp;
  66.     }
  67.     public function setNameInApp(string $nameInApp): self
  68.     {
  69.         $this->nameInApp $nameInApp;
  70.         return $this;
  71.     }
  72.     public function getCompanyName(): ?string
  73.     {
  74.         return $this->companyName;
  75.     }
  76.     public function setCompanyName(?string $companyName): self
  77.     {
  78.         $this->companyName $companyName;
  79.         return $this;
  80.     }
  81.     public function getDateEnd(): ?\DateTimeInterface
  82.     {
  83.         return $this->dateEnd;
  84.     }
  85.     public function setDateEnd(\DateTimeInterface $dateEnd): self
  86.     {
  87.         $this->dateEnd $dateEnd;
  88.         return $this;
  89.     }
  90.     public function getFilenameLogo(): ?string
  91.     {
  92.         return $this->filenameLogo;
  93.     }
  94.     public function setFilenameLogo(string $filenameLogo): self
  95.     {
  96.         $this->filenameLogo $filenameLogo;
  97.         return $this;
  98.     }
  99.     public function getCountry(): ?string
  100.     {
  101.         return $this->country;
  102.     }
  103.     public function setCountry(string $country): self
  104.     {
  105.         $this->country $country;
  106.         return $this;
  107.     }
  108.     public function getFilenameTemplate(): ?string
  109.     {
  110.         return $this->filenameTemplate;
  111.     }
  112.     public function setFilenameTemplate(?string $filenameTemplate): self
  113.     {
  114.         $this->filenameTemplate $filenameTemplate;
  115.         return $this;
  116.     }
  117.     public function getFilenameTemplateVertical(): ?string
  118.     {
  119.         return $this->filenameTemplateVertical;
  120.     }
  121.     public function setFilenameTemplateVertical(?string $filenameTemplateVertical): self
  122.     {
  123.         $this->filenameTemplateVertical $filenameTemplateVertical;
  124.         return $this;
  125.     }
  126.     public function getFilenameAddonPhoto(): ?string
  127.     {
  128.         return $this->filenameAddonPhoto;
  129.     }
  130.     public function setFilenameAddonPhoto(?string $filenameAddonPhoto): self
  131.     {
  132.         $this->filenameAddonPhoto $filenameAddonPhoto;
  133.         return $this;
  134.     }
  135.     public function getEmailB2B(): ?EmailB2B
  136.     {
  137.         return $this->emailB2B;
  138.     }
  139.     public function setEmailB2B(?EmailB2B $emailB2B): self
  140.     {
  141.         // unset the owning side of the relation if necessary
  142.         if ($emailB2B === null && $this->emailB2B !== null) {
  143.             $this->emailB2B->setCodeEvent(null);
  144.         }
  145.         // set the owning side of the relation if necessary
  146.         if ($emailB2B !== null && $emailB2B->getCodeEvent() !== $this) {
  147.             $emailB2B->setCodeEvent($this);
  148.         }
  149.         $this->emailB2B $emailB2B;
  150.         return $this;
  151.     }
  152.     public function getMaxCode(): ?int
  153.     {
  154.         return $this->maxCode;
  155.     }
  156.     public function setMaxCode(int $maxCode): self
  157.     {
  158.         $this->maxCode $maxCode;
  159.         return $this;
  160.     }
  161.     /**
  162.      * @return Collection<int, EmailB2B>
  163.      */
  164.     public function getEmailB2Bs(): Collection
  165.     {
  166.         return $this->emailB2Bs;
  167.     }
  168.     public function addEmailB2B(EmailB2B $emailB2B): self
  169.     {
  170.         if (!$this->emailB2Bs->contains($emailB2B)) {
  171.             $this->emailB2Bs->add($emailB2B);
  172.             $emailB2B->addCodeEvent($this);
  173.         }
  174.         return $this;
  175.     }
  176.     public function removeEmailB2B(EmailB2B $emailB2B): self
  177.     {
  178.         if ($this->emailB2Bs->removeElement($emailB2B)) {
  179.             $emailB2B->removeCodeEvent($this);
  180.         }
  181.         return $this;
  182.     }
  183.     /**
  184.      * @return Collection<int, CodeB2BClient>
  185.      */
  186.     public function getCodeB2BClients(): Collection
  187.     {
  188.         return $this->codeB2BClients;
  189.     }
  190.     public function addCodeB2BClient(CodeB2BClient $codeB2BClient): self
  191.     {
  192.         if (!$this->codeB2BClients->contains($codeB2BClient)) {
  193.             $this->codeB2BClients->add($codeB2BClient);
  194.             $codeB2BClient->setCodeEvent($this);
  195.         }
  196.         return $this;
  197.     }
  198.     public function removeCodeB2BClient(CodeB2BClient $codeB2BClient): self
  199.     {
  200.         if ($this->codeB2BClients->removeElement($codeB2BClient)) {
  201.             // set the owning side to null (unless already changed)
  202.             if ($codeB2BClient->getCodeEvent() === $this) {
  203.                 $codeB2BClient->setCodeEvent(null);
  204.             }
  205.         }
  206.         return $this;
  207.     }
  208.     public function getSize(): ?int
  209.     {
  210.         return $this->size;
  211.     }
  212.     public function setSize(?int $size): void
  213.     {
  214.         $this->size $size;
  215.     }
  216. }