src/Entity/Image.php line 12

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ImageRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Entity(repositoryClassImageRepository::class)]
  9. class Image
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column(type'integer')]
  14.     private $id;
  15.     #[ORM\Column(type'integer')]
  16.     private $width;
  17.     #[ORM\Column(type'integer'nullabletrue)]
  18.     private $height;
  19.     #[ORM\Column(type'datetime'nullabletrue)]
  20.     private $date_capture;
  21.     #[ORM\Column(type'datetime'nullabletrue)]
  22.     private $date_upload;
  23.     #[ORM\Column(type'string'length255)]
  24.     private $name;
  25.     #[ORM\Column(type'text'nullabletrue)]
  26.     private $legend;
  27.     #[ORM\Column(type'integer')]
  28.     private $display_quality;
  29.     #[ORM\Column(type'boolean')]
  30.     private $homepage;
  31.     #[ORM\Column(type'boolean')]
  32.     private $shop;
  33.     #[ORM\Column(type'float'nullabletrue)]
  34.     private $price;
  35.     #[ORM\Column(type'string'length255nullabletrue)]
  36.     private $filename;
  37.     #[ORM\ManyToMany(targetEntityProject::class, mappedBy'image')]
  38.     private $projects;
  39.     #[ORM\ManyToMany(targetEntityProduct::class, mappedBy'image')]
  40.     private $products;
  41.     public function __construct()
  42.     {
  43.         $this->projects = new ArrayCollection();
  44.         $this->products = new ArrayCollection();
  45.     }
  46.     public function getId(): ?int
  47.     {
  48.         return $this->id;
  49.     }
  50.     public function getWidth(): ?int
  51.     {
  52.         return $this->width;
  53.     }
  54.     public function setWidth(int $width): self
  55.     {
  56.         $this->width $width;
  57.         return $this;
  58.     }
  59.     public function getHeight(): ?int
  60.     {
  61.         return $this->height;
  62.     }
  63.     public function setHeight(?int $height): self
  64.     {
  65.         $this->height $height;
  66.         return $this;
  67.     }
  68.     public function getDateCapture(): ?\DateTimeInterface
  69.     {
  70.         return $this->date_capture;
  71.     }
  72.     public function setDateCapture(?\DateTimeInterface $date_capture): self
  73.     {
  74.         $this->date_capture $date_capture;
  75.         return $this;
  76.     }
  77.     public function getDateUpload(): ?\DateTimeInterface
  78.     {
  79.         return $this->date_upload;
  80.     }
  81.     public function setDateUpload(?\DateTimeInterface $date_upload): self
  82.     {
  83.         $this->date_upload $date_upload;
  84.         return $this;
  85.     }
  86.     public function getName(): ?string
  87.     {
  88.         return $this->name;
  89.     }
  90.     public function setName(string $name): self
  91.     {
  92.         $this->name $name;
  93.         return $this;
  94.     }
  95.     public function getLegend(): ?string
  96.     {
  97.         return $this->legend;
  98.     }
  99.     public function setLegend(?string $legend): self
  100.     {
  101.         $this->legend $legend;
  102.         return $this;
  103.     }
  104.     public function getDisplayQuality(): ?int
  105.     {
  106.         return $this->display_quality;
  107.     }
  108.     public function setDisplayQuality(int $display_quality): self
  109.     {
  110.         $this->display_quality $display_quality;
  111.         return $this;
  112.     }
  113.     public function getHomepage(): ?bool
  114.     {
  115.         return $this->homepage;
  116.     }
  117.     public function setHomepage(bool $homepage): self
  118.     {
  119.         $this->homepage $homepage;
  120.         return $this;
  121.     }
  122.     public function getShop(): ?bool
  123.     {
  124.         return $this->shop;
  125.     }
  126.     public function setShop(bool $shop): self
  127.     {
  128.         $this->shop $shop;
  129.         return $this;
  130.     }
  131.     public function getPrice(): ?float
  132.     {
  133.         return $this->price;
  134.     }
  135.     public function setPrice(?float $price): self
  136.     {
  137.         $this->price $price;
  138.         return $this;
  139.     }
  140.     public function getFilename(): ?string
  141.     {
  142.         return $this->filename;
  143.     }
  144.     public function setFilename(?string $filename): self
  145.     {
  146.         $this->filename $filename;
  147.         return $this;
  148.     }
  149.     /**
  150.      * @return Collection|Project[]
  151.      */
  152.     public function getProjects(): Collection
  153.     {
  154.         return $this->projects;
  155.     }
  156.     public function addProject(Project $project): self
  157.     {
  158.         if (!$this->projects->contains($project)) {
  159.             $this->projects[] = $project;
  160.             $project->addImage($this);
  161.         }
  162.         return $this;
  163.     }
  164.     public function removeProject(Project $project): self
  165.     {
  166.         if ($this->projects->removeElement($project)) {
  167.             $project->removeImage($this);
  168.         }
  169.         return $this;
  170.     }
  171.     /**
  172.      * @return Collection|Product[]
  173.      */
  174.     public function getProducts(): Collection
  175.     {
  176.         return $this->products;
  177.     }
  178.     public function addProduct(Product $product): self
  179.     {
  180.         if (!$this->products->contains($product)) {
  181.             $this->products[] = $product;
  182.             $product->addImage($this);
  183.         }
  184.         return $this;
  185.     }
  186.     public function removeProduct(Product $product): self
  187.     {
  188.         if ($this->products->removeElement($product)) {
  189.             $product->removeImage($this);
  190.         }
  191.         return $this;
  192.     }
  193.     public function isHomepage(): ?bool
  194.     {
  195.         return $this->homepage;
  196.     }
  197.     public function isShop(): ?bool
  198.     {
  199.         return $this->shop;
  200.     }
  201. }