src/Entity/PresentationSite.php line 35

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