src/Entity/AlbumParentNotification.php line 22

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Entity;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * Tracking des notifications album envoyées aux parents.
  7.  * Garantit un envoi unique par parent + album (produit).
  8.  *
  9.  * @ORM\Entity(repositoryClass="App\Repository\AlbumParentNotificationRepository")
  10.  * @ORM\Table(name="album_parent_notifications", uniqueConstraints={
  11.  *     @ORM\UniqueConstraint(name="uq_album_parent", columns={"album_id", "parent_id"})
  12.  * }, indexes={
  13.  *     @ORM\Index(name="idx_apn_notified", columns={"notified_at"}),
  14.  *     @ORM\Index(name="idx_apn_opened", columns={"opened"}),
  15.  *     @ORM\Index(name="idx_apn_reminder", columns={"reminder_sent_at"})
  16.  * })
  17.  */
  18. class AlbumParentNotification
  19. {
  20.     /**
  21.      * @ORM\Id
  22.      * @ORM\GeneratedValue(strategy="IDENTITY")
  23.      * @ORM\Column(type="integer")
  24.      */
  25.     private ?int $id null;
  26.     /**
  27.      * @ORM\ManyToOne(targetEntity="App\Entity\Produit")
  28.      * @ORM\JoinColumn(name="album_id", referencedColumnName="id", nullable=false, onDelete="CASCADE")
  29.      */
  30.     private Produit $album;
  31.     /**
  32.      * @ORM\ManyToOne(targetEntity="App\Entity\User")
  33.      * @ORM\JoinColumn(name="parent_id", referencedColumnName="id", nullable=false, onDelete="CASCADE")
  34.      */
  35.     private User $parent;
  36.     /**
  37.      * @ORM\Column(name="email_sent", type="boolean", options={"default":false})
  38.      */
  39.     private bool $emailSent false;
  40.     /**
  41.      * @ORM\Column(name="sms_sent", type="boolean", options={"default":false})
  42.      */
  43.     private bool $smsSent false;
  44.     /**
  45.      * @ORM\Column(name="opened", type="boolean", options={"default":false})
  46.      */
  47.     private bool $opened false;
  48.     /**
  49.      * @ORM\Column(name="opened_at", type="datetime_immutable", nullable=true)
  50.      */
  51.     private ?\DateTimeImmutable $openedAt null;
  52.     /**
  53.      * @ORM\Column(name="purchased", type="boolean", options={"default":false})
  54.      */
  55.     private bool $purchased false;
  56.     /**
  57.      * @ORM\Column(name="notified_at", type="datetime_immutable", nullable=true)
  58.      */
  59.     private ?\DateTimeImmutable $notifiedAt null;
  60.     /**
  61.      * @ORM\Column(name="reminder_sent_at", type="datetime_immutable", nullable=true)
  62.      */
  63.     private ?\DateTimeImmutable $reminderSentAt null;
  64.     /**
  65.      * @ORM\Column(name="magic_link_token", type="string", length=64, nullable=true)
  66.      */
  67.     private ?string $magicLinkToken null;
  68.     /**
  69.      * Token pour pixel de suivi ouverture email.
  70.      * @ORM\Column(name="email_tracking_token", type="string", length=64, nullable=true)
  71.      */
  72.     private ?string $emailTrackingToken null;
  73.     /**
  74.      * @ORM\Column(name="email_opened_at", type="datetime_immutable", nullable=true)
  75.      */
  76.     private ?\DateTimeImmutable $emailOpenedAt null;
  77.     /**
  78.      * @ORM\Column(name="email_open_count", type="integer", options={"default":0})
  79.      */
  80.     private int $emailOpenCount 0;
  81.     /**
  82.      * Email « vous n'avez pas reçu notre SMS » envoyé (fallback).
  83.      * @ORM\Column(name="sms_fallback_email_sent", type="boolean", options={"default":false})
  84.      */
  85.     private bool $smsFallbackEmailSent false;
  86.     public function getId(): ?int { return $this->id; }
  87.     public function getAlbum(): Produit { return $this->album; }
  88.     public function setAlbum(Produit $album): self $this->album $album; return $this; }
  89.     public function getParent(): User { return $this->parent; }
  90.     public function setParent(User $parent): self $this->parent $parent; return $this; }
  91.     public function isEmailSent(): bool { return $this->emailSent; }
  92.     public function setEmailSent(bool $v): self $this->emailSent $v; return $this; }
  93.     public function isSmsSent(): bool { return $this->smsSent; }
  94.     public function setSmsSent(bool $v): self $this->smsSent $v; return $this; }
  95.     public function isOpened(): bool { return $this->opened; }
  96.     public function setOpened(bool $v): self $this->opened $v; return $this; }
  97.     public function getOpenedAt(): ?\DateTimeImmutable { return $this->openedAt; }
  98.     public function setOpenedAt(?\DateTimeImmutable $v): self $this->openedAt $v; return $this; }
  99.     public function isPurchased(): bool { return $this->purchased; }
  100.     public function setPurchased(bool $v): self $this->purchased $v; return $this; }
  101.     public function getNotifiedAt(): ?\DateTimeImmutable { return $this->notifiedAt; }
  102.     public function setNotifiedAt(?\DateTimeImmutable $v): self $this->notifiedAt $v; return $this; }
  103.     public function getReminderSentAt(): ?\DateTimeImmutable { return $this->reminderSentAt; }
  104.     public function setReminderSentAt(?\DateTimeImmutable $v): self $this->reminderSentAt $v; return $this; }
  105.     public function getMagicLinkToken(): ?string { return $this->magicLinkToken; }
  106.     public function setMagicLinkToken(?string $v): self $this->magicLinkToken $v; return $this; }
  107.     public function getEmailTrackingToken(): ?string { return $this->emailTrackingToken; }
  108.     public function setEmailTrackingToken(?string $v): self $this->emailTrackingToken $v; return $this; }
  109.     public function getEmailOpenedAt(): ?\DateTimeImmutable { return $this->emailOpenedAt; }
  110.     public function setEmailOpenedAt(?\DateTimeImmutable $v): self $this->emailOpenedAt $v; return $this; }
  111.     public function getEmailOpenCount(): int { return $this->emailOpenCount; }
  112.     public function setEmailOpenCount(int $v): self $this->emailOpenCount $v; return $this; }
  113.     public function incrementEmailOpenCount(): self $this->emailOpenCount++; return $this; }
  114.     public function isSmsFallbackEmailSent(): bool { return $this->smsFallbackEmailSent; }
  115.     public function setSmsFallbackEmailSent(bool $v): self $this->smsFallbackEmailSent $v; return $this; }
  116. }