src/Entity/EmailOpenEvent.php line 10

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\EmailOpenEventRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Entity(repositoryClassEmailOpenEventRepository::class)]
  6. #[ORM\Table(name'email_open_events')]
  7. class EmailOpenEvent extends BaseEntity
  8. {
  9.     #[ORM\Id]
  10.     #[ORM\GeneratedValue]
  11.     #[ORM\Column(type'integer')]
  12.     private ?int $id null;
  13.     #[ORM\ManyToOne(targetEntityEmailRecipient::class, inversedBy'openEvents')]
  14.     #[ORM\JoinColumn(nullablefalseonDelete'CASCADE')]
  15.     private ?EmailRecipient $recipient null;
  16.     #[ORM\Column(type'datetime_immutable')]
  17.     private \DateTimeImmutable $openedAt;
  18.     #[ORM\Column(length255nullabletrue)]
  19.     private ?string $ipHash null;
  20.     #[ORM\Column(type'text'nullabletrue)]
  21.     private ?string $userAgent null;
  22.     public function __construct()
  23.     {
  24.         $this->openedAt = new \DateTimeImmutable();
  25.     }
  26.     public function getId(): ?int
  27.     {
  28.         return $this->id;
  29.     }
  30.     public function getRecipient(): ?EmailRecipient
  31.     {
  32.         return $this->recipient;
  33.     }
  34.     public function setRecipient(?EmailRecipient $recipient): self
  35.     {
  36.         $this->recipient $recipient;
  37.         return $this;
  38.     }
  39.     public function getOpenedAt(): \DateTimeImmutable
  40.     {
  41.         return $this->openedAt;
  42.     }
  43.     public function setOpenedAt(\DateTimeImmutable $openedAt): self
  44.     {
  45.         $this->openedAt $openedAt;
  46.         return $this;
  47.     }
  48.     public function getIpHash(): ?string
  49.     {
  50.         return $this->ipHash;
  51.     }
  52.     public function setIpHash(?string $ipHash): self
  53.     {
  54.         $this->ipHash $ipHash;
  55.         return $this;
  56.     }
  57.     public function getUserAgent(): ?string
  58.     {
  59.         return $this->userAgent;
  60.     }
  61.     public function setUserAgent(?string $userAgent): self
  62.     {
  63.         $this->userAgent $userAgent;
  64.         return $this;
  65.     }
  66. }