src/Entity/Faq.php line 20

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Symfony\Component\Validator\Constraints as Assert;
  5. use ApiPlatform\Core\Annotation\ApiResource;
  6. use App\Repository\FaqRepository;
  7. use ApiPlatform\Metadata\ApiFilter;
  8. use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter;
  9. /**
  10.  * Faq
  11.  *
  12.  * @ApiResource()
  13.  * @ORM\Table()
  14.  * @ORM\Entity(repositoryClass=FaqRepository::class)
  15.  */
  16. #[ApiFilter(SearchFilter::class, properties: ["type" => "exact"])]
  17. class Faq
  18. {
  19.     /**
  20.      * @var int
  21.      *
  22.      * @ORM\Column(name="id", type="integer")
  23.      * @ORM\Id
  24.      * @ORM\GeneratedValue(strategy="AUTO")
  25.      */
  26.     private $id;
  27.     /**
  28.      * @var text
  29.      *
  30.      * @ORM\Column(name="titre", type="text")
  31.      *
  32.      * @Assert\NotBlank()
  33.      */
  34.     private $titre;
  35.     /**
  36.      * @var text
  37.      *
  38.      * @ORM\Column(name="message", type="text")
  39.      *
  40.      * @Assert\NotBlank()
  41.      */
  42.     private $message;
  43.     /**
  44.      * @var string
  45.      *
  46.      * @ORM\Column(type="string", length=75)
  47.      *
  48.      * @Assert\NotBlank()
  49.      */
  50.     private $type;
  51.     public function __toString()
  52.     {
  53.         return ($this->getTitre()) ? $this->getTitre() : '';
  54.     }
  55.     /**
  56.      * Get id
  57.      *
  58.      * @return integer
  59.      */
  60.     public function getId()
  61.     {
  62.         return $this->id;
  63.     }
  64.     /**
  65.      * Get titre
  66.      *
  67.      * @return text
  68.      */
  69.     public function getTitre()
  70.     {
  71.         return $this->titre;
  72.     }
  73.     /**
  74.      * Set titre
  75.      *
  76.      * @param text $titre
  77.      *
  78.      * @return Faq
  79.      */
  80.     public function setTitre($titre)
  81.     {
  82.         $this->titre $titre;
  83.         return $this;
  84.     }
  85.     /**
  86.      * Get message
  87.      *
  88.      * @return text
  89.      */
  90.     public function getMessage()
  91.     {
  92.         return $this->message;
  93.     }
  94.     /**
  95.      * Set message
  96.      *
  97.      * @param text $message
  98.      *
  99.      * @return Faq
  100.      */
  101.     public function setMessage($message)
  102.     {
  103.         $this->message $message;
  104.         return $this;
  105.     }
  106.     /**
  107.      * Get type
  108.      *
  109.      * @return string
  110.      */
  111.     public function getType()
  112.     {
  113.         return $this->type;
  114.     }
  115.     /**
  116.      * Set type
  117.      *
  118.      * @param string $type
  119.      *
  120.      * @return Faq
  121.      */
  122.     public function setType($type)
  123.     {
  124.         $this->type $type;
  125.         return $this;
  126.     }
  127. }