src/Entity/Account/CommentBan.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Account;
  3. use App\Entity\User;
  4. use App\Repository\CommentBanRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. #[ORM\Table(name'user_comment_ban')]
  7. #[ORM\Entity(repositoryClassCommentBanRepository::class)]
  8. class CommentBan
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\Column(name'id'type'integer')]
  12.     #[ORM\GeneratedValue(strategy'AUTO')]
  13.     protected int $id;
  14.     #[ORM\JoinColumn(name'user_id'referencedColumnName'id'nullabletrue)]
  15.     #[ORM\OneToOne(targetEntityUser::class)]
  16.     protected ?User $user;
  17.     #[ORM\Column(name'ends_at'type'datetimetz_immutable')]
  18.     protected \DateTimeImmutable $endsAt;
  19.     public function __construct(User $user\DateTimeImmutable $endsAt)
  20.     {
  21.         $this->user $user;
  22.         $this->endsAt $endsAt;
  23.     }
  24.     public function getId(): int
  25.     {
  26.         return $this->id;
  27.     }
  28.     public function getUser(): User
  29.     {
  30.         return $this->user;
  31.     }
  32.     public function clearUser(): void
  33.     {
  34.         $this->user null;
  35.     }
  36.     public function getEndsAt(): \DateTimeImmutable
  37.     {
  38.         return $this->endsAt;
  39.     }
  40.     public function setEndsAt(\DateTimeImmutable $endsAt): void
  41.     {
  42.         $this->endsAt $endsAt;
  43.     }
  44. }