src/Entity/ProductColor.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\DBAL\Types\Types;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\Validator\Constraints as Assert;
  6. //use Symfony\Bridge\Doctrine\Validator\Constraints as DoctrineAssert;
  7. use Gedmo\Mapping\Annotation as Gedmo;
  8. /**
  9.  * @ORM\Entity
  10.  * @ORM\Table(name="product_color")
  11.  */
  12. class ProductColor
  13. {
  14.     /**
  15.     * @ORM\Id
  16.     * @ORM\Column(type="integer")
  17.     * @ORM\GeneratedValue(strategy="AUTO")
  18.     */
  19.     protected $id;
  20.     /**
  21.     * @var boolean $public
  22.     *
  23.     * @ORM\Column(type="boolean", nullable=true)
  24.     */
  25.     protected $public;
  26.     /**
  27.     * @var string $name
  28.     *
  29.     * @ORM\Column(type="string", nullable=true)
  30.     */
  31.     protected $name;
  32.     /**
  33.     * @var string $color_hexa
  34.     *
  35.     * @ORM\Column(type="string", nullable=true)
  36.     */
  37.     protected $color_hexa;
  38.     /**
  39.     * @var string $image
  40.     *
  41.     * @ORM\ManyToOne(targetEntity="App\Entity\SonataMediaMedia", cascade = {"persist"})
  42.     * @ORM\JoinColumn(name="image_id", referencedColumnName="id", onDelete="SET NULL")
  43.     */
  44.     protected $image;
  45.     /**
  46.     * @var \App\Entity\Product $product
  47.     *
  48.     * @ORM\ManyToOne(targetEntity="App\Entity\Product", inversedBy="colors")
  49.     * @ORM\JoinColumn(name="product_id", referencedColumnName="id")
  50.     */
  51.     private $product;
  52.     /**
  53.     * @var string $create_at
  54.     *
  55.     * @Gedmo\Timestampable(on="create")
  56.     * @ORM\Column(type="datetime", nullable=true)
  57.     */
  58.     protected $create_at;
  59.     /**
  60.     * @var string $update_at
  61.     *
  62.     * @Gedmo\Timestampable(on="update")
  63.     * @ORM\Column(type="datetime", nullable=true)
  64.     */
  65.     protected $update_at;
  66.     public function getId(): ?int
  67.     {
  68.         return $this->id;
  69.     }
  70.     public function getName(): ?string
  71.     {
  72.         return $this->name;
  73.     }
  74.     public function setName(?string $name): static
  75.     {
  76.         $this->name = $name;
  77.         return $this;
  78.     }
  79.     public function getColorHexa(): ?string
  80.     {
  81.         return $this->color_hexa;
  82.     }
  83.     public function setColorHexa(?string $color_hexa): static
  84.     {
  85.         $this->color_hexa = $color_hexa;
  86.         return $this;
  87.     }
  88.     public function getImage(): ?SonataMediaMedia
  89.     {
  90.         return $this->image;
  91.     }
  92.     public function setImage(?SonataMediaMedia $image): static
  93.     {
  94.         $this->image = $image;
  95.         return $this;
  96.     }
  97.     public function getProduct(): ?Product
  98.     {
  99.         return $this->product;
  100.     }
  101.     public function setProduct(?Product $product): static
  102.     {
  103.         $this->product = $product;
  104.         return $this;
  105.     }
  106.     public function isPublic(): ?bool
  107.     {
  108.         return $this->public;
  109.     }
  110.     public function setPublic(?bool $public): static
  111.     {
  112.         $this->public = $public;
  113.         return $this;
  114.     }
  115.     public function getCreateAt(): ?\DateTimeInterface
  116.     {
  117.         return $this->create_at;
  118.     }
  119.     public function setCreateAt(?\DateTimeInterface $create_at): static
  120.     {
  121.         $this->create_at = $create_at;
  122.         return $this;
  123.     }
  124.     public function getUpdateAt(): ?\DateTimeInterface
  125.     {
  126.         return $this->update_at;
  127.     }
  128.     public function setUpdateAt(?\DateTimeInterface $update_at): static
  129.     {
  130.         $this->update_at = $update_at;
  131.         return $this;
  132.     }
  133. }