| Total Complexity | 8 |
| Total Lines | 102 |
| 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() |
||
| 32 | */ |
||
| 33 | private $body; |
||
| 34 | |||
| 35 | /** |
||
| 36 | * @var User |
||
| 37 | * |
||
| 38 | * @ORM\ManyToOne(targetEntity="App\Entity\User") |
||
| 39 | * |
||
| 40 | * @Assert\NotNull() |
||
| 41 | */ |
||
| 42 | private $author; |
||
| 43 | |||
| 44 | /** |
||
| 45 | * @var Article |
||
| 46 | * |
||
| 47 | * @ORM\ManyToOne(targetEntity="App\Entity\Article") |
||
| 48 | * |
||
| 49 | * @Assert\NotNull() |
||
| 50 | */ |
||
| 51 | private $article; |
||
| 52 | |||
| 53 | /** |
||
| 54 | * @return string |
||
| 55 | */ |
||
| 56 | public function __toString() |
||
| 57 | { |
||
| 58 | return $this->body; |
||
| 59 | } |
||
| 60 | |||
| 61 | /** |
||
| 62 | * @return int |
||
| 63 | */ |
||
| 64 | 2 | public function getId() |
|
| 65 | { |
||
| 66 | 2 | return $this->id; |
|
| 67 | } |
||
| 68 | |||
| 69 | /** |
||
| 70 | * @return string |
||
| 71 | */ |
||
| 72 | 2 | public function getBody(): ?string |
|
| 75 | } |
||
| 76 | |||
| 77 | /** |
||
| 78 | * @param string $body |
||
| 79 | */ |
||
| 80 | 1 | public function setBody(?string $body): void |
|
| 81 | { |
||
| 82 | 1 | $this->body = $body; |
|
| 83 | 1 | } |
|
| 84 | |||
| 85 | /** |
||
| 86 | * @return User |
||
| 87 | */ |
||
| 88 | 4 | public function getAuthor(): ?User |
|
| 89 | { |
||
| 90 | 4 | return $this->author; |
|
| 91 | } |
||
| 92 | |||
| 93 | /** |
||
| 94 | * @param User $author |
||
| 95 | */ |
||
| 96 | 1 | public function setAuthor(User $author): void |
|
| 97 | { |
||
| 98 | 1 | $this->author = $author; |
|
| 99 | 1 | } |
|
| 100 | |||
| 101 | /** |
||
| 102 | * @return Article |
||
| 103 | */ |
||
| 104 | public function getArticle(): Article |
||
| 107 | } |
||
| 108 | |||
| 109 | /** |
||
| 110 | * @param Article $article |
||
| 111 | */ |
||
| 112 | 1 | public function setArticle(?Article $article): void |
|
| 115 | 1 | } |
|
| 116 | } |
||
| 117 |