<?php
namespace App\Entity;
use Symfony\Component\Uid\Uuid;
use Doctrine\ORM\Mapping as ORM;
use App\Repository\PageRepository;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
/**
* @ORM\Entity(repositoryClass=PageRepository::class)
* @UniqueEntity(fields={"titre"}, message="Le titre de la page existe déjà")
*/
class Page
{
const CGS = 'fbae3186-c560-4a69-a117-14dfdb0af1ce';
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private int $id;
/**
* @ORM\Column(type="string", nullable=true)
*/
private ?string $uuid;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $token;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private ?string $titre;
/**
* @ORM\Column(type="text", nullable=true)
*/
private ?string $body;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private ?string $slug;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private ?int $listorder;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private ?bool $statut = false;
/**
* @ORM\Column(type="datetime_immutable", nullable=true)
*/
private $createdAt;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $updatedAt;
public function __construct()
{
$this->uuid = Uuid::v4();
}
/**
* getId
*
* @return int
*/
public function getId(): ?int
{
return $this->id;
}
/**
* getUuid
*
* @return void
*/
public function getUuid()
{
return $this->uuid;
}
/**
* setUuid
*
* @param mixed $uuid
* @return self
*/
public function setUuid($uuid): self
{
$this->uuid = $uuid;
return $this;
}
/**
* getTitre
*
* @return string
*/
public function getTitre(): ?string
{
return $this->titre;
}
/**
* setTitre
*
* @param mixed $titre
* @return self
*/
public function setTitre(?string $titre): self
{
$this->titre = $titre;
return $this;
}
public function getToken(): ?string
{
return $this->token;
}
public function setToken(?string $token): self
{
$this->token = $token;
return $this;
}
/**
* getBody
*
* @return string
*/
public function getBody(): ?string
{
return $this->body;
}
/**
* setBody
*
* @param mixed $body
* @return self
*/
public function setBody(?string $body): self
{
$this->body = $body;
return $this;
}
/**
* getSlug
*
* @return string
*/
public function getSlug(): ?string
{
return $this->slug;
}
/**
* setSlug
*
* @param mixed $slug
* @return self
*/
public function setSlug(?string $slug): self
{
$this->slug = $slug;
return $this;
}
/**
* getListorder
*
* @return int
*/
public function getListorder(): ?int
{
return $this->listorder;
}
/**
* setListorder
*
* @param mixed $listorder
* @return self
*/
public function setListorder(?int $listorder): self
{
$this->listorder = $listorder;
return $this;
}
/**
* isStatut
*
* @return bool
*/
public function isStatut(): ?bool
{
return $this->statut;
}
/**
* setStatut
*
* @param mixed $statut
* @return self
*/
public function setStatut(?bool $statut): self
{
$this->statut = $statut;
return $this;
}
public function getCreatedAt(): ?\DateTimeImmutable
{
return $this->createdAt;
}
public function setCreatedAt(?\DateTimeImmutable $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
{
$this->updatedAt = $updatedAt;
return $this;
}
}