163 lines
2.9 KiB
PHP
163 lines
2.9 KiB
PHP
<?php
|
|
|
|
namespace App\Entity;
|
|
|
|
use App\Repository\CommentRepository;
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
|
|
/**
|
|
* @ORM\Entity(repositoryClass=CommentRepository::class)
|
|
*/
|
|
class Comment
|
|
{
|
|
/**
|
|
* @ORM\Id
|
|
* @ORM\GeneratedValue
|
|
* @ORM\Column(type="integer")
|
|
*/
|
|
private $id;
|
|
|
|
/**
|
|
* @ORM\ManyToOne(targetEntity=Blog::class, inversedBy="comments")
|
|
* @ORM\JoinColumn(nullable=false)
|
|
*/
|
|
private $blog;
|
|
|
|
/**
|
|
* @ORM\Column(type="string", length=255, nullable=true)
|
|
*/
|
|
private $title;
|
|
|
|
/**
|
|
* @ORM\Column(type="text")
|
|
*/
|
|
private $content;
|
|
|
|
/**
|
|
* @ORM\ManyToOne(targetEntity=User::class, inversedBy="comments")
|
|
* @ORM\JoinColumn(nullable=false)
|
|
*/
|
|
private $author;
|
|
|
|
/**
|
|
* @ORM\Column(type="datetime")
|
|
*/
|
|
private $createdAt;
|
|
|
|
/**
|
|
* @ORM\Column(type="datetime", nullable=true)
|
|
*/
|
|
private $editedAt;
|
|
|
|
/**
|
|
* @ORM\ManyToOne(targetEntity=User::class)
|
|
*/
|
|
private $editedBy;
|
|
|
|
/**
|
|
* @ORM\Column(type="string", length=255, nullable=true)
|
|
*/
|
|
private $editReason;
|
|
|
|
public function getId(): ?int
|
|
{
|
|
return $this->id;
|
|
}
|
|
|
|
public function getBlog(): ?Blog
|
|
{
|
|
return $this->blog;
|
|
}
|
|
|
|
public function setBlog(?Blog $blog): self
|
|
{
|
|
$this->blog = $blog;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getTitle(): ?string
|
|
{
|
|
return $this->title;
|
|
}
|
|
|
|
public function setTitle(?string $title): self
|
|
{
|
|
$this->title = $title;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getContent(): ?string
|
|
{
|
|
return $this->content;
|
|
}
|
|
|
|
public function setContent(string $content): self
|
|
{
|
|
$this->content = $content;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getAuthor(): ?User
|
|
{
|
|
return $this->author;
|
|
}
|
|
|
|
public function setAuthor(?User $author): self
|
|
{
|
|
$this->author = $author;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getCreatedAt(): ?\DateTimeInterface
|
|
{
|
|
return $this->createdAt;
|
|
}
|
|
|
|
public function setCreatedAt(\DateTimeInterface $createdAt): self
|
|
{
|
|
$this->createdAt = $createdAt;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getEditedAt(): ?\DateTimeInterface
|
|
{
|
|
return $this->editedAt;
|
|
}
|
|
|
|
public function setEditedAt(?\DateTimeInterface $editedAt): self
|
|
{
|
|
$this->editedAt = $editedAt;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getEditedBy(): ?User
|
|
{
|
|
return $this->editedBy;
|
|
}
|
|
|
|
public function setEditedBy(?User $editedBy): self
|
|
{
|
|
$this->editedBy = $editedBy;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getEditReason(): ?string
|
|
{
|
|
return $this->editReason;
|
|
}
|
|
|
|
public function setEditReason(?string $editReason): self
|
|
{
|
|
$this->editReason = $editReason;
|
|
|
|
return $this;
|
|
}
|
|
}
|