for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Timestampable\Traits\TimestampableEntity;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity(repositoryClass="App\Repository\CommentRepository")
* @ORM\Table(name="rw_comment")
*/
class Comment
{
use TimestampableEntity;
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
private ?int $id = null;
* @ORM\Column(type="text")
* @Assert\NotBlank(message="comment.body.not_blank")
private ?string $body = null;
* @ORM\ManyToOne(targetEntity="App\Entity\User")
private ?User $author = null;
* @ORM\ManyToOne(targetEntity="App\Entity\Article")
private ?Article $article = null;
public function __toString(): string
return sprintf('%s', $this->body);
}
public function getId(): ?int
return $this->id;
public function getBody(): ?string
return $this->body;
public function setBody(?string $body): void
$this->body = $body;
public function getAuthor(): ?User
return $this->author;
public function setAuthor(?User $author): void
$this->author = $author;
public function getArticle(): ?Article
return $this->article;
public function setArticle(?Article $article): void
$this->article = $article;