src/Entity/ContactApp.php line 26

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. use ApiPlatform\Core\Annotation\ApiResource;
  14. use App\Repository\ContactAppRepository;
  15. /**
  16.  * ContactApp
  17.  *
  18.  * @ApiResource(attributes={"filters"={"contact_app.order", "contact_app.search"}, "pagination_items_per_page"=1})
  19.  * @ORM\Table()
  20.  * @ORM\Entity(repositoryClass="App\Repository\ContactAppRepository")
  21.  */
  22. class ContactApp
  23. {
  24.     /**
  25.      * @var int
  26.      *
  27.      * @ORM\Column(name="id", type="integer")
  28.      * @ORM\Id
  29.      * @ORM\GeneratedValue(strategy="AUTO")
  30.      */
  31.     private $id;
  32.     /**
  33.      * @var text
  34.      *
  35.      * @ORM\Column(name="email", type="text")
  36.      *
  37.      * @Assert\NotBlank()
  38.      */
  39.     private $email;
  40.     /**
  41.      * @var string
  42.      *
  43.      * @ORM\Column(name="tel", type="string", length=255, nullable=true)
  44.      */
  45.     private $tel;
  46.     /**
  47.      * @var text
  48.      *
  49.      * @ORM\Column(name="message", type="text", nullable=true)
  50.      */
  51.     private $message;
  52.     /**
  53.      * @var string
  54.      *
  55.      * @ORM\Column(type="string", length=75)
  56.      *
  57.      * @Assert\NotBlank()
  58.      */
  59.     private $type;
  60.     public function __toString()
  61.     {
  62.         return ($this->getEmail()) ? $this->getEmail() : '';
  63.     }
  64.     /**
  65.      * Get id
  66.      *
  67.      * @return integer
  68.      */
  69.     public function getId()
  70.     {
  71.         return $this->id;
  72.     }
  73.     /**
  74.      * Get email
  75.      *
  76.      * @return text
  77.      */
  78.     public function getEmail()
  79.     {
  80.         return $this->email;
  81.     }
  82.     /**
  83.      * Set email
  84.      *
  85.      * @param text $email
  86.      *
  87.      * @return ContactApp
  88.      */
  89.     public function setEmail($email)
  90.     {
  91.         $this->email $email;
  92.         return $this;
  93.     }
  94.     /**
  95.      * Get tel
  96.      *
  97.      * @return string
  98.      */
  99.     public function getTel()
  100.     {
  101.         return $this->tel;
  102.     }
  103.     /**
  104.      * Set tel
  105.      *
  106.      * @param string $tel
  107.      *
  108.      * @return ContactApp
  109.      */
  110.     public function setTel($tel)
  111.     {
  112.         $this->tel $tel;
  113.         return $this;
  114.     }
  115.     /**
  116.      * Get message
  117.      *
  118.      * @return text
  119.      */
  120.     public function getMessage()
  121.     {
  122.         return $this->message;
  123.     }
  124.     /**
  125.      * Set message
  126.      *
  127.      * @param text $message
  128.      *
  129.      * @return ContactApp
  130.      */
  131.     public function setMessage($message)
  132.     {
  133.         $this->message $message;
  134.         return $this;
  135.     }
  136.     /**
  137.      * Get type
  138.      *
  139.      * @return string
  140.      */
  141.     public function getType()
  142.     {
  143.         return $this->type;
  144.     }
  145.     /**
  146.      * Set type
  147.      *
  148.      * @param string $type
  149.      *
  150.      * @return ContactApp
  151.      */
  152.     public function setType($type)
  153.     {
  154.         $this->type $type;
  155.         return $this;
  156.     }
  157. }