<?php
namespace App\Entity;
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_color")
*/
class ProductColor
{
/**
* @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 $color_hexa
*
* @ORM\Column(type="string", nullable=true)
*/
protected $color_hexa;
/**
* @var string $image
*
* @ORM\ManyToOne(targetEntity="App\Entity\SonataMediaMedia", cascade = {"persist"})
* @ORM\JoinColumn(name="image_id", referencedColumnName="id", onDelete="SET NULL")
*/
protected $image;
/**
* @var \App\Entity\Product $product
*
* @ORM\ManyToOne(targetEntity="App\Entity\Product", inversedBy="colors")
* @ORM\JoinColumn(name="product_id", referencedColumnName="id")
*/
private $product;
/**
* @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 getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(?string $name): static
{
$this->name = $name;
return $this;
}
public function getColorHexa(): ?string
{
return $this->color_hexa;
}
public function setColorHexa(?string $color_hexa): static
{
$this->color_hexa = $color_hexa;
return $this;
}
public function getImage(): ?SonataMediaMedia
{
return $this->image;
}
public function setImage(?SonataMediaMedia $image): static
{
$this->image = $image;
return $this;
}
public function getProduct(): ?Product
{
return $this->product;
}
public function setProduct(?Product $product): static
{
$this->product = $product;
return $this;
}
public function isPublic(): ?bool
{
return $this->public;
}
public function setPublic(?bool $public): static
{
$this->public = $public;
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;
}
}