<?php
namespace JanusHercules\ScamCountermeasures\Domain\Entity;
use App\Utility\DatabaseIdGenerator;
use App\Utility\DateTimeUtility;
use DateTime;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Exception;
#[ORM\Entity]
#[ORM\Table(name: 'suspicious_ibans')]
class SuspiciousIban
{
/**
* @throws Exception
*/
public function __construct(string $iban)
{
$this->iban = $iban;
$this->createdAt = DateTimeUtility::createDateTimeUtc();
}
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'CUSTOM')]
#[ORM\CustomIdGenerator(class: DatabaseIdGenerator::class)]
#[ORM\Column(
type : Types::GUID,
unique: true
)]
private ?string $id = null;
public function getId(): ?string
{
return $this->id;
}
#[ORM\Column(
type : Types::STRING,
nullable: false
)]
private string $iban;
public function getIban(): string
{
return $this->iban;
}
public function setIban(string $iban): void
{
$this->iban = $iban;
}
#[ORM\Column(
type : Types::DATETIME_MUTABLE,
nullable: false
)]
private DateTime $createdAt;
public function getCreatedAt(): DateTime
{
return $this->createdAt;
}
public function setCreatedAt(DateTime $createdAt): void
{
$this->createdAt = $createdAt;
}
}