src/Entity/Image.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ImageRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Knp\DoctrineBehaviors\Contract\Entity\BlameableInterface;
  6. use Knp\DoctrineBehaviors\Contract\Entity\TimestampableInterface;
  7. use Knp\DoctrineBehaviors\Model\Blameable\BlameableTrait;
  8. use Knp\DoctrineBehaviors\Model\Timestampable\TimestampableTrait;
  9. use Symfony\Component\Uid\Uuid;
  10. /**
  11.  * @ORM\Entity(repositoryClass=ImageRepository::class)
  12.  */
  13. class Image
  14. {
  15.     /**
  16.      * @ORM\Id
  17.      * @ORM\Column(type="uuid", unique=true)
  18.      */
  19.     private string $id;
  20.     /**
  21.      * @ORM\Column(type="string", length=255)
  22.      */
  23.     private string $filename '';
  24.     /**
  25.      * @ORM\Column(type="string", length=127)
  26.      */
  27.     private string $mime '';
  28.     /**
  29.      * @ORM\Column(type="string", length=255, nullable=true)
  30.      */
  31.     private ?string $caption '';
  32.     public function __construct()
  33.     {
  34.         $this->id Uuid::v4();
  35.     }
  36.     public function getId(): string
  37.     {
  38.         return $this->id;
  39.     }
  40.     public function getFilename(): ?string
  41.     {
  42.         return $this->filename;
  43.     }
  44.     public function setFilename(string $filename): self
  45.     {
  46.         $this->filename $filename;
  47.         return $this;
  48.     }
  49.     public function getMime(): ?string
  50.     {
  51.         return $this->mime;
  52.     }
  53.     public function setMime(string $mime): self
  54.     {
  55.         $this->mime $mime;
  56.         return $this;
  57.     }
  58.     public function getCaption(): ?string
  59.     {
  60.         return $this->caption;
  61.     }
  62.     public function setCaption(?string $caption): self
  63.     {
  64.         $this->caption $caption;
  65.         return $this;
  66.     }
  67. }