src/JanusHercules/ScamCountermeasures/Domain/Entity/SuspiciousIban.php line 14

Open in your IDE?
  1. <?php
  2. namespace JanusHercules\ScamCountermeasures\Domain\Entity;
  3. use App\Utility\DatabaseIdGenerator;
  4. use App\Utility\DateTimeUtility;
  5. use DateTime;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Exception;
  9. #[ORM\Entity]
  10. #[ORM\Table(name: 'suspicious_ibans')]
  11. class SuspiciousIban
  12. {
  13. /**
  14. * @throws Exception
  15. */
  16. public function __construct(string $iban)
  17. {
  18. $this->iban = $iban;
  19. $this->createdAt = DateTimeUtility::createDateTimeUtc();
  20. }
  21. #[ORM\Id]
  22. #[ORM\GeneratedValue(strategy: 'CUSTOM')]
  23. #[ORM\CustomIdGenerator(class: DatabaseIdGenerator::class)]
  24. #[ORM\Column(
  25. type : Types::GUID,
  26. unique: true
  27. )]
  28. private ?string $id = null;
  29. public function getId(): ?string
  30. {
  31. return $this->id;
  32. }
  33. #[ORM\Column(
  34. type : Types::STRING,
  35. nullable: false
  36. )]
  37. private string $iban;
  38. public function getIban(): string
  39. {
  40. return $this->iban;
  41. }
  42. public function setIban(string $iban): void
  43. {
  44. $this->iban = $iban;
  45. }
  46. #[ORM\Column(
  47. type : Types::DATETIME_MUTABLE,
  48. nullable: false
  49. )]
  50. private DateTime $createdAt;
  51. public function getCreatedAt(): DateTime
  52. {
  53. return $this->createdAt;
  54. }
  55. public function setCreatedAt(DateTime $createdAt): void
  56. {
  57. $this->createdAt = $createdAt;
  58. }
  59. }