src/Entity/Email/EmailRetour.php line 18

  1. <?php
  2. namespace App\Entity\Email;
  3. use ApiPlatform\Metadata\GetCollection;
  4. use ApiPlatform\Metadata\Post;
  5. use ApiPlatform\Metadata\Delete;
  6. use ApiPlatform\Metadata\Patch;
  7. use ApiPlatform\Metadata\Put;
  8. use ApiPlatform\Metadata\Get;
  9. use ApiPlatform\Metadata\ApiResource;
  10. use ApiPlatform\Metadata\ApiProperty;
  11. use ApiPlatform\Metadata\ApiFilter;
  12. use App\Entity\Auth\AuthUser;
  13. use App\Entity\Mailling;
  14. use Doctrine\ORM\Mapping as ORM;
  15. use Symfony\Component\Serializer\Annotation\Groups;
  16. #[ORM\Entity(repositoryClass"App\Repository\EmailRetourRepository")]
  17. #[ApiResource(normalizationContext: ['groups' => ['email_retour']], filters: ['email.retour.search'])]
  18. class EmailRetour
  19. {
  20.     #[ORM\Id()]
  21.     #[ORM\GeneratedValue()]
  22.     #[ORM\Column(type"integer")]
  23.     private $id;
  24.     #[ORM\Column(name"email"type"string"length255)]
  25.     #[Groups(["email_retour"])]
  26.     private $email;
  27.     #[ORM\Column(name"raison"type"string"length255)]
  28.     #[Groups(["email_retour"])]
  29.     private $raison;
  30.     #[ORM\Column(name"date_erreur"type"datetime"nullabletrue)]
  31.     #[Groups(["email_retour"])]
  32.     private $dateErreur;
  33.     #[ORM\ManyToOne(targetEntity"App\Entity\Auth\AuthUser")]
  34.     #[ORM\JoinColumn(name"authUser_id"referencedColumnName"id")]
  35.     private $author;
  36.     #[ORM\Column(name"date_absence"type"date"nullabletrue)]
  37.     private $dateAbsence;
  38.     #[ORM\Column(name"mailing_id"type"integer"nullabletrue)]
  39.     private $mailingID;
  40.     #[ORM\Column(name"contact_id"type"integer"nullabletrue)]
  41.     #[Groups(["email_retour"])]
  42.     private $contactID;
  43.     #[Groups(["email_retour"])]
  44.     private $nomContact;
  45.     /**
  46.      * EmailRetour constructor.
  47.      */
  48.     public function __construct()
  49.     {
  50.         $this->dateErreur = new \DateTime('now');
  51.     }
  52.     public function getId(): ?int
  53.     {
  54.         return $this->id;
  55.     }
  56.     public function getEmail(): ?string
  57.     {
  58.         return $this->email;
  59.     }
  60.     public function setEmail(string $email): self
  61.     {
  62.         $this->email $email;
  63.         return $this;
  64.     }
  65.     public function getRaison(): ?string
  66.     {
  67.         return $this->raison;
  68.     }
  69.     public function setRaison(string $raison): self
  70.     {
  71.         $this->raison $raison;
  72.         return $this;
  73.     }
  74.     public function getDate(): ?\DateTimeInterface
  75.     {
  76.         return $this->dateErreur;
  77.     }
  78.     public function setDate(\DateTimeInterface $dateErreur): self
  79.     {
  80.         $this->dateErreur $dateErreur;
  81.         return $this;
  82.     }
  83.     public function getAuthor(): ?AuthUser
  84.     {
  85.         return $this->author;
  86.     }
  87.     public function setAuthor(?AuthUser $author): self
  88.     {
  89.         $this->author $author;
  90.         return $this;
  91.     }
  92.     public function getDateAbsence(): ?\DateTimeInterface
  93.     {
  94.         return $this->dateAbsence;
  95.     }
  96.     public function setDateAbsence(?\DateTimeInterface $dateAbsence): self
  97.     {
  98.         $this->dateAbsence $dateAbsence;
  99.         return $this;
  100.     }
  101.     /**
  102.      * @return mixed
  103.      */
  104.     public function getMailingID()
  105.     {
  106.         return $this->mailingID;
  107.     }
  108.     /**
  109.      * @param mixed $mailingID
  110.      */
  111.     public function setMailingID($mailingID): void
  112.     {
  113.         $this->mailingID $mailingID;
  114.     }
  115.     /**
  116.      * @return mixed
  117.      */
  118.     public function getContactID()
  119.     {
  120.         return $this->contactID;
  121.     }
  122.     /**
  123.      * @param mixed $contactID
  124.      */
  125.     public function setContactID($contactID): void
  126.     {
  127.         $this->contactID $contactID;
  128.     }
  129.     /**
  130.      * @return mixed
  131.      */
  132.     public function getNomContact()
  133.     {
  134.         return $this->nomContact;
  135.     }
  136.     /**
  137.      * @param mixed $nomContact
  138.      */
  139.     public function setNomContact($nomContact): void
  140.     {
  141.         $this->nomContact $nomContact;
  142.     }
  143. }