<?php
namespace App\Entity;
use App\Attribute\Searchable;
use App\Repository\LeakedPasswordRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Overblog\GraphQLBundle\Annotation\Field;
use DateTimeImmutable;
#[ORM\Entity(repositoryClass: LeakedPasswordRepository::class)]
class LeakedPassword extends BasicEntity
{
public const TYPE_CLEAR = 'C';
public const TYPE_EMPTY = 'E';
public const TYPE_HASHED = 'H';
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
#[Field(name: "id", type: "int")]
private $id;
#[ORM\Column(type: 'string', length: 255)]
#[Field(name: "email", type: "string")]
#[Searchable(name: 'email')]
private $email;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
#[Field(name: "password", type: "string")]
#[Searchable(name: 'password')]
private $password;
#[ORM\Column(type: 'string', length: 255)]
#[Field(name: "uuid", type: "string")]
#[Searchable(name: 'uuid')]
private $uuid;
#[ORM\Column(type: 'datetime_immutable')]
#[Field(name: "detected_at", type: "string")]
private $detectedAt;
#[ORM\Column(type: 'boolean')]
#[Field(name: "is_notified", type: "boolean")]
private $isNotified;
#[ORM\ManyToOne(targetEntity: Organisation::class, inversedBy: 'leakedPasswords')]
#[ORM\JoinColumn(nullable: false)]
private $organisation;
#[ORM\ManyToOne(targetEntity: Status::class, inversedBy: 'leakedPasswords')]
#[ORM\JoinColumn(nullable: true, options: ['default' => 1])]
#[Field(name: "status")]
private $status;
#[ORM\Column(type: 'datetime_immutable', nullable: true, options: ['default' => 'CURRENT_TIMESTAMP'])]
#[Field(name: "created_at", type: "string")]
private $createdAt;
#[ORM\Column(type: 'string', length: 255)]
#[Field(name: "source", type: "string")]
#[Searchable(name: 'source')]
private $source;
#[ORM\ManyToOne(inversedBy: 'leakedPasswords')]
#[Field(name: "domain")]
private ?Domain $domain = null;
#[ORM\Column(length: 1)]
#[Field(name: "type", type: "string")]
#[Searchable(name: 'type')]
private ?string $type = self::TYPE_CLEAR;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $location = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
#[Field(name: "fragment", type: "string")]
#[Searchable(name: 'fragment')]
private ?string $fragment = null;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $network = null;
public function getId(): ?int
{
return $this->id;
}
public function getEmail(): ?string
{
return $this->email;
}
public function setEmail(string $email): self
{
$this->email = $email;
return $this;
}
public function getPassword(): ?string
{
return $this->password;
}
public function setPassword(?string $password): self
{
$this->password = $password;
return $this;
}
public function getUuid(): ?string
{
return $this->uuid;
}
public function setUuid(string $uuid): self
{
$this->uuid = $uuid;
return $this;
}
public function getDetectedAt(): ?\DateTimeImmutable
{
return $this->detectedAt;
}
public function setDetectedAt(\DateTimeImmutable $detectedAt): self
{
$this->detectedAt = $detectedAt;
return $this;
}
public function getIsNotified(): ?bool
{
return $this->isNotified;
}
public function setIsNotified(bool $isNotified): self
{
$this->isNotified = $isNotified;
return $this;
}
public function getOrganisation(): ?Organisation
{
return $this->organisation;
}
public function setOrganisation(?Organisation $organisation): self
{
$this->organisation = $organisation;
return $this;
}
public function getStatus(): ?Status
{
return $this->status;
}
public function setStatus(?Status $status): self
{
$this->status = $status;
return $this;
}
public function getCreatedAt(): ?\DateTimeImmutable
{
return $this->createdAt;
}
public function setCreatedAt(?\DateTimeImmutable $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getSource(): ?string
{
return $this->source;
}
public function setSource(string $source): self
{
$this->source = $source;
return $this;
}
public function getDomain(): ?Domain
{
return $this->domain;
}
public function setDomain(?Domain $domain): static
{
$this->domain = $domain;
return $this;
}
public function getType(): ?string
{
return $this->type;
}
public function setType(string $type): static
{
$this->type = $type;
return $this;
}
public function getLocation(): ?string
{
return $this->location;
}
public function setLocation(string $location): static
{
$this->location = $location;
return $this;
}
public function getFragment(): ?string
{
return $this->fragment;
}
public function setFragment(string $fragment): static
{
$this->fragment = $fragment;
return $this;
}
public function getNetwork(): ?string
{
return $this->network;
}
public function setNetwork(string $network): static
{
$this->network = $network;
return $this;
}
}