<?php
namespace App\Entity\Account;
use App\Entity\User;
use App\Repository\CommentBanRepository;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Table(name: 'user_comment_ban')]
#[ORM\Entity(repositoryClass: CommentBanRepository::class)]
class CommentBan
{
#[ORM\Id]
#[ORM\Column(name: 'id', type: 'integer')]
#[ORM\GeneratedValue(strategy: 'AUTO')]
protected int $id;
#[ORM\JoinColumn(name: 'user_id', referencedColumnName: 'id', nullable: true)]
#[ORM\OneToOne(targetEntity: User::class)]
protected ?User $user;
#[ORM\Column(name: 'ends_at', type: 'datetimetz_immutable')]
protected \DateTimeImmutable $endsAt;
public function __construct(User $user, \DateTimeImmutable $endsAt)
{
$this->user = $user;
$this->endsAt = $endsAt;
}
public function getId(): int
{
return $this->id;
}
public function getUser(): User
{
return $this->user;
}
public function clearUser(): void
{
$this->user = null;
}
public function getEndsAt(): \DateTimeImmutable
{
return $this->endsAt;
}
public function setEndsAt(\DateTimeImmutable $endsAt): void
{
$this->endsAt = $endsAt;
}
}