<?php
namespace App\Entity;
use App\Entity\GuardianRegister\GuardianRegister;
use App\Repository\EarlyPaymentRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;
/**
* @ORM\Entity(repositoryClass=EarlyPaymentRepository::class)
*/
class EarlyPayment
{
const STATUS_ABANDONED = 'ABANDONED';
const STATUS_PAID = 'PAID';
const STATUS_NOT_PAID = 'NOT_PAID';
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
* @Groups({"PaymentList"})
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=GuardianRegister::class, inversedBy="earlyPayments")
*/
private $guardianRegister;
/**
* @ORM\Column(type="datetime", nullable=true)
* @Groups({"PaymentList"})
*/
private $createdAt;
/**
* @ORM\ManyToOne(targetEntity=Guardian::class, inversedBy="earlyPayments")
*/
private $guardian;
/**
* @ORM\Column(type="float", nullable=true)
* @Groups({"PaymentList"})
*/
private $amount;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"PaymentList"})
*/
private $status;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $uuid;
/**
* @ORM\OneToMany(targetEntity=MontonioLog::class, mappedBy="earlyPayment")
*/
private $montonioLogs;
/**
* @ORM\OneToMany(targetEntity=MontonioWebhookLog::class, mappedBy="earlyPayment")
*/
private $montonioWebhookLogs;
/**
* @ORM\Column(type="datetime", nullable=true)
* @Groups({"PaymentList"})
*/
private $dateFor;
/**
* @ORM\Column(type="datetime", nullable=true)
* @Groups({"PaymentList"})
*/
private $updatedAt;
/**
* @ORM\ManyToOne(targetEntity=Admin::class)
*/
private $admin;
public function __construct()
{
$this->montonioLogs = new ArrayCollection();
$this->montonioWebhookLogs = new ArrayCollection();
$this->createdAt = new \Datetime();
}
public function getId(): ?int
{
return $this->id;
}
public function getGuardianRegister(): ?GuardianRegister
{
return $this->guardianRegister;
}
public function setGuardianRegister(?GuardianRegister $guardianRegister): self
{
$this->guardianRegister = $guardianRegister;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(?\DateTimeInterface $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getGuardian(): ?Guardian
{
return $this->guardian;
}
public function setGuardian(?Guardian $guardian): self
{
$this->guardian = $guardian;
return $this;
}
public function getAmount(): ?float
{
return $this->amount;
}
public function setAmount(?float $amount): self
{
$this->amount = $amount;
return $this;
}
public function getStatus(): ?string
{
return $this->status;
}
public function setStatus(?string $status): self
{
$this->status = $status;
return $this;
}
public function getUuid(): ?string
{
return $this->uuid;
}
public function setUuid(?string $uuid): self
{
$this->uuid = $uuid;
return $this;
}
/**
* @return Collection<int, MontonioLog>
*/
public function getMontonioLogs(): Collection
{
return $this->montonioLogs;
}
public function addMontonioLog(MontonioLog $montonioLog): self
{
if (!$this->montonioLogs->contains($montonioLog)) {
$this->montonioLogs[] = $montonioLog;
$montonioLog->setEarlyPayment($this);
}
return $this;
}
public function removeMontonioLog(MontonioLog $montonioLog): self
{
if ($this->montonioLogs->removeElement($montonioLog)) {
// set the owning side to null (unless already changed)
if ($montonioLog->getEarlyPayment() === $this) {
$montonioLog->setEarlyPayment(null);
}
}
return $this;
}
/**
* @return Collection<int, MontonioWebhookLog>
*/
public function getMontonioWebhookLogs(): Collection
{
return $this->montonioWebhookLogs;
}
public function addMontonioWebhookLog(MontonioWebhookLog $montonioWebhookLog): self
{
if (!$this->montonioWebhookLogs->contains($montonioWebhookLog)) {
$this->montonioWebhookLogs[] = $montonioWebhookLog;
$montonioWebhookLog->setEarlyPayment($this);
}
return $this;
}
public function removeMontonioWebhookLog(MontonioWebhookLog $montonioWebhookLog): self
{
if ($this->montonioWebhookLogs->removeElement($montonioWebhookLog)) {
// set the owning side to null (unless already changed)
if ($montonioWebhookLog->getEarlyPayment() === $this) {
$montonioWebhookLog->setEarlyPayment(null);
}
}
return $this;
}
public function getDateFor(): ?\DateTimeInterface
{
return $this->dateFor;
}
public function setDateFor(?\DateTimeInterface $dateFor): self
{
$this->dateFor = $dateFor;
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
{
$this->updatedAt = $updatedAt;
return $this;
}
public function getAdmin(): ?Admin
{
return $this->admin;
}
public function setAdmin(?Admin $admin): self
{
$this->admin = $admin;
return $this;
}
}