src/Entity/NotificationCustomer.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\NotificationCustomerRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=NotificationCustomerRepository::class)
  9.  * @ORM\HasLifecycleCallbacks()
  10.  */
  11. class NotificationCustomer
  12. {
  13.     /**
  14.      * @ORM\Id
  15.      * @ORM\GeneratedValue
  16.      * @ORM\Column(type="integer")
  17.      */
  18.     private $id;
  19.     /**
  20.      * @ORM\ManyToOne(targetEntity=Customer::class, inversedBy="notifications")
  21.      */
  22.     private $customer;
  23.     /**
  24.      * @ORM\ManyToOne(targetEntity=NotificationTemplate::class, inversedBy="notificationCustomer")
  25.      * @ORM\JoinColumn(nullable=false)
  26.      */
  27.     private $notification;
  28.     /**
  29.      * @ORM\Column(type="text", nullable=true)
  30.      */
  31.     private $message;
  32.     /**
  33.      * @ORM\Column(type="integer", nullable=true)
  34.      */
  35.     private $message_type;
  36.     /**
  37.      * @ORM\Column(type="integer")
  38.      */
  39.     private $attempts;
  40.     /**
  41.      * @ORM\Column(type="datetime")
  42.      */
  43.     private $created_at;
  44.     /**
  45.      * @ORM\Column(type="datetime")
  46.      */
  47.     private $updated_at;
  48.     /**
  49.      * @ORM\Column(type="integer")
  50.      */
  51.     private $status;
  52.     /**
  53.      * @ORM\OneToMany(targetEntity=NotificationSystem::class, mappedBy="notification_customer")
  54.      */
  55.     private $notificationSystems;
  56.     /**
  57.      * @ORM\Column(type="text", nullable=true)
  58.      */
  59.     private $related_item_id;
  60.     private $related_item;
  61.     /**
  62.      * @ORM\Column(type="string", length=255, nullable=true)
  63.      */
  64.     private $subject;
  65.     /**
  66.      * @ORM\Column(type="string", length=255, nullable=true)
  67.      */
  68.     private $name;
  69.     /**
  70.      * @ORM\Column(type="string", length=255, nullable=true)
  71.      */
  72.     private $email;
  73.     /**
  74.      * @ORM\Column(type="string", length=255, nullable=true)
  75.      */
  76.     private $sender;
  77.      /**
  78.      * @ORM\Column(type="text", nullable=true)
  79.      */
  80.     private $attachments;
  81.     public function __construct()
  82.     {
  83.         $this->notificationSystems = new ArrayCollection();
  84.     }
  85.     public function getId(): ?int
  86.     {
  87.         return $this->id;
  88.     }
  89.     public function getCustomer(): ?Customer
  90.     {
  91.         return $this->customer;
  92.     }
  93.     public function setCustomer(?Customer $customer): self
  94.     {
  95.         $this->customer $customer;
  96.         return $this;
  97.     }
  98.     public function getNotification(): ?NotificationTemplate
  99.     {
  100.         return $this->notification;
  101.     }
  102.     public function setNotification(?NotificationTemplate $notification): self
  103.     {
  104.         $this->notification $notification;
  105.         return $this;
  106.     }
  107.     public function getMessage(): ?string
  108.     {
  109.         return $this->message;
  110.     }
  111.     public function setMessage(?string $message): self
  112.     {
  113.         $this->message $message;
  114.         return $this;
  115.     }
  116.     public function getMessageType(): int
  117.     {
  118.         return $this->message_type;
  119.     }
  120.     public function setMessageType(int $message_type): self
  121.     {
  122.         $this->message_type $message_type;
  123.         return $this;
  124.     }
  125.     public function getDate(): ?\DateTimeInterface
  126.     {
  127.         return $this->date;
  128.     }
  129.     public function setDate(\DateTimeInterface $date): self
  130.     {
  131.         $this->date $date;
  132.         return $this;
  133.     }
  134.     public function getAttempts(): ?int
  135.     {
  136.         return $this->attempts;
  137.     }
  138.     public function setAttempts(int $attempts): self
  139.     {
  140.         $this->attempts $attempts;
  141.         return $this;
  142.     }
  143.     public function getCreatedAt(): ?\DateTimeInterface
  144.     {
  145.         return $this->created_at;
  146.     }
  147.     public function setCreatedAt(\DateTimeInterface $created_at): self
  148.     {
  149.         $this->created_at $created_at;
  150.         return $this;
  151.     }
  152.     public function getUpdatedAt(): ?\DateTimeInterface
  153.     {
  154.         return $this->updated_at;
  155.     }
  156.     public function setUpdatedAt(\DateTimeInterface $updated_at): self
  157.     {
  158.         $this->updated_at $updated_at;
  159.         return $this;
  160.     }
  161.     public function getStatus(): ?int
  162.     {
  163.         return $this->status;
  164.     }
  165.     public function setStatus(int $status): self
  166.     {
  167.         $this->status $status;
  168.         return $this;
  169.     }
  170.     public function getRelatedItemId(): ?string
  171.     {
  172.         return $this->related_item_id;
  173.     }
  174.     public function setRelatedItemId(?string $related_item_id): self
  175.     {
  176.         $this->related_item_id $related_item_id;
  177.         return $this;
  178.     }
  179.     public function getRelatedItem(): ?array
  180.     {
  181.         return $this->related_item;
  182.     }
  183.     public function setRelatedItem(?array $related_item): self
  184.     {
  185.         $this->related_item $related_item;
  186.         return $this;
  187.     }
  188.     /**
  189.      * @ORM\PrePersist
  190.      * @ORM\PreUpdate
  191.      */
  192.     public function updatedTimestamps(): void
  193.     {
  194.         $now = new \DateTime('now');
  195.         $this->setUpdatedAt($now);
  196.         if (null === $this->getCreatedAt()) {
  197.             $this->setCreatedAt($now);
  198.         }
  199.     }
  200.     /**
  201.      * @return Collection|NotificationSystem[]
  202.      */
  203.     public function getNotificationSystems(): Collection
  204.     {
  205.         return $this->notificationSystems;
  206.     }
  207.     public function addNotificationSystem(NotificationSystem $notificationSystem): self
  208.     {
  209.         if (!$this->notificationSystems->contains($notificationSystem)) {
  210.             $this->notificationSystems[] = $notificationSystem;
  211.             $notificationSystem->setNotificationCustomer($this);
  212.         }
  213.         return $this;
  214.     }
  215.     public function removeNotificationSystem(NotificationSystem $notificationSystem): self
  216.     {
  217.         if ($this->notificationSystems->removeElement($notificationSystem)) {
  218.             // set the owning side to null (unless already changed)
  219.             if ($notificationSystem->getNotificationCustomer() === $this) {
  220.                 $notificationSystem->setNotificationCustomer(null);
  221.             }
  222.         }
  223.         return $this;
  224.     }
  225.     public function getSubject(): ?string
  226.     {
  227.         return $this->subject;
  228.     }
  229.     public function setSubject(?string $subject): self
  230.     {
  231.         $this->subject $subject;
  232.         return $this;
  233.     }
  234.     public function getName(): ?string
  235.     {
  236.         return $this->name;
  237.     }
  238.     public function setName(?string $name): self
  239.     {
  240.         $this->name $name;
  241.         return $this;
  242.     }
  243.     public function getEmail(): ?string
  244.     {
  245.         return $this->email;
  246.     }
  247.     public function setEmail(?string $email): self
  248.     {
  249.         $this->email $email;
  250.         return $this;
  251.     }
  252.     public function getSender(): ?string
  253.     {
  254.         return $this->sender;
  255.     }
  256.     public function setSender(?string $sender): self
  257.     {
  258.         $this->sender $sender;
  259.         return $this;
  260.     }
  261.     public function getAttachments(): ?string
  262.     {
  263.         return $this->attachments;
  264.     }
  265.     public function setAttachments(?string $attachments): self
  266.     {
  267.         $this->attachments $attachments;
  268.         return $this;
  269.     }
  270. }