src/Entity/Page.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Symfony\Component\Uid\Uuid;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use App\Repository\PageRepository;
  6. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  7. /**
  8.  * @ORM\Entity(repositoryClass=PageRepository::class)
  9.  * @UniqueEntity(fields={"titre"}, message="Le titre de la page existe déjà")
  10.  */
  11. class Page
  12. {
  13.     const CGS = 'ba9a9e8a-2482-4be5-af33-2df833718461';
  14.     /**
  15.      * @ORM\Id
  16.      * @ORM\GeneratedValue
  17.      * @ORM\Column(type="integer")
  18.      */
  19.     private int $id;
  20.     /**
  21.      * @ORM\Column(type="string", nullable=true)
  22.      */
  23.     private ?string $uuid;
  24.     
  25.     /**
  26.      * @ORM\Column(type="string", length=255, nullable=true)
  27.      */
  28.     private ?string $titre;
  29.     /**
  30.      * @ORM\Column(type="text", nullable=true)
  31.      */
  32.     private ?string $body;
  33.     /**
  34.      * @ORM\Column(type="string", length=255, nullable=true)
  35.      */
  36.     private ?string $slug;
  37.     /**
  38.      * @ORM\Column(type="integer", nullable=true)
  39.      */
  40.     private ?int $listorder;
  41.     /**
  42.      * @ORM\Column(type="boolean", nullable=true)
  43.      */
  44.     private ?bool $statut = false;
  45.     public function __construct()
  46.     {
  47.         $this->uuid = Uuid::v4();
  48.     }
  49.     
  50.     
  51.     /**
  52.      * getId
  53.      *
  54.      * @return int
  55.      */
  56.     public function getId(): ?int
  57.     {
  58.         return $this->id;
  59.     }
  60.     
  61.     /**
  62.      * getUuid
  63.      *
  64.      * @return void
  65.      */
  66.     public function getUuid()
  67.     {
  68.         return $this->uuid;
  69.     }
  70.     
  71.     /**
  72.      * setUuid
  73.      *
  74.      * @param  mixed $uuid
  75.      * @return self
  76.      */
  77.     public function setUuid($uuid): self
  78.     {
  79.         $this->uuid = $uuid;
  80.         return $this;
  81.     }
  82.     /**
  83.      * getTitre
  84.      *
  85.      * @return string
  86.      */
  87.     public function getTitre(): ?string
  88.     {
  89.         return $this->titre;
  90.     }
  91.     
  92.     /**
  93.      * setTitre
  94.      *
  95.      * @param  mixed $titre
  96.      * @return self
  97.      */
  98.     public function setTitre(?string $titre): self
  99.     {
  100.         $this->titre = $titre;
  101.         return $this;
  102.     }
  103.     
  104.     /**
  105.      * getBody
  106.      *
  107.      * @return string
  108.      */
  109.     public function getBody(): ?string
  110.     {
  111.         return $this->body;
  112.     }
  113.     
  114.     /**
  115.      * setBody
  116.      *
  117.      * @param  mixed $body
  118.      * @return self
  119.      */
  120.     public function setBody(?string $body): self
  121.     {
  122.         $this->body = $body;
  123.         return $this;
  124.     }
  125.     
  126.     /**
  127.      * getSlug
  128.      *
  129.      * @return string
  130.      */
  131.     public function getSlug(): ?string
  132.     {
  133.         return $this->slug;
  134.     }
  135.     
  136.     /**
  137.      * setSlug
  138.      *
  139.      * @param  mixed $slug
  140.      * @return self
  141.      */
  142.     public function setSlug(?string $slug): self
  143.     {
  144.         $this->slug = $slug;
  145.         return $this;
  146.     }
  147.     
  148.     /**
  149.      * getListorder
  150.      *
  151.      * @return int
  152.      */
  153.     public function getListorder(): ?int
  154.     {
  155.         return $this->listorder;
  156.     }
  157.     
  158.     /**
  159.      * setListorder
  160.      *
  161.      * @param  mixed $listorder
  162.      * @return self
  163.      */
  164.     public function setListorder(?int $listorder): self
  165.     {
  166.         $this->listorder = $listorder;
  167.         return $this;
  168.     }
  169.     
  170.     /**
  171.      * isStatut
  172.      *
  173.      * @return bool
  174.      */
  175.     public function isStatut(): ?bool
  176.     {
  177.         return $this->statut;
  178.     }
  179.     
  180.     /**
  181.      * setStatut
  182.      *
  183.      * @param  mixed $statut
  184.      * @return self
  185.      */
  186.     public function setStatut(?bool $statut): self
  187.     {
  188.         $this->statut = $statut;
  189.         return $this;
  190.     }
  191. }