src/Entity/Contact.php line 23

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of the kProjet project.
  4.  *
  5.  * (c) Kodiom <info@kodiom.com>
  6.  *
  7.  * For the full copyright and license information, please view the LICENSE
  8.  * file that was distributed with this source code.
  9.  */
  10. namespace App\Entity;
  11. use Doctrine\ORM\Mapping as ORM;
  12. use Symfony\Component\Validator\Constraints as Assert;
  13. /**
  14.  * Contact
  15.  *
  16.  * @ORM\Table()
  17.  * @ORM\Entity(repositoryClass="App\Entity\ContactRepository")
  18.  */
  19. class Contact
  20. {
  21.     /**
  22.      * @var int
  23.      *
  24.      * @ORM\Column(name="id", type="integer")
  25.      * @ORM\Id
  26.      * @ORM\GeneratedValue(strategy="AUTO")
  27.      */
  28.     private $id;
  29.     /**
  30.      * @var string
  31.      *
  32.      * @ORM\Column(name="nom", type="string", length=255)
  33.      *
  34.      * @Assert\NotBlank()
  35.      */
  36.     private $nom;
  37.     /**
  38.      * @var string
  39.      *
  40.      * @ORM\Column(name="sujet", type="string", length=255, nullable=true)
  41.      */
  42.     private $sujet;
  43.     /**
  44.      * @var string
  45.      *
  46.      * @ORM\Column(name="email", type="string", length=255)
  47.      *
  48.      * @Assert\NotBlank()
  49.      */
  50.     private $email;
  51.     /**
  52.      * @var string
  53.      *
  54.      * @ORM\Column(name="telephone", type="string", length=100, nullable=true)
  55.      */
  56.     private $telephone;
  57.     /**
  58.      * @var string
  59.      *
  60.      * @ORM\Column(name="service", type="string", length=100)
  61.      *
  62.      * @Assert\NotBlank()
  63.      */
  64.     private $service;
  65.     /**
  66.      * @var text
  67.      *
  68.      * @ORM\Column(name="message", type="text")
  69.      *
  70.      * @Assert\NotBlank()
  71.      */
  72.     private $message;
  73.     /**
  74.      * @var date
  75.      *
  76.      * @ORM\Column(name="dateInfo", type="datetime")
  77.      */
  78.     private $dateInfo;
  79.     /**
  80.      * Constructor of Contact Entity
  81.      */
  82.     public function __construct()
  83.     {
  84.         $this->dateInfo = new \DateTime;
  85.     }
  86.     public function __toString()
  87.     {
  88.         return ($this->getNom()) ? $this->getNom() : '';
  89.     }
  90.     /**
  91.      * Get id
  92.      *
  93.      * @return integer
  94.      */
  95.     public function getId()
  96.     {
  97.         return $this->id;
  98.     }
  99.     /**
  100.      * Get nom
  101.      *
  102.      * @return string
  103.      */
  104.     public function getNom()
  105.     {
  106.         return $this->nom;
  107.     }
  108.     /**
  109.      * Set nom
  110.      *
  111.      * @param string $nom
  112.      *
  113.      * @return Contact
  114.      */
  115.     public function setNom($nom)
  116.     {
  117.         $this->nom $nom;
  118.         return $this;
  119.     }
  120.     /**
  121.      * Get sujet
  122.      *
  123.      * @return string
  124.      */
  125.     public function getSujet()
  126.     {
  127.         return $this->sujet;
  128.     }
  129.     /**
  130.      * Set sujet
  131.      *
  132.      * @param string $sujet
  133.      *
  134.      * @return Contact
  135.      */
  136.     public function setSujet($sujet)
  137.     {
  138.         $this->sujet $sujet;
  139.         return $this;
  140.     }
  141.     /**
  142.      * Get email
  143.      *
  144.      * @return string
  145.      */
  146.     public function getEmail()
  147.     {
  148.         return $this->email;
  149.     }
  150.     /**
  151.      * Set email
  152.      *
  153.      * @param string $email
  154.      *
  155.      * @return Contact
  156.      */
  157.     public function setEmail($email)
  158.     {
  159.         $this->email $email;
  160.         return $this;
  161.     }
  162.     /**
  163.      * Get telephone
  164.      *
  165.      * @return string
  166.      */
  167.     public function getTelephone()
  168.     {
  169.         return $this->telephone;
  170.     }
  171.     /**
  172.      * Set telephone
  173.      *
  174.      * @param string $telephone
  175.      *
  176.      * @return Contact
  177.      */
  178.     public function setTelephone($telephone)
  179.     {
  180.         $this->telephone $telephone;
  181.         return $this;
  182.     }
  183.     /**
  184.      * Get service
  185.      *
  186.      * @return string
  187.      */
  188.     public function getService()
  189.     {
  190.         return $this->service;
  191.     }
  192.     /**
  193.      * Set service
  194.      *
  195.      * @param string $service
  196.      *
  197.      * @return Contact
  198.      */
  199.     public function setService($service)
  200.     {
  201.         $this->service $service;
  202.         return $this;
  203.     }
  204.     /**
  205.      * Get message
  206.      *
  207.      * @return text
  208.      */
  209.     public function getMessage()
  210.     {
  211.         return $this->message;
  212.     }
  213.     /**
  214.      * Set message
  215.      *
  216.      * @param text $message
  217.      *
  218.      * @return Contact
  219.      */
  220.     public function setMessage($message)
  221.     {
  222.         $this->message $message;
  223.         return $this;
  224.     }
  225.     /**
  226.      * Get dateInfo
  227.      *
  228.      * @return date
  229.      */
  230.     public function getDateInfo()
  231.     {
  232.         return $this->dateInfo;
  233.     }
  234.     /**
  235.      * Set dateInfo
  236.      *
  237.      * @param date $dateInfo
  238.      *
  239.      * @return Contact
  240.      */
  241.     public function setDateInfo($dateInfo)
  242.     {
  243.         $this->dateInfo $dateInfo;
  244.         return $this;
  245.     }
  246. }