<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="App\Repository\CommentRepository")
*/
class Comment
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Version @ORM\Column(type="integer")
*/
private $version;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Content", inversedBy="comments")
* @ORM\JoinColumn(nullable=true)
*/
private $content;
/**
* @ORM\Column(type="string", length=255)
*/
private $author;
/**
* @ORM\Column(type="string", length=255)
*/
private $author_email;
/**
* @ORM\Column(type="string", length=255)
*/
private $author_url;
/**
* @ORM\Column(type="string", length=255)
*/
private $author_IP;
/**
* @ORM\Column(type="datetime")
*/
private $created_at;
/**
* @ORM\Column(type="datetime")
*/
private $modified_at;
/**
* @ORM\Column(type="integer")
*/
private $karma;
/**
* @ORM\Column(type="string", length=255)
*/
private $approved;
/**
* @ORM\Column(type="string", length=255)
*/
private $agent;
/**
* @ORM\Column(type="string", length=255)
*/
private $type;
/**
* @ORM\OneToOne(targetEntity="App\Entity\Comment", cascade={"persist", "remove"})
*/
private $prnt;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="comments")
*/
private $user;
/**
* @ORM\Column(type="string", length=255)
*/
private $comment_text;
public function __construct()
{
$this->author = "";
$this->author_url = "";
$this->author_IP = "";
$this->author_email = "";
$this->karma = 0;
$this->approved = 0;
$this->agent = "";
$this->type = "";
$this->comment_text = "";
$this->created_at = new \DateTime ();
$this->modified_at = new \DateTime();
}
public function getId()
{
return $this->id;
}
public function getVersion() {
return $this->version;
}
public function getContent(): ?Content
{
return $this->content;
}
public function setContent(?Content $content): self
{
$this->content = $content;
return $this;
}
public function getAuthor(): ?string
{
return $this->author;
}
public function setAuthor(string $author = null): self
{
$this->author = $author ? $author : "";
return $this;
}
public function getAuthorEmail(): ?string
{
return $this->author_email;
}
public function setAuthorEmail(string $author_email = null): self
{
$this->author_email = $author_email ? $author_email : "";
return $this;
}
public function getAuthorUrl(): ?string
{
return $this->author_url;
}
public function setAuthorUrl(string $author_url = null): self
{
$this->author_url = $author_url ? $author_url : "";
return $this;
}
public function getAuthorIP(): ?string
{
return $this->author_IP;
}
public function setAuthorIP(string $author_IP = null): self
{
$this->author_IP = $author_IP ? $author_IP : "";
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->created_at;
}
public function setCreatedAt(\DateTimeInterface $created_at): self
{
$this->created_at = $created_at;
return $this;
}
public function getModifiedAt(): ?\DateTimeInterface
{
return $this->modified_at;
}
public function setModifiedAt(\DateTimeInterface $modified_at): self
{
$this->modified_at = $modified_at;
return $this;
}
public function getKarma(): ?int
{
return $this->karma;
}
public function setKarma(int $karma): self
{
$this->karma = $karma;
return $this;
}
public function getApproved(): ?string
{
return $this->approved;
}
public function setApproved(string $approved = null): self
{
$this->approved = $approved ? $approved : "";
return $this;
}
public function getAgent(): ?string
{
return $this->agent;
}
public function setAgent(string $agent = null): self
{
$this->agent = $agent ? $agent : "";
return $this;
}
public function getType(): ?string
{
return $this->type;
}
public function setType(string $type = null): self
{
$this->type = $type ? $type : "";
return $this;
}
public function getPrnt(): ?self
{
return $this->prnt;
}
public function setPrnt(?self $prnt): self
{
$this->prnt = $prnt;
return $this;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
public function getCommentText(): ?string
{
return $this->comment_text;
}
public function setCommentText(string $comment_text = null): self
{
$this->comment_text = $comment_text ? $comment_text : "";
return $this;
}
public function __toString()
{
return $this->comment_text ? $this->comment_text : "";
}
}