<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use JMS\Serializer\Annotation\Exclude;
use JMS\Serializer\Annotation\Groups;
/**
* @ORM\Table("ContentComment")
*
* @ORM\Entity(repositoryClass="App\Repository\ContentCommentRepository")
*/
class ContentComment
{
/**
* @Groups({"commentlist", "timelineindex"})
*
* @ORM\Id()
*
* @ORM\GeneratedValue()
*
* @ORM\Column(type="integer")
*/
private $id;
/**
* @Groups({"commentlist", "timelineindex"})
*
* @ORM\ManyToOne(targetEntity="App\Entity\Member")
*
* @ORM\JoinColumn(name="member_id", referencedColumnName="id", onDelete="SET NULL")
*/
private $member;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Purchase")
*
* @ORM\JoinColumn(name="purchase_id", referencedColumnName="id", onDelete="SET NULL", nullable=true)
*/
private $purchase;
/**
* @Groups({"commentlist", "timelineindex"})
*
* @ORM\Column(type="smallint", nullable=true)
*/
private $vote;
/**
* @Exclude
*
* @Groups({"commentlist"})
*
* @ORM\ManyToOne(targetEntity="Content", inversedBy="comments")
*
* @ORM\JoinColumn(name="content_id", referencedColumnName="id", onDelete="CASCADE")
*/
private $content;
/**
* @Groups({"commentlist", "timelineindex"})
*
* @ORM\Column(type="text", nullable=true)
*/
private $text;
/**
* @Groups({"commentlist", "timelineindex"})
*
* @ORM\Column(type="datetime")
*/
private $created_at;
public function __construct()
{
$this->setCreatedAt(new \DateTime());
}
public function getId()
{
return $this->id;
}
public function setContent(Content $content): self
{
$this->content = $content;
return $this;
}
public function getContent(): Content
{
return $this->content;
}
public function getVote(): ?int
{
return $this->vote;
}
public function setVote(?int $vote): self
{
$this->vote = $vote;
return $this;
}
public function getText(): ?string
{
return $this->text;
}
public function setText(?string $text): self
{
$this->text = $text;
return $this;
}
public function getMember(): Member
{
return $this->member;
}
public function setMember(Member $member): self
{
$this->member = $member;
return $this;
}
public function setPurchase(?Purchase $purchase): self
{
$this->purchase = $purchase;
return $this;
}
public function getPurchase(): ?Purchase
{
return $this->purchase;
}
public function getCreatedAt(): ?\DateTime
{
return $this->created_at;
}
public function setCreatedAt(\DateTime $created_at): self
{
$this->created_at = $created_at;
return $this;
}
}