src/Entity/Product.php line 12
<?php
namespace App\Entity;
use App\Repository\ProductRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: ProductRepository::class)]
class Product
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'string', length: 255)]
private $title;
#[ORM\Column(type: 'float', nullable: true)]
private $price;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $price_unit;
#[ORM\Column(type: 'datetime')]
private $date_creation;
#[ORM\Column(type: 'integer', nullable: true)]
private $quantity;
#[ORM\ManyToMany(targetEntity: Image::class, inversedBy: 'products')]
private $image;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $size;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $paper;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $format;
#[ORM\Column(type: 'text', nullable: true)]
private $legend;
#[ORM\Column(type: 'text', nullable: true)]
private $detail;
#[ORM\Column(type: 'text', nullable: true)]
private $delivery;
#[ORM\ManyToOne(targetEntity: Image::class)]
private $thumbnail_image_id;
#[ORM\ManyToOne(targetEntity: Image::class)]
private $thumbnail_image;
#[ORM\Column(type: 'boolean', nullable: true)]
private $online;
public function __construct()
{
$this->image = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(string $title): self
{
$this->title = $title;
return $this;
}
public function getPrice(): ?float
{
return $this->price;
}
public function setPrice(?float $price): self
{
$this->price = $price;
return $this;
}
public function getPriceUnit(): ?string
{
return $this->price_unit;
}
public function setPriceUnit(?string $price_unit): self
{
$this->price_unit = $price_unit;
return $this;
}
public function getDateCreation(): ?\DateTimeInterface
{
return $this->date_creation;
}
public function setDateCreation(\DateTimeInterface $date_creation): self
{
$this->date_creation = $date_creation;
return $this;
}
public function getQuantity(): ?int
{
return $this->quantity;
}
public function setQuantity(?int $quantity): self
{
$this->quantity = $quantity;
return $this;
}
/**
* @return Collection|image[]
*/
public function getImage(): Collection
{
return $this->image;
}
public function addImage(image $image): self
{
if (!$this->image->contains($image)) {
$this->image[] = $image;
}
return $this;
}
public function removeImage(image $image): self
{
$this->image->removeElement($image);
return $this;
}
public function getSize(): ?string
{
return $this->size;
}
public function setSize(?string $size): self
{
$this->size = $size;
return $this;
}
public function getPaper(): ?string
{
return $this->paper;
}
public function setPaper(?string $paper): self
{
$this->paper = $paper;
return $this;
}
public function getFormat(): ?string
{
return $this->format;
}
public function setFormat(?string $format): self
{
$this->format = $format;
return $this;
}
public function getLegend(): ?string
{
return $this->legend;
}
public function setLegend(?string $legend): self
{
$this->legend = $legend;
return $this;
}
public function getDetail(): ?string
{
return $this->detail;
}
public function setDetail(?string $detail): self
{
$this->detail = $detail;
return $this;
}
public function getDelivery(): ?string
{
return $this->delivery;
}
public function setDelivery(?string $delivery): self
{
$this->delivery = $delivery;
return $this;
}
public function getThumbnailImageId(): ?image
{
return $this->thumbnail_image_id;
}
public function setThumbnailImageId(?image $thumbnail_image_id): self
{
$this->thumbnail_image_id = $thumbnail_image_id;
return $this;
}
public function getThumbnailImage(): ?image
{
return $this->thumbnail_image;
}
public function setThumbnailImage(?image $thumbnail_image): self
{
$this->thumbnail_image = $thumbnail_image;
return $this;
}
public function getOnline(): ?bool
{
return $this->online;
}
public function setOnline(?bool $online): self
{
$this->online = $online;
return $this;
}
public function isOnline(): ?bool
{
return $this->online;
}
}