<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;
#[ORM\Entity]
#[ORM\Table(name: "productcomment")]
class ProductComment
{
#[ORM\Column(type: 'integer', unique: true)]
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'AUTO')]
#[Groups(['company', 'category'])]
private $id;
#[ORM\Column(name: 'comment', type: 'text')]
#[Groups(['company', 'category'])]
private $comment;
#[ORM\Column(name: 'etoiles', type: 'integer', nullable: false)]
#[Groups(['company', 'category'])]
private $etoiles;
#[ORM\ManyToOne(targetEntity: 'App\Entity\User')]
#[ORM\JoinColumn(name: 'creator', referencedColumnName: 'id', nullable: false, onDelete: 'CASCADE')]
#[Groups(['company', 'category'])]
private $creator;
#[ORM\ManyToOne(targetEntity: 'App\Entity\Product', inversedBy: "comments")]
#[ORM\JoinColumn(name: 'product', referencedColumnName: 'id', nullable: false, onDelete: 'CASCADE')]
#[Groups(['company', 'category'])]
private $product;
#[ORM\Column(name: 'created_at', type: 'date')]
#[Groups(['company', 'category'])]
private $createdAt;
/**
* @return mixed
*/
public function getId()
{
return $this->id;
}
/**
* @param mixed $id
*/
public function setId($id)
{
$this->id = $id;
}
/**
* @return mixed
*/
public function getEtoiles()
{
return $this->etoiles;
}
/**
* @param mixed $etoiles
*/
public function setEtoiles($etoiles)
{
$this->etoiles = $etoiles;
}
/**
* @return mixed
*/
public function getComment()
{
return $this->comment;
}
/**
* @param mixed $comment
*/
public function setComment($comment)
{
$this->comment = $comment;
}
/**
* @return mixed
*/
public function getCreator()
{
return $this->creator;
}
/**
* @param mixed $creator
*/
public function setCreator($creator)
{
$this->creator = $creator;
}
/**
* @return mixed
*/
public function getProduct()
{
return $this->product;
}
/**
* @param mixed $product
*/
public function setProduct($product): void
{
$this->product = $product;
}
/**
* @return \DateTime
*/
public function getCreatedAt(): \DateTime
{
return $this->createdAt;
}
/**
* @param \DateTime $createdAt
*/
public function setCreatedAt(\DateTime $createdAt): void
{
$this->createdAt = $createdAt;
}
}