add Comment entity, dto, repository interface
This commit is contained in:
parent
015e61caf7
commit
0d589340d9
3 changed files with 73 additions and 0 deletions
41
backend/app/Comment/Comment.php
Normal file
41
backend/app/Comment/Comment.php
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
<?php
|
||||
|
||||
namespace App\Comment;
|
||||
|
||||
use DateTimeImmutable;
|
||||
|
||||
class Comment
|
||||
{
|
||||
public function __construct(
|
||||
private int $id,
|
||||
private int $postId,
|
||||
private int $userId,
|
||||
private string $body,
|
||||
private DateTimeImmutable $createdAt,
|
||||
) {}
|
||||
|
||||
public function getId(): int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getPostId(): int
|
||||
{
|
||||
return $this->postId;
|
||||
}
|
||||
|
||||
public function getUserId(): int
|
||||
{
|
||||
return $this->userId;
|
||||
}
|
||||
|
||||
public function getBody(): string
|
||||
{
|
||||
return $this->body;
|
||||
}
|
||||
|
||||
public function getCreatedAt(): DateTimeImmutable
|
||||
{
|
||||
return $this->createdAt;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue