src/Entity/ProductImages.php line 9

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ProductImagesRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Entity(repositoryClassProductImagesRepository::class)]
  6. class ProductImages
  7. {
  8.     #[ORM\Id]
  9.     #[ORM\GeneratedValue]
  10.     #[ORM\Column(type'integer')]
  11.     private $id;
  12.     #[ORM\ManyToOne(targetEntityProducts::class, inversedBy'productImages')]
  13.     #[ORM\JoinColumn(nullablefalse)]
  14.     private $product;
  15.     #[ORM\Column(type'string'length255)]
  16.     private $image;
  17.     #[ORM\Column(type'datetime')]
  18.     private $modified;
  19.     #[ORM\Column(type'datetime')]
  20.     private $created;
  21.     #[ORM\Column(type'boolean'nullabletrue)]
  22.     private $isDefault;
  23.     #[ORM\Column(type'integer'nullabletrue)]
  24.     private $file_type;
  25.     public function __construct()
  26.     {
  27.         $this->setCreated(new \DateTime());
  28.         if ($this->getModified() == null) {
  29.             $this->setModified(new \DateTime());
  30.         }
  31.     }
  32.     public function getId(): ?int
  33.     {
  34.         return $this->id;
  35.     }
  36.     public function getProduct(): ?Products
  37.     {
  38.         return $this->product;
  39.     }
  40.     public function setProduct(?Products $product): self
  41.     {
  42.         $this->product $product;
  43.         return $this;
  44.     }
  45.     public function getImage(): ?string
  46.     {
  47.         return $this->image;
  48.     }
  49.     public function setImage(string $image): self
  50.     {
  51.         $this->image $image;
  52.         return $this;
  53.     }
  54.     public function getModified(): ?\DateTimeInterface
  55.     {
  56.         return $this->modified;
  57.     }
  58.     public function setModified(\DateTimeInterface $modified): self
  59.     {
  60.         $this->modified $modified;
  61.         return $this;
  62.     }
  63.     public function getCreated(): ?\DateTimeInterface
  64.     {
  65.         return $this->created;
  66.     }
  67.     public function setCreated(\DateTimeInterface $created): self
  68.     {
  69.         $this->created $created;
  70.         return $this;
  71.     }
  72.     public function getIsDefault(): ?bool
  73.     {
  74.         return $this->isDefault;
  75.     }
  76.     public function setIsDefault(?bool $isDefault): self
  77.     {
  78.         $this->isDefault $isDefault;
  79.         return $this;
  80.     }
  81.     public function getFileType(): ?int
  82.     {
  83.         return $this->file_type;
  84.     }
  85.     public function setFileType(?int $file_type): self
  86.     {
  87.         $this->file_type $file_type;
  88.         return $this;
  89.     }
  90. }