| Total Complexity | 8 |
| Total Lines | 98 |
| Duplicated Lines | 0 % |
| Coverage | 77.78% |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | class Comment |
||
| 14 | { |
||
| 15 | use TimestampableEntity; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @var int |
||
| 19 | * |
||
| 20 | * @ORM\Id() |
||
| 21 | * @ORM\GeneratedValue() |
||
| 22 | * @ORM\Column(type="integer") |
||
| 23 | */ |
||
| 24 | private $id; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @var string |
||
| 28 | * |
||
| 29 | * @ORM\Column(type="text") |
||
| 30 | * |
||
| 31 | * @Assert\NotBlank(message="comment.body.not_blank") |
||
| 32 | */ |
||
| 33 | private $body; |
||
| 34 | |||
| 35 | /** |
||
| 36 | * @var User |
||
| 37 | * |
||
| 38 | * @ORM\ManyToOne(targetEntity="App\Entity\User") |
||
| 39 | */ |
||
| 40 | private $author; |
||
| 41 | |||
| 42 | /** |
||
| 43 | * @var Article |
||
| 44 | * |
||
| 45 | * @ORM\ManyToOne(targetEntity="App\Entity\Article") |
||
| 46 | */ |
||
| 47 | private $article; |
||
| 48 | |||
| 49 | /** |
||
| 50 | * @return string |
||
| 51 | */ |
||
| 52 | public function __toString() |
||
| 53 | { |
||
| 54 | return $this->body; |
||
| 55 | } |
||
| 56 | |||
| 57 | /** |
||
| 58 | * @return int |
||
| 59 | */ |
||
| 60 | 2 | public function getId() |
|
| 61 | { |
||
| 62 | 2 | return $this->id; |
|
| 63 | } |
||
| 64 | |||
| 65 | /** |
||
| 66 | * @return string |
||
| 67 | */ |
||
| 68 | 2 | public function getBody(): ?string |
|
| 71 | } |
||
| 72 | |||
| 73 | /** |
||
| 74 | * @param string $body |
||
| 75 | */ |
||
| 76 | 1 | public function setBody(?string $body): void |
|
| 77 | { |
||
| 78 | 1 | $this->body = $body; |
|
| 79 | 1 | } |
|
| 80 | |||
| 81 | /** |
||
| 82 | * @return User |
||
| 83 | */ |
||
| 84 | 4 | public function getAuthor(): ?User |
|
| 85 | { |
||
| 86 | 4 | return $this->author; |
|
| 87 | } |
||
| 88 | |||
| 89 | /** |
||
| 90 | * @param User $author |
||
| 91 | */ |
||
| 92 | 1 | public function setAuthor(User $author): void |
|
| 93 | { |
||
| 94 | 1 | $this->author = $author; |
|
| 95 | 1 | } |
|
| 96 | |||
| 97 | /** |
||
| 98 | * @return Article |
||
| 99 | */ |
||
| 100 | public function getArticle(): Article |
||
| 103 | } |
||
| 104 | |||
| 105 | /** |
||
| 106 | * @param Article $article |
||
| 107 | */ |
||
| 108 | 1 | public function setArticle(?Article $article): void |
|
| 111 | 1 | } |
|
| 112 | } |
||
| 113 |