<?php
declare(strict_types=1);
namespace App\Domain\PaymentGateway\Model;
use App\Domain\Payment\Model\Payment;
class UserPaymentInfo
{
private ?int $id = null;
private Payment $payment;
private string $ipAddress;
private ?string $name;
private \DateTimeImmutable $createdAt;
private \DateTimeImmutable $updatedAt;
public function __construct(
Payment $payment,
string $ipAddress,
string $name
) {
$this->payment = $payment;
$this->ipAddress = $ipAddress;
$this->name = $name;
$this->createdAt = new \DateTimeImmutable();
$this->updatedAt = new \DateTimeImmutable();
}
public function getId(): ?int
{
return $this->id;
}
public function getPayment(): Payment
{
return $this->payment;
}
public function setPayment(Payment $payment): void
{
$this->payment = $payment;
}
public function getIpAddress(): string
{
return $this->ipAddress;
}
public function setIpAddress(string $ipAddress): void
{
$this->ipAddress = $ipAddress;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(?string $name): void
{
$this->name = $name;
}
public function getCreatedAt(): \DateTimeImmutable
{
return $this->createdAt;
}
public function getUpdatedAt(): \DateTimeImmutable
{
return $this->updatedAt;
}
public function touch(): void
{
$this->updatedAt = new \DateTimeImmutable();
}
}