41 lines
685 B
PHP
41 lines
685 B
PHP
<?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;
|
|
}
|
|
}
|