<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
//use Symfony\Bridge\Doctrine\Validator\Constraints as DoctrineAssert;
use Gedmo\Mapping\Annotation as Gedmo;
/**
* @ORM\Entity
* @ORM\Table(name="product")
*/
class Product
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @var boolean $public
*
* @ORM\Column(type="boolean", nullable=true)
*/
protected $public;
/**
* @var string $name
*
* @ORM\Column(type="string", nullable=true)
*/
protected $name;
/**
* @var string $slug
* @Gedmo\Slug(fields={"name"}, updatable=true, unique=true)
*
* @ORM\Column(type="string", nullable=true)
*/
protected $slug;
/**
* @var string $description
*
* @ORM\Column(type="text", nullable=true)
*/
protected $description;
/**
* @var string $recommended_uses
*
* @ORM\Column(type="text", nullable=true)
*/
protected $recommended_uses;
/**
* @var string $uses
*
* @ORM\Column(type="text", nullable=true)
*/
protected $uses;
/**
* @var string $conditions
*
* @ORM\Column(type="string", nullable=true)
*/
protected $conditions;
/**
* @var string $tools
*
* @ORM\Column(type="string", nullable=true)
*/
protected $tools;
/**
* @var string $dilution
*
* @ORM\Column(type="string", nullable=true)
*/
protected $dilution;
/**
* @var string $layers
*
* @ORM\Column(type="string", nullable=true)
*/
protected $layers;
/**
* @var string $drying_time
*
* @ORM\Column(type="string", nullable=true)
*/
protected $drying_time;
/**
* @var string $touch_drying
*
* @ORM\Column(type="string", nullable=true)
*/
protected $touch_drying;
/**
* @var string $repaint_drying
*
* @ORM\Column(type="string", nullable=true)
*/
protected $repaint_drying;
/**
* @var string $final_drying
*
* @ORM\Column(type="string", nullable=true)
*/
protected $final_drying;
/**
* @var string $image
*
* @ORM\ManyToOne(targetEntity="App\Entity\SonataMediaMedia", cascade = {"persist"})
* @ORM\JoinColumn(name="image_id", referencedColumnName="id", onDelete="SET NULL")
*/
protected $image;
/**
* @var string $image_cover
*
* @ORM\ManyToOne(targetEntity="App\Entity\SonataMediaMedia", cascade = {"persist"})
* @ORM\JoinColumn(name="image_cover_id", referencedColumnName="id", onDelete="SET NULL")
*/
protected $image_cover;
/**
* @var string $video
*
* @ORM\ManyToOne(targetEntity="App\Entity\SonataMediaMedia", cascade = {"persist"})
* @ORM\JoinColumn(name="video_id", referencedColumnName="id", onDelete="SET NULL")
*/
protected $video;
/**
* @var string $video_image
*
* @ORM\ManyToOne(targetEntity="App\Entity\SonataMediaMedia", cascade = {"persist"})
* @ORM\JoinColumn(name="video_image_id", referencedColumnName="id", onDelete="SET NULL")
*/
protected $video_image;
/**
* @var string $data_sheet
*
* @ORM\Column(type="string", nullable=true)
*/
protected $data_sheet;
/**
* @var string $safety_sheet
*
* @ORM\Column(type="string", nullable=true)
*/
protected $safety_sheet;
/**
* @var string $safety_sheet_cb
*
* @ORM\Column(type="string", nullable=true)
*/
protected $safety_sheet_cb;
/**
* @var string $transport_sheet
*
* @ORM\Column(type="string", nullable=true)
*/
protected $transport_sheet;
/**
* @var string $packed_colors
*
* @ORM\Column(type="string", nullable=true)
*/
protected $packed_colors;
/**
* @var string $link_mp
*
* @ORM\Column(type="string", nullable=true)
*/
protected $link_mp;
/**
* Many product have Many categories.
* @ORM\ManyToMany(targetEntity="App\Entity\ProductCategory")
* @ORM\JoinTable(name="product_categories",
* joinColumns={@ORM\JoinColumn(name="product_id", referencedColumnName="id")},
* inverseJoinColumns={@ORM\JoinColumn(name="categories_id", referencedColumnName="id")}
* )
*/
private $categories;
/**
* @ORM\OneToMany(targetEntity = "App\Entity\ProductFilter", mappedBy="product", cascade={"persist", "remove"},orphanRemoval=true)
*/
protected $filters;
/**
* @ORM\OneToMany(targetEntity = "App\Entity\ProductColor", mappedBy="product" ,cascade={"persist"})
*/
protected $colors;
/**
* @var \App\Entity\Seo $seo
*
* @ORM\ManyToOne(targetEntity="App\Entity\Seo", inversedBy="products")
* @ORM\JoinColumn(name="seo_id", referencedColumnName="id")
*/
private $seo;
/**
* @var string $create_at
*
* @Gedmo\Timestampable(on="create")
* @ORM\Column(type="datetime", nullable=true)
*/
protected $create_at;
/**
* @var string $update_at
*
* @Gedmo\Timestampable(on="update")
* @ORM\Column(type="datetime", nullable=true)
*/
protected $update_at;
public function __construct()
{
$this->categories = new ArrayCollection();
$this->filters = new ArrayCollection();
$this->colors = new ArrayCollection();
}
public function __toString(): string
{
return $this->name;
}
public function getId(): ?int
{
return $this->id;
}
public function isPublic(): ?bool
{
return $this->public;
}
public function setPublic(?bool $public): static
{
$this->public = $public;
return $this;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(?string $name): static
{
$this->name = $name;
return $this;
}
public function getSlug(): ?string
{
return $this->slug;
}
public function setSlug(?string $slug): static
{
$this->slug = $slug;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): static
{
$this->description = $description;
return $this;
}
public function getRecommendedUses(): ?string
{
return $this->recommended_uses;
}
public function setRecommendedUses(?string $recommended_uses): static
{
$this->recommended_uses = $recommended_uses;
return $this;
}
public function getUses(): ?string
{
return $this->uses;
}
public function setUses(?string $uses): static
{
$this->uses = $uses;
return $this;
}
public function getConditions(): ?string
{
return $this->conditions;
}
public function setConditions(?string $conditions): static
{
$this->conditions = $conditions;
return $this;
}
public function getTools(): ?string
{
return $this->tools;
}
public function setTools(?string $tools): static
{
$this->tools = $tools;
return $this;
}
public function getDilution(): ?string
{
return $this->dilution;
}
public function setDilution(?string $dilution): static
{
$this->dilution = $dilution;
return $this;
}
public function getLayers(): ?string
{
return $this->layers;
}
public function setLayers(?string $layers): static
{
$this->layers = $layers;
return $this;
}
public function getDryingTime(): ?string
{
return $this->drying_time;
}
public function setDryingTime(?string $drying_time): static
{
$this->drying_time = $drying_time;
return $this;
}
public function getTouchDrying(): ?string
{
return $this->touch_drying;
}
public function setTouchDrying(?string $touch_drying): static
{
$this->touch_drying = $touch_drying;
return $this;
}
public function getRepaintDrying(): ?string
{
return $this->repaint_drying;
}
public function setRepaintDrying(?string $repaint_drying): static
{
$this->repaint_drying = $repaint_drying;
return $this;
}
public function getFinalDrying(): ?string
{
return $this->final_drying;
}
public function setFinalDrying(?string $final_drying): static
{
$this->final_drying = $final_drying;
return $this;
}
public function getDataSheet(): ?string
{
return $this->data_sheet;
}
public function setDataSheet(?string $data_sheet): static
{
$this->data_sheet = $data_sheet;
return $this;
}
public function getSafetySheet(): ?string
{
return $this->safety_sheet;
}
public function setSafetySheet(?string $safety_sheet): static
{
$this->safety_sheet = $safety_sheet;
return $this;
}
public function getSafetySheetCb(): ?string
{
return $this->safety_sheet_cb;
}
public function setSafetySheetCb(?string $safety_sheet_cb): static
{
$this->safety_sheet_cb = $safety_sheet_cb;
return $this;
}
public function getTransportSheet(): ?string
{
return $this->transport_sheet;
}
public function setTransportSheet(?string $transport_sheet): static
{
$this->transport_sheet = $transport_sheet;
return $this;
}
public function getPackedColors(): ?string
{
return $this->packed_colors;
}
public function setPackedColors(?string $packed_colors): static
{
$this->packed_colors = $packed_colors;
return $this;
}
public function getLinkMp(): ?string
{
return $this->link_mp;
}
public function setLinkMp(?string $link_mp): static
{
$this->link_mp = $link_mp;
return $this;
}
public function getCreateAt(): ?\DateTimeInterface
{
return $this->create_at;
}
public function setCreateAt(?\DateTimeInterface $create_at): static
{
$this->create_at = $create_at;
return $this;
}
public function getUpdateAt(): ?\DateTimeInterface
{
return $this->update_at;
}
public function setUpdateAt(?\DateTimeInterface $update_at): static
{
$this->update_at = $update_at;
return $this;
}
public function getImage(): ?SonataMediaMedia
{
return $this->image;
}
public function setImage(?SonataMediaMedia $image): static
{
$this->image = $image;
return $this;
}
public function getImageCover(): ?SonataMediaMedia
{
return $this->image_cover;
}
public function setImageCover(?SonataMediaMedia $image_cover): static
{
$this->image_cover = $image_cover;
return $this;
}
public function getVideo(): ?SonataMediaMedia
{
return $this->video;
}
public function setVideo(?SonataMediaMedia $video): static
{
$this->video = $video;
return $this;
}
public function getVideoImage(): ?SonataMediaMedia
{
return $this->video_image;
}
public function setVideoImage(?SonataMediaMedia $video_image): static
{
$this->video_image = $video_image;
return $this;
}
/**
* @return Collection<int, ProductCategory>
*/
public function getCategories(): Collection
{
return $this->categories;
}
public function addCategory(ProductCategory $category): static
{
if (!$this->categories->contains($category)) {
$this->categories->add($category);
}
return $this;
}
public function removeCategory(ProductCategory $category): static
{
$this->categories->removeElement($category);
return $this;
}
public function getSeo(): ?Seo
{
return $this->seo;
}
public function setSeo(?Seo $seo): static
{
$this->seo = $seo;
return $this;
}
/**
* @return Collection<int, ProductFilter>
*/
public function getFilters(): Collection
{
return $this->filters;
}
public function addFilter(ProductFilter $filter): static
{
if (!$this->filters->contains($filter)) {
$this->filters->add($filter);
$filter->setProduct($this);
}
return $this;
}
public function removeFilter(ProductFilter $filter): static
{
if ($this->filters->removeElement($filter)) {
// set the owning side to null (unless already changed)
if ($filter->getProduct() === $this) {
$filter->setProduct(null);
}
}
return $this;
}
/**
* @return Collection<int, ProductColor>
*/
public function getColors(): Collection
{
return $this->colors;
}
public function addColor(ProductColor $color): static
{
if (!$this->colors->contains($color)) {
$this->colors->add($color);
$color->setProduct($this);
}
return $this;
}
public function removeColor(ProductColor $color): static
{
if ($this->colors->removeElement($color)) {
// set the owning side to null (unless already changed)
if ($color->getProduct() === $this) {
$color->setProduct(null);
}
}
return $this;
}
}