src/Entity/Bannieres.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\BannieresRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  6. #[ORM\Entity(repositoryClassBannieresRepository::class)]
  7. #[UniqueEntity(fields: ['image'], message'Cette bannière est déjà enrégisté')]
  8. class Bannieres
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id;
  14.     #[ORM\Column(length200nullabletrue)]
  15.     private ?string $image 'no-file';
  16.     #[ORM\Column]
  17.     private ?string $texte;
  18.     #[ORM\Column(length10)]
  19.     private ?int $adminsid;
  20.     #[ORM\Column]
  21.     private ?\DateTimeImmutable $created_at null;
  22.     #[ORM\Column]
  23.     private ?\DateTimeImmutable $updated_at null;
  24.     public function __construct(){
  25.         $this->created_at = new \DateTimeImmutable();
  26.         $this->updated_at = new \DateTimeImmutable();
  27.     }
  28.     public function getId(): ?int
  29.     {
  30.         return $this->id;
  31.     }
  32.     public function getImage(): ?string
  33.     {
  34.         return $this->image;
  35.     }
  36.     public function setImage(string $image): static
  37.     {
  38.         $this->image $image;
  39.         return $this;
  40.     }
  41.     public function getTexte(): ?string
  42.     {
  43.         return $this->texte;
  44.     }
  45.     public function setTexte(string $texte): static
  46.     {
  47.         $this->texte $texte;
  48.         return $this;
  49.     }
  50.     public function getAdminsId(): ?int
  51.     {
  52.         return $this->adminsid;
  53.     }
  54.     public function setAdminsId(int $adminsid): static
  55.     {
  56.         $this->adminsid $adminsid;
  57.         return $this;
  58.     }
  59.     public function getCreatedAt(): ?\DateTimeImmutable
  60.     {
  61.         return $this->created_at;
  62.     }
  63.     public function setCreatedAt(\DateTimeImmutable $created_at): static
  64.     {
  65.         $this->created_at $created_at;
  66.         return $this;
  67.     }
  68.     public function getUpdatedAt(): ?\DateTimeImmutable
  69.     {
  70.         return $this->updated_at;
  71.     }
  72.     public function UpdatedAt(\DateTimeImmutable $updated_at): static
  73.     {
  74.         $this->updated_at $updated_at;
  75.         return $this;
  76.     }
  77. }