src/Entity/Actuality.php line 13

  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use App\Entity\Trait\CreatedAtTrait;
  5. use App\Repository\ActualityRepository;
  6. use Symfony\Component\HttpFoundation\File\File;
  7. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  8. #[ORM\Entity(repositoryClassActualityRepository::class)]
  9. #[Vich\Uploadable]
  10. class Actuality
  11. {
  12.     use CreatedAtTrait;
  13.     #[ORM\Id]
  14.     #[ORM\GeneratedValue]
  15.     #[ORM\Column]
  16.     private ?int $id null;
  17.     #[ORM\Column(length255)]
  18.     private ?string $title null;
  19.     #[ORM\Column(length255)]
  20.     private ?string $texte null;
  21.     
  22.     #[Vich\UploadableField(mapping'actuality'fileNameProperty'imageName')]
  23.     private ?File $imageFile null;
  24.     #[ORM\Column(nullabletrue)]
  25.     private ?string $imageName null;
  26.     #[ORM\Column(length255)]
  27.     private ?string $name null;
  28.     #[ORM\Column(length255)]
  29.     private ?string $lastname null;
  30.     #[ORM\Column(length255)]
  31.     private ?string $label null;
  32.  
  33.     public function __construct()
  34.     {
  35.         $this->created_at = new \DateTimeImmutable();
  36.     }
  37.     public function getId(): ?int
  38.     {
  39.         return $this->id;
  40.     }
  41.     public function getTitle(): ?string
  42.     {
  43.         return $this->title;
  44.     }
  45.     public function setTitle(string $title): self
  46.     {
  47.         $this->title $title;
  48.         return $this;
  49.     }
  50.     public function setImageFile(?File $imageFile null): void
  51.     {
  52.         $this->imageFile $imageFile;
  53.         if (null !== $imageFile) {
  54.             // It is required that at least one field changes if you are using doctrine
  55.             // otherwise the event listeners won't be called and the file is lost
  56.             $this->updatedAt = new \DateTimeImmutable();
  57.         }
  58.     }
  59.     public function getImageFile(): ?File
  60.     {
  61.         return $this->imageFile;
  62.     }
  63.     public function setImageName(?string $imageName): void
  64.     {
  65.         $this->imageName $imageName;
  66.     }
  67.     public function getImageName(): ?string
  68.     {
  69.         return $this->imageName;
  70.     }
  71.     public function getTexte(): ?string
  72.     {
  73.         return $this->texte;
  74.     }
  75.     public function setTexte(string $texte): self
  76.     {
  77.         $this->texte $texte;
  78.         return $this;
  79.     }
  80.     public function getName(): ?string
  81.     {
  82.         return $this->name;
  83.     }
  84.     public function setName(string $name): self
  85.     {
  86.         $this->name $name;
  87.         return $this;
  88.     }
  89.     public function getLastname(): ?string
  90.     {
  91.         return $this->lastname;
  92.     }
  93.     public function setLastname(string $lastname): self
  94.     {
  95.         $this->lastname $lastname;
  96.         return $this;
  97.     }
  98.     public function getLabel(): ?string
  99.     {
  100.         return $this->label;
  101.     }
  102.     public function setLabel(string $label): self
  103.     {
  104.         $this->label $label;
  105.         return $this;
  106.     }
  107. }