<?php
namespace App\Entity;
use App\Repository\AppAccountNotificationRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: AppAccountNotificationRepository::class)]
#[ORM\Table(name: 'TB_ACCOUNTS_NOTIFICATIONS')]
#[ORM\HasLifecycleCallbacks]
class AppAccountNotification
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\ManyToOne(inversedBy: 'appAccountNotifications')]
#[ORM\JoinColumn(nullable: false)]
private ?AppAccount $appAccount = null;
#[ORM\ManyToOne(inversedBy: 'appAccountNotifications')]
#[ORM\JoinColumn(nullable: false)]
private ?Notification $notification = null;
#[ORM\Column(nullable: true)]
private ?bool $seen = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
private ?\DateTimeInterface $seenAt = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
private ?\DateTimeInterface $createdAt = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
private ?\DateTimeInterface $modifiedAt = null;
#[ORM\Column(nullable: true)]
private ?bool $sms = null;
#[ORM\Column(nullable: true)]
private ?bool $smsSent = null;
public function __construct()
{
$this->createdAt = new \DateTime();
$this->seen = false;
$this->smsSent = false;
}
public function getId(): ?int
{
return $this->id;
}
public function getAppAccount(): ?AppAccount
{
return $this->appAccount;
}
public function setAppAccount(?AppAccount $appAccount): static
{
$this->appAccount = $appAccount;
return $this;
}
public function getNotification(): ?Notification
{
return $this->notification;
}
public function setNotification(?Notification $notification): static
{
$this->notification = $notification;
return $this;
}
public function isSeen(): ?bool
{
return $this->seen;
}
public function setSeen(?bool $seen): static
{
$this->seen = $seen;
return $this;
}
public function getSeenAt(): ?\DateTimeInterface
{
return $this->seenAt;
}
public function setSeenAt(?\DateTimeInterface $seenAt): static
{
$this->seenAt = $seenAt;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(?\DateTimeInterface $createdAt): static
{
$this->createdAt = $createdAt;
return $this;
}
public function getModifiedAt(): ?\DateTimeInterface
{
return $this->modifiedAt;
}
public function setModifiedAt(?\DateTimeInterface $modifiedAt): static
{
$this->modifiedAt = $modifiedAt;
return $this;
}
/**
* @ORM\PreUpdate
*/
public function onUpdate() {
$this->modifiedAt = new \DateTime();
}
public function isSms(): ?bool
{
return $this->sms;
}
public function setSms(?bool $sms): static
{
$this->sms = $sms;
return $this;
}
public function isSmsSent(): ?bool
{
return $this->smsSent;
}
public function setSmsSent(?bool $smsSent): static
{
$this->smsSent = $smsSent;
return $this;
}
}