Total Complexity | 8 |
Total Lines | 65 |
Duplicated Lines | 0 % |
Coverage | 75% |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
15 | class Comment |
||
16 | { |
||
17 | use TimestampableEntity; |
||
18 | |||
19 | /** |
||
20 | * @ORM\Id() |
||
21 | * @ORM\GeneratedValue() |
||
22 | * @ORM\Column(type="integer") |
||
23 | */ |
||
24 | private ?int $id = null; |
||
25 | |||
26 | /** |
||
27 | * @ORM\Column(type="text") |
||
28 | * @Assert\NotBlank(message="comment.body.not_blank") |
||
29 | */ |
||
30 | private ?string $body = null; |
||
31 | |||
32 | /** |
||
33 | * @ORM\ManyToOne(targetEntity="App\Entity\User") |
||
34 | */ |
||
35 | private ?User $author = null; |
||
36 | |||
37 | /** |
||
38 | * @ORM\ManyToOne(targetEntity="App\Entity\Article") |
||
39 | */ |
||
40 | private ?Article $article = null; |
||
41 | |||
42 | public function __toString(): string |
||
43 | { |
||
44 | return sprintf('%s', $this->body); |
||
45 | } |
||
46 | |||
47 | 2 | public function getId(): ?int |
|
48 | { |
||
49 | 2 | return $this->id; |
|
50 | } |
||
51 | |||
52 | 4 | public function getBody(): ?string |
|
55 | } |
||
56 | |||
57 | 1 | public function setBody(?string $body): void |
|
58 | { |
||
59 | 1 | $this->body = $body; |
|
60 | } |
||
61 | |||
62 | 4 | public function getAuthor(): ?User |
|
63 | { |
||
64 | 4 | return $this->author; |
|
65 | } |
||
66 | |||
67 | 3 | public function setAuthor(?User $author): void |
|
68 | { |
||
69 | 3 | $this->author = $author; |
|
70 | } |
||
71 | |||
72 | public function getArticle(): ?Article |
||
75 | } |
||
76 | |||
77 | 3 | public function setArticle(?Article $article): void |
|
80 | } |
||
81 | } |
||
82 |