src/Entity/Produit/Service/Message.php line 19

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Produit\Service;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use App\Validator\Validatortext\Email;
  5. use App\Validator\Validatortext\Taillemin;
  6. use App\Validator\Validatortext\Taillemax;
  7. use App\Repository\Produit\Service\MessageRepository;
  8. use App\Entity\Users\User\User;
  9. /**
  10.  * Message
  11.  *
  12.  * @ORM\Table("message")
  13.  * @ORM\Entity(repositoryClass=MessageRepository::class)
  14.  */
  15.  
  16. class Message
  17. {
  18.     /**
  19.      * @var integer
  20.      *
  21.      * @ORM\Column(name="id", type="integer")
  22.      * @ORM\Id
  23.      * @ORM\GeneratedValue(strategy="AUTO")
  24.      */
  25.     private $id;
  26.     /**
  27.      * @var string
  28.      *
  29.      * @ORM\Column(name="titre", type="string", length=255)
  30.      * @Taillemin(valeur=3, message="Au moins 3 caractères")
  31.      * @Taillemax(valeur=100, message="Au plus 100 caractès")
  32.      */
  33.     private $titre;
  34.     /**
  35.      * @var string
  36.      *
  37.      * @ORM\Column(name="nom", type="string", length=255,nullable=true)
  38.      * @Taillemax(valeur=100, message="Au plus 100 caractès")
  39.      */
  40.     private $nom;
  41.     /**
  42.      * @var string
  43.      *
  44.      * @ORM\Column(name="contenu", type="text")
  45.      * @Taillemin(valeur=3, message="Au moins 3 caractères")
  46.      * @Taillemax(valeur=300, message="Au plus 300 caractès")
  47.      */
  48.     private $contenu;
  49.     /**
  50.      * @var \DateTime
  51.      *
  52.      * @ORM\Column(name="date", type="datetime")
  53.      */
  54.     private $date;
  55.     /**
  56.      * @var string
  57.      *
  58.      * @ORM\Column(name="email", type="string", length=255,nullable=true)
  59.      * @Email()
  60.      */
  61.     private $email;
  62.     
  63.     /**
  64.       * @ORM\ManyToOne(targetEntity=User::class)
  65.       * @ORM\JoinColumn(nullable=true)
  66.     */
  67.     private $user;
  68.     
  69.     public function __construct()
  70.     {
  71.         $this->date = new \Datetime();
  72.     }
  73.     /**
  74.      * Get id
  75.      *
  76.      * @return integer 
  77.      */
  78.     public function getId()
  79.     {
  80.         return $this->id;
  81.     }
  82.     /**
  83.      * Set titre
  84.      *
  85.      * @param string $titre
  86.      * @return Message
  87.      */
  88.     public function setTitre($titre)
  89.     {
  90.         $this->titre $titre;
  91.         return $this;
  92.     }
  93.     /**
  94.      * Get titre
  95.      *
  96.      * @return string 
  97.      */
  98.     public function getTitre()
  99.     {
  100.         return $this->titre;
  101.     }
  102.     /**
  103.      * Set contenu
  104.      *
  105.      * @param string $contenu
  106.      * @return Message
  107.      */
  108.     public function setContenu($contenu)
  109.     {
  110.         $this->contenu $contenu;
  111.         return $this;
  112.     }
  113.     /**
  114.      * Get contenu
  115.      *
  116.      * @return string 
  117.      */
  118.     public function getContenu()
  119.     {
  120.         return $this->contenu;
  121.     }
  122.     /**
  123.      * Set date
  124.      *
  125.      * @param \DateTime $date
  126.      * @return Message
  127.      */
  128.     public function setDate($date)
  129.     {
  130.         $this->date $date;
  131.         return $this;
  132.     }
  133.     /**
  134.      * Get date
  135.      *
  136.      * @return \DateTime 
  137.      */
  138.     public function getDate()
  139.     {
  140.         return $this->date;
  141.     }
  142.     /**
  143.      * Set email
  144.      *
  145.      * @param string $email
  146.      * @return Message
  147.      */
  148.     public function setEmail($email)
  149.     {
  150.         $this->email $email;
  151.         return $this;
  152.     }
  153.     /**
  154.      * Get email
  155.      *
  156.      * @return string 
  157.      */
  158.     public function getEmail()
  159.     {
  160.         return $this->email;
  161.     }
  162.     /**
  163.      * Set nom
  164.      *
  165.      * @param string $nom
  166.      * @return Message
  167.      */
  168.     public function setNom($nom)
  169.     {
  170.         $this->nom $nom;
  171.         return $this;
  172.     }
  173.     /**
  174.      * Get nom
  175.      *
  176.      * @return string 
  177.      */
  178.     public function getNom()
  179.     {
  180.         return $this->nom;
  181.     }
  182.     /**
  183.      * Set user
  184.      * @return Message
  185.      */
  186.     public function setUser(User $user null): self
  187.     {
  188.         $this->user $user;
  189.         return $this;
  190.     }
  191.     /**
  192.      * Get user
  193.      */
  194.     public function getUser(): ?User
  195.     {
  196.         return $this->user;
  197.     }
  198. }