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 'fbae3186-c560-4a69-a117-14dfdb0af1ce';
  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.      * @ORM\Column(type="string", length=255, nullable=true)
  26.      */
  27.     private $token;
  28.     
  29.     /**
  30.      * @ORM\Column(type="string", length=255, nullable=true)
  31.      */
  32.     private ?string $titre;
  33.     /**
  34.      * @ORM\Column(type="text", nullable=true)
  35.      */
  36.     private ?string $body;
  37.     /**
  38.      * @ORM\Column(type="string", length=255, nullable=true)
  39.      */
  40.     private ?string $slug;
  41.     /**
  42.      * @ORM\Column(type="integer", nullable=true)
  43.      */
  44.     private ?int $listorder;
  45.     /**
  46.      * @ORM\Column(type="boolean", nullable=true)
  47.      */
  48.     private ?bool $statut false;
  49.     /**
  50.      * @ORM\Column(type="datetime_immutable", nullable=true)
  51.      */
  52.     private $createdAt;
  53.     /**
  54.      * @ORM\Column(type="datetime", nullable=true)
  55.      */
  56.     private $updatedAt;
  57.     public function __construct()
  58.     {
  59.         $this->uuid Uuid::v4();
  60.     }
  61.     
  62.     
  63.     /**
  64.      * getId
  65.      *
  66.      * @return int
  67.      */
  68.     public function getId(): ?int
  69.     {
  70.         return $this->id;
  71.     }
  72.     
  73.     /**
  74.      * getUuid
  75.      *
  76.      * @return void
  77.      */
  78.     public function getUuid()
  79.     {
  80.         return $this->uuid;
  81.     }
  82.     
  83.     /**
  84.      * setUuid
  85.      *
  86.      * @param  mixed $uuid
  87.      * @return self
  88.      */
  89.     public function setUuid($uuid): self
  90.     {
  91.         $this->uuid $uuid;
  92.         return $this;
  93.     }
  94.     /**
  95.      * getTitre
  96.      *
  97.      * @return string
  98.      */
  99.     public function getTitre(): ?string
  100.     {
  101.         return $this->titre;
  102.     }
  103.     
  104.     /**
  105.      * setTitre
  106.      *
  107.      * @param  mixed $titre
  108.      * @return self
  109.      */
  110.     public function setTitre(?string $titre): self
  111.     {
  112.         $this->titre $titre;
  113.         return $this;
  114.     }
  115.     
  116.     public function getToken(): ?string
  117.     {
  118.         return $this->token;
  119.     }
  120.     public function setToken(?string $token): self
  121.     {
  122.         $this->token $token;
  123.         return $this;
  124.     }
  125.     /**
  126.      * getBody
  127.      *
  128.      * @return string
  129.      */
  130.     public function getBody(): ?string
  131.     {
  132.         return $this->body;
  133.     }
  134.     
  135.     /**
  136.      * setBody
  137.      *
  138.      * @param  mixed $body
  139.      * @return self
  140.      */
  141.     public function setBody(?string $body): self
  142.     {
  143.         $this->body $body;
  144.         return $this;
  145.     }
  146.     
  147.     /**
  148.      * getSlug
  149.      *
  150.      * @return string
  151.      */
  152.     public function getSlug(): ?string
  153.     {
  154.         return $this->slug;
  155.     }
  156.     
  157.     /**
  158.      * setSlug
  159.      *
  160.      * @param  mixed $slug
  161.      * @return self
  162.      */
  163.     public function setSlug(?string $slug): self
  164.     {
  165.         $this->slug $slug;
  166.         return $this;
  167.     }
  168.     
  169.     /**
  170.      * getListorder
  171.      *
  172.      * @return int
  173.      */
  174.     public function getListorder(): ?int
  175.     {
  176.         return $this->listorder;
  177.     }
  178.     
  179.     /**
  180.      * setListorder
  181.      *
  182.      * @param  mixed $listorder
  183.      * @return self
  184.      */
  185.     public function setListorder(?int $listorder): self
  186.     {
  187.         $this->listorder $listorder;
  188.         return $this;
  189.     }
  190.     
  191.     /**
  192.      * isStatut
  193.      *
  194.      * @return bool
  195.      */
  196.     public function isStatut(): ?bool
  197.     {
  198.         return $this->statut;
  199.     }
  200.     
  201.     /**
  202.      * setStatut
  203.      *
  204.      * @param  mixed $statut
  205.      * @return self
  206.      */
  207.     public function setStatut(?bool $statut): self
  208.     {
  209.         $this->statut $statut;
  210.         return $this;
  211.     }
  212.     public function getCreatedAt(): ?\DateTimeImmutable
  213.     {
  214.         return $this->createdAt;
  215.     }
  216.     public function setCreatedAt(?\DateTimeImmutable $createdAt): self
  217.     {
  218.         $this->createdAt $createdAt;
  219.         return $this;
  220.     }
  221.     public function getUpdatedAt(): ?\DateTimeInterface
  222.     {
  223.         return $this->updatedAt;
  224.     }
  225.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  226.     {
  227.         $this->updatedAt $updatedAt;
  228.         return $this;
  229.     }
  230. }