src/Entity/Contact.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ContactRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * @ORM\Entity(repositoryClass=ContactRepository::class)
  7.  */
  8. class Contact
  9. {
  10.     /**
  11.      * @ORM\Id
  12.      * @ORM\GeneratedValue
  13.      * @ORM\Column(type="integer")
  14.      */
  15.     private $id;
  16.     /**
  17.      * @ORM\Column(type="string", length=255)
  18.      */
  19.     private $nom;
  20.     /**
  21.      * @ORM\Column(type="string", length=255)
  22.      */
  23.     private $prenom;
  24.     /**
  25.      * @ORM\Column(type="string", length=255)
  26.      */
  27.     private $email;
  28.     /**
  29.      * @ORM\Column(type="text")
  30.      */
  31.     private $message;
  32.     /**
  33.      * @ORM\Column(type="datetime")
  34.      */
  35.     private $date;
  36.     /**
  37.      * @ORM\Column(type="string", length=100, nullable=true)
  38.      */
  39.     private $ip;
  40.     public function __construct() 
  41.     {        
  42.         $this->ip $_SERVER["REMOTE_ADDR"];
  43.         $this->date = new \Datetime;
  44.     }
  45.     public function getId(): ?int
  46.     {
  47.         return $this->id;
  48.     }
  49.     public function getNom(): ?string
  50.     {
  51.         return $this->nom;
  52.     }
  53.     public function setNom(string $nom): self
  54.     {
  55.         $this->nom $nom;
  56.         return $this;
  57.     }
  58.     public function getPrenom(): ?string
  59.     {
  60.         return $this->prenom;
  61.     }
  62.     public function setPrenom(string $prenom): self
  63.     {
  64.         $this->prenom $prenom;
  65.         return $this;
  66.     }
  67.     public function getEmail(): ?string
  68.     {
  69.         return $this->email;
  70.     }
  71.     public function setEmail(string $email): self
  72.     {
  73.         $this->email $email;
  74.         return $this;
  75.     }
  76.     public function getMessage(): ?string
  77.     {
  78.         return $this->message;
  79.     }
  80.     public function setMessage(string $message): self
  81.     {
  82.         $this->message $message;
  83.         return $this;
  84.     }
  85.     public function getDate(): ?\DateTimeInterface
  86.     {
  87.         return $this->date;
  88.     }
  89.     public function setDate(\DateTimeInterface $date): self
  90.     {
  91.         $this->date $date;
  92.         return $this;
  93.     }
  94.     public function getIp(): ?string
  95.     {
  96.         return $this->ip;
  97.     }
  98.     public function setIp(?string $ip): self
  99.     {
  100.         $this->ip $ip;
  101.         return $this;
  102.     }
  103. }