src/Entity/Notification.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\NotificationRepository;
  4. use Doctrine\DBAL\Types\Types;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Overblog\GraphQLBundle\Annotation\Field;
  7. #[ORM\Entity(repositoryClassNotificationRepository::class)]
  8. #[ORM\HasLifecycleCallbacks]
  9. class Notification extends BasicEntity
  10. {
  11.     public const LEAKED_PWD_TYPE 'LP';
  12.     public const IP_TYPE 'IP';
  13.     public const SUB_DOMAIN_TYPE 'SD';
  14.     public const VULNERABILITY_TYPE 'VL';
  15.     public const DARK_WEB_TYPE 'DW';
  16.     #[ORM\Id]
  17.     #[ORM\GeneratedValue]
  18.     #[ORM\Column]
  19.     #[Field(name"id"type"int")]
  20.     private ?int $id null;
  21.     #[ORM\Column(typeTypes::TEXT)]
  22.     #[Field(name"message"type"string")]
  23.     private ?string $message null;
  24.     #[ORM\ManyToOne(inversedBy'notifications')]
  25.     #[ORM\JoinColumn(nullablefalse)]
  26.     #[Field(name"domain")]
  27.     private ?Domain $domain null;
  28.     #[ORM\Column(length255)]
  29.     #[Field(name"type"type"string")]
  30.     private ?string $type null;
  31.     #[ORM\Column]
  32.     #[Field(name"created_at"type"string")]
  33.     private ?\DateTimeImmutable $createdAt null;
  34.     public function getId(): ?int
  35.     {
  36.         return $this->id;
  37.     }
  38.     public function getMessage(): ?string
  39.     {
  40.         return $this->message;
  41.     }
  42.     public function setMessage(string $message): static
  43.     {
  44.         $this->message $message;
  45.         return $this;
  46.     }
  47.     public function getDomain(): ?Domain
  48.     {
  49.         return $this->domain;
  50.     }
  51.     public function setDomain(?Domain $domain): static
  52.     {
  53.         $this->domain $domain;
  54.         return $this;
  55.     }
  56.     public function getType(): ?string
  57.     {
  58.         return $this->type;
  59.     }
  60.     public function setType(string $type): static
  61.     {
  62.         $this->type $type;
  63.         return $this;
  64.     }
  65.     public function getCreatedAt(): ?\DateTimeImmutable
  66.     {
  67.         return $this->createdAt;
  68.     }
  69.     #[ORM\PrePersist()]
  70.     public function setCreatedAt(): static
  71.     {
  72.         $this->createdAt = new \DateTimeImmutable();
  73.         return $this;
  74.     }
  75. }