src/Entity/Actualites.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ActualitesRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  6. #[ORM\Entity(repositoryClassActualitesRepository::class)]
  7. #[UniqueEntity(fields: ['titre'], message'Cet article est déjà enrégistré')]
  8. class Actualites
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id;
  14.     #[ORM\Column(length200uniquetrue)]
  15.     private ?string $titre;
  16.     #[ORM\Column(length100)]
  17.     private ?string $slug;
  18.     #[ORM\Column(length255)]
  19.     private ?string $image;
  20.     #[ORM\Column]
  21.     private ?string $resume;
  22.     #[ORM\Column]
  23.     private ?string $texte;
  24.     #[ORM\Column(length100)]
  25.     private ?string $statut;
  26.     #[ORM\Column(length10)]
  27.     private ?int $adminsid;
  28.     #[ORM\Column]
  29.     private ?\DateTimeImmutable $createdat null;
  30.     #[ORM\Column]
  31.     private ?\DateTimeImmutable $updatedat null;
  32.     public function __construct(){
  33.         $this->createdat = new \DateTimeImmutable();
  34.         $this->updatedat = new \DateTimeImmutable();
  35.     }
  36.     public function getId(): ?int
  37.     {
  38.         return $this->id;
  39.     }
  40.     public function getTitre(): ?string
  41.     {
  42.         return $this->titre;
  43.     }
  44.     public function setTitre(string $titre): static
  45.     {
  46.         $this->titre $titre;
  47.         return $this;
  48.     }
  49.     public function getSlug(): ?string
  50.     {
  51.         return $this->slug;
  52.     }
  53.     public function setSlug(string $slug): static
  54.     {
  55.         $this->slug $slug;
  56.         return $this;
  57.     }
  58.     public function getImage(): ?string
  59.     {
  60.         return $this->image;
  61.     }
  62.     public function setImage(string $image): static
  63.     {
  64.         $this->image $image;
  65.         return $this;
  66.     }
  67.     public function getResume(): ?string
  68.     {
  69.         return $this->resume;
  70.     }
  71.     public function setResume(string $resume): static
  72.     {
  73.         $this->resume $resume;
  74.         return $this;
  75.     }
  76.     public function getTexte(): ?string
  77.     {
  78.         return $this->texte;
  79.     }
  80.     public function setTexte(string $texte): static
  81.     {
  82.         $this->texte $texte;
  83.         return $this;
  84.     }
  85.     public function getStatut(): ?string
  86.     {
  87.         return $this->statut;
  88.     }
  89.     public function setStatut(string $statut): static
  90.     {
  91.         $this->statut $statut;
  92.         return $this;
  93.     }
  94.     public function getAdminsId(): ?int
  95.     {
  96.         return $this->adminsid;
  97.     }
  98.     public function setAdminsId(int $adminsid): static
  99.     {
  100.         $this->adminsid $adminsid;
  101.         return $this;
  102.     }
  103.     public function getCreatedAt(): ?\DateTimeImmutable
  104.     {
  105.         return $this->createdat;
  106.     }
  107.     public function setCreatedAt(\DateTimeImmutable $createdat): static
  108.     {
  109.         $this->createdat $createdat;
  110.         return $this;
  111.     }
  112.     public function getUpdatedAt(): ?\DateTimeImmutable
  113.     {
  114.         return $this->updatedat;
  115.     }
  116.     public function UpdatedAt(\DateTimeImmutable $updatedat): static
  117.     {
  118.         $this->updatedat $updatedat;
  119.         return $this;
  120.     }
  121. }