src\Entity\Newsletter.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Symfony\Component\Validator\Constraints as Assert;
  7. use Symfony\Component\HttpFoundation\File\File;
  8. #[ORM\Entity(repositoryClass\App\Repository\NewsletterRepository::class)]
  9. class Newsletter
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column(type'integer')]
  14.     private $id;
  15.     #[ORM\ManyToOne(targetEntity\App\Entity\User::class)]
  16.     private $user;
  17.     #[ORM\Column(type'string'length255)]
  18.     private $objet;
  19.     #[ORM\Column(type'text'nullabletrue)]
  20.     private $description;
  21.     #[ORM\Column(type'string'length255nullabletrue)]
  22.     private $type;
  23.     #[ORM\Column(type'string')]
  24.     private $image;
  25.     #[ORM\Column(type'datetime')]
  26.     private $create_at;
  27.     #[ORM\Column(type'datetime'nullabletrue)]
  28.     private $update_at;
  29.     #[ORM\Column(type'string')]
  30.     private $mode;
  31.     #[ORM\ManyToMany(targetEntity\App\Entity\Service::class, inversedBy'newsletter')]
  32.     private $service;
  33.     #[ORM\Column(type'datetime'nullabletrue)]
  34.     private $date_envoi;
  35.      function __construct()
  36.     {
  37.         
  38.         $this->create_at= new \DateTime('UTC');
  39.         $this->service = new ArrayCollection();
  40.         
  41.     }
  42.     public function getId(): ?int
  43.     {
  44.         return $this->id;
  45.     }
  46.     public function getUser(): ?User
  47.     {
  48.         return $this->user;
  49.     }
  50.     public function setUser(?User $user): self
  51.     {
  52.         $this->user $user;
  53.         return $this;
  54.     }
  55.     public function getObjet(): ?string
  56.     {
  57.         return $this->objet;
  58.     }
  59.     public function setObjet(string $objet): self
  60.     {
  61.         $this->objet $objet;
  62.         return $this;
  63.     }
  64.     public function getDescription(): ?string
  65.     {
  66.         return $this->description;
  67.     }
  68.     public function setDescription(?string $description): self
  69.     {
  70.         $this->description $description;
  71.         return $this;
  72.     }
  73.     public function getType(): ?string
  74.     {
  75.         return $this->type;
  76.     }
  77.     public function setType(?string $type): self
  78.     {
  79.         $this->type $type;
  80.         return $this;
  81.     }
  82.     public function getImage()
  83.     {
  84.         return $this->image;
  85.     }
  86.     public function setImage($image)
  87.     {
  88.         $this->image $image;
  89.         return $this;
  90.     }
  91.     public function getCreateAt(): ?\DateTimeInterface
  92.     {
  93.         return $this->create_at;
  94.     }
  95.     public function setCreateAt(\DateTimeInterface $create_at): self
  96.     {
  97.         $this->create_at $create_at;
  98.         return $this;
  99.     }
  100.     public function getUpdateAt(): ?\DateTimeInterface
  101.     {
  102.         return $this->update_at;
  103.     }
  104.     public function setUpdateAt(?\DateTimeInterface $update_at): self
  105.     {
  106.         $this->update_at $update_at;
  107.         return $this;
  108.     }
  109.     public function getMode(): ?string
  110.     {
  111.         return $this->mode;
  112.     }
  113.     public function setMode(string $mode): self
  114.     {
  115.         $this->mode $mode;
  116.         return $this;
  117.     }
  118.     /**
  119.      * @return Collection|Service[]
  120.      */
  121.     public function getService(): Collection
  122.     {
  123.         return $this->service;
  124.     }
  125.     public function addService(Service $service): self
  126.     {
  127.         if (!$this->service->contains($service)) {
  128.             $this->service[] = $service;
  129.         }
  130.         return $this;
  131.     }
  132.     public function removeService(Service $service): self
  133.     {
  134.         if ($this->service->contains($service)) {
  135.             $this->service->removeElement($service);
  136.         }
  137.         return $this;
  138.     }
  139.     public function getDateEnvoi(): ?\DateTimeInterface
  140.     {
  141.         return $this->date_envoi;
  142.     }
  143.     public function setDateEnvoi(?\DateTimeInterface $date_envoi): self
  144.     {
  145.         $this->date_envoi $date_envoi;
  146.         return $this;
  147.     }
  148. }