src/Entity/Image.php line 12
<?php
namespace App\Entity;
use App\Repository\ImageRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: ImageRepository::class)]
class Image
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'integer')]
private $width;
#[ORM\Column(type: 'integer', nullable: true)]
private $height;
#[ORM\Column(type: 'datetime', nullable: true)]
private $date_capture;
#[ORM\Column(type: 'datetime', nullable: true)]
private $date_upload;
#[ORM\Column(type: 'string', length: 255)]
private $name;
#[ORM\Column(type: 'text', nullable: true)]
private $legend;
#[ORM\Column(type: 'integer')]
private $display_quality;
#[ORM\Column(type: 'boolean')]
private $homepage;
#[ORM\Column(type: 'boolean')]
private $shop;
#[ORM\Column(type: 'float', nullable: true)]
private $price;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $filename;
#[ORM\ManyToMany(targetEntity: Project::class, mappedBy: 'image')]
private $projects;
#[ORM\ManyToMany(targetEntity: Product::class, mappedBy: 'image')]
private $products;
public function __construct()
{
$this->projects = new ArrayCollection();
$this->products = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getWidth(): ?int
{
return $this->width;
}
public function setWidth(int $width): self
{
$this->width = $width;
return $this;
}
public function getHeight(): ?int
{
return $this->height;
}
public function setHeight(?int $height): self
{
$this->height = $height;
return $this;
}
public function getDateCapture(): ?\DateTimeInterface
{
return $this->date_capture;
}
public function setDateCapture(?\DateTimeInterface $date_capture): self
{
$this->date_capture = $date_capture;
return $this;
}
public function getDateUpload(): ?\DateTimeInterface
{
return $this->date_upload;
}
public function setDateUpload(?\DateTimeInterface $date_upload): self
{
$this->date_upload = $date_upload;
return $this;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getLegend(): ?string
{
return $this->legend;
}
public function setLegend(?string $legend): self
{
$this->legend = $legend;
return $this;
}
public function getDisplayQuality(): ?int
{
return $this->display_quality;
}
public function setDisplayQuality(int $display_quality): self
{
$this->display_quality = $display_quality;
return $this;
}
public function getHomepage(): ?bool
{
return $this->homepage;
}
public function setHomepage(bool $homepage): self
{
$this->homepage = $homepage;
return $this;
}
public function getShop(): ?bool
{
return $this->shop;
}
public function setShop(bool $shop): self
{
$this->shop = $shop;
return $this;
}
public function getPrice(): ?float
{
return $this->price;
}
public function setPrice(?float $price): self
{
$this->price = $price;
return $this;
}
public function getFilename(): ?string
{
return $this->filename;
}
public function setFilename(?string $filename): self
{
$this->filename = $filename;
return $this;
}
/**
* @return Collection|Project[]
*/
public function getProjects(): Collection
{
return $this->projects;
}
public function addProject(Project $project): self
{
if (!$this->projects->contains($project)) {
$this->projects[] = $project;
$project->addImage($this);
}
return $this;
}
public function removeProject(Project $project): self
{
if ($this->projects->removeElement($project)) {
$project->removeImage($this);
}
return $this;
}
/**
* @return Collection|Product[]
*/
public function getProducts(): Collection
{
return $this->products;
}
public function addProduct(Product $product): self
{
if (!$this->products->contains($product)) {
$this->products[] = $product;
$product->addImage($this);
}
return $this;
}
public function removeProduct(Product $product): self
{
if ($this->products->removeElement($product)) {
$product->removeImage($this);
}
return $this;
}
public function isHomepage(): ?bool
{
return $this->homepage;
}
public function isShop(): ?bool
{
return $this->shop;
}
}