<?php
namespace App\Entity;
use App\Repository\NotificationCustomerRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=NotificationCustomerRepository::class)
* @ORM\HasLifecycleCallbacks()
*/
class NotificationCustomer
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=Customer::class, inversedBy="notifications")
*/
private $customer;
/**
* @ORM\ManyToOne(targetEntity=NotificationTemplate::class, inversedBy="notificationCustomer")
* @ORM\JoinColumn(nullable=false)
*/
private $notification;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $message;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $message_type;
/**
* @ORM\Column(type="integer")
*/
private $attempts;
/**
* @ORM\Column(type="datetime")
*/
private $created_at;
/**
* @ORM\Column(type="datetime")
*/
private $updated_at;
/**
* @ORM\Column(type="integer")
*/
private $status;
/**
* @ORM\OneToMany(targetEntity=NotificationSystem::class, mappedBy="notification_customer")
*/
private $notificationSystems;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $related_item_id;
private $related_item;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $subject;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $name;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $email;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $sender;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $attachments;
public function __construct()
{
$this->notificationSystems = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getCustomer(): ?Customer
{
return $this->customer;
}
public function setCustomer(?Customer $customer): self
{
$this->customer = $customer;
return $this;
}
public function getNotification(): ?NotificationTemplate
{
return $this->notification;
}
public function setNotification(?NotificationTemplate $notification): self
{
$this->notification = $notification;
return $this;
}
public function getMessage(): ?string
{
return $this->message;
}
public function setMessage(?string $message): self
{
$this->message = $message;
return $this;
}
public function getMessageType(): int
{
return $this->message_type;
}
public function setMessageType(int $message_type): self
{
$this->message_type = $message_type;
return $this;
}
public function getDate(): ?\DateTimeInterface
{
return $this->date;
}
public function setDate(\DateTimeInterface $date): self
{
$this->date = $date;
return $this;
}
public function getAttempts(): ?int
{
return $this->attempts;
}
public function setAttempts(int $attempts): self
{
$this->attempts = $attempts;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->created_at;
}
public function setCreatedAt(\DateTimeInterface $created_at): self
{
$this->created_at = $created_at;
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updated_at;
}
public function setUpdatedAt(\DateTimeInterface $updated_at): self
{
$this->updated_at = $updated_at;
return $this;
}
public function getStatus(): ?int
{
return $this->status;
}
public function setStatus(int $status): self
{
$this->status = $status;
return $this;
}
public function getRelatedItemId(): ?string
{
return $this->related_item_id;
}
public function setRelatedItemId(?string $related_item_id): self
{
$this->related_item_id = $related_item_id;
return $this;
}
public function getRelatedItem(): ?array
{
return $this->related_item;
}
public function setRelatedItem(?array $related_item): self
{
$this->related_item = $related_item;
return $this;
}
/**
* @ORM\PrePersist
* @ORM\PreUpdate
*/
public function updatedTimestamps(): void
{
$now = new \DateTime('now');
$this->setUpdatedAt($now);
if (null === $this->getCreatedAt()) {
$this->setCreatedAt($now);
}
}
/**
* @return Collection|NotificationSystem[]
*/
public function getNotificationSystems(): Collection
{
return $this->notificationSystems;
}
public function addNotificationSystem(NotificationSystem $notificationSystem): self
{
if (!$this->notificationSystems->contains($notificationSystem)) {
$this->notificationSystems[] = $notificationSystem;
$notificationSystem->setNotificationCustomer($this);
}
return $this;
}
public function removeNotificationSystem(NotificationSystem $notificationSystem): self
{
if ($this->notificationSystems->removeElement($notificationSystem)) {
// set the owning side to null (unless already changed)
if ($notificationSystem->getNotificationCustomer() === $this) {
$notificationSystem->setNotificationCustomer(null);
}
}
return $this;
}
public function getSubject(): ?string
{
return $this->subject;
}
public function setSubject(?string $subject): self
{
$this->subject = $subject;
return $this;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(?string $name): self
{
$this->name = $name;
return $this;
}
public function getEmail(): ?string
{
return $this->email;
}
public function setEmail(?string $email): self
{
$this->email = $email;
return $this;
}
public function getSender(): ?string
{
return $this->sender;
}
public function setSender(?string $sender): self
{
$this->sender = $sender;
return $this;
}
public function getAttachments(): ?string
{
return $this->attachments;
}
public function setAttachments(?string $attachments): self
{
$this->attachments = $attachments;
return $this;
}
}