src/Entity/CatImage.php line 9

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CatImageRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Entity(repositoryClassCatImageRepository::class)]
  6. class CatImage
  7. {
  8.     #[ORM\Id]
  9.     #[ORM\GeneratedValue]
  10.     #[ORM\Column(type'integer')]
  11.     private $id;
  12.     #[ORM\Column(type'string'length255)]
  13.     private $title;
  14.     #[ORM\Column(type'string'length255)]
  15.     private $file;
  16.     #[ORM\ManyToOne(targetEntityCategory::class, inversedBy'images')]
  17.     #[ORM\JoinColumn(nullablefalse)]
  18.     private $category;
  19.     public function getId(): ?int
  20.     {
  21.         return $this->id;
  22.     }
  23.     public function getTitle(): ?string
  24.     {
  25.         return $this->title;
  26.     }
  27.     public function setTitle(string $title): self
  28.     {
  29.         $this->title $title;
  30.         return $this;
  31.     }
  32.     public function getFile(): ?string
  33.     {
  34.         return $this->file;
  35.     }
  36.     public function setFile(string $file): self
  37.     {
  38.         $this->file $file;
  39.         return $this;
  40.     }
  41.     public function getCategory(): ?Category
  42.     {
  43.         return $this->category;
  44.     }
  45.     public function setCategory(?Category $category): self
  46.     {
  47.         $this->category $category;
  48.         return $this;
  49.     }
  50.     public function getUploadPath(): ?string
  51.     {
  52.         return 'public/images/GestionImage/' $this->category->getTitle();
  53.     }
  54.     public function getUploadPathFiles(): ?string
  55.     {
  56.         return 'public/images/GestionImage/Files/' $this->category->getTitle();
  57.     }
  58. }