src/Entity/DarkOwl.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Attribute\Searchable;
  4. use App\Repository\DarkOwlRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Overblog\GraphQLBundle\Annotation\Field;
  9. #[ORM\Entity(repositoryClassDarkOwlRepository::class)]
  10. class DarkOwl extends BasicEntity
  11. {
  12.     #[ORM\Id]
  13.     #[ORM\GeneratedValue]
  14.     #[ORM\Column(type"integer")]
  15.     #[Field(name"id"type"int")]
  16.     private $id;
  17.     #[ORM\Column(type"string"length255nullabletrue)]
  18.     #[Field(name"title"type"string")]
  19.     #[Searchable(name'title')]
  20.     private $title;
  21.     #[ORM\Column(type"text")]
  22.     #[Field(name"body"type"string")]
  23.     #[Searchable(name'body')]
  24.     private $body;
  25.     #[ORM\Column(type"string"length255nullabletrue)]
  26.     #[Field(name"source"type"string")]
  27.     #[Searchable(name'source')]
  28.     private $source;
  29.     #[ORM\Column(type"datetime")]
  30.     #[Field(name"crawl_date"type"string")]
  31.     #[Searchable(name'crawl_date')]
  32.     private $crawlDate;
  33.     #[ORM\Column(type"float")]
  34.     #[Field(name"hackishness"type"float")]
  35.     private $hackishness;
  36.     #[ORM\Column(type"text")]
  37.     #[Field(name"url"type"string")]
  38.     #[Searchable(name'url')]
  39.     private $url;
  40.     #[ORM\Column(type"float")]
  41.     #[Field(name"file_size"type"float")]
  42.     private $fileSize;
  43.     #[ORM\Column(type"string"length255)]
  44.     #[Field(name"document_id"type"string")]
  45.     #[Searchable(name'document_id')]
  46.     private $documentID;
  47.     #[ORM\ManyToOne(targetEntityDomain::class, inversedBy"darkOwls")]
  48.     #[ORM\JoinColumn(nullablefalse)]
  49.     #[Field(name"domain")]
  50.     private $domain;
  51.     #[ORM\OneToMany(mappedBy"darkOwl"targetEntityLeakEmail::class, cascade: ["persist"], orphanRemovaltrue)]
  52.     #[Field(name"emails")]
  53.     private $emails;
  54.     #[ORM\OneToOne(targetEntityLeakInfo::class, cascade: ["persist""remove"])]
  55.     #[Field(name"leak_info")]
  56.     private $leakInfo;
  57.     public function __construct()
  58.     {
  59.         $this->emails = new ArrayCollection();
  60.     }
  61.     public function getId(): ?int
  62.     {
  63.         return $this->id;
  64.     }
  65.     public function getTitle(): ?string
  66.     {
  67.         return $this->title;
  68.     }
  69.     public function setTitle(string $title): self
  70.     {
  71.         $this->title $title;
  72.         return $this;
  73.     }
  74.     public function getBody(): ?string
  75.     {
  76.         return $this->body;
  77.     }
  78.     public function setBody(string $body): self
  79.     {
  80.         $this->body $body;
  81.         return $this;
  82.     }
  83.     public function getSource(): ?string
  84.     {
  85.         return $this->source;
  86.     }
  87.     public function setSource(?string $source): self
  88.     {
  89.         $this->source $source;
  90.         return $this;
  91.     }
  92.     public function getCrawlDate(): ?\DateTimeInterface
  93.     {
  94.         return $this->crawlDate;
  95.     }
  96.     public function setCrawlDate(\DateTimeInterface $crawlDate): self
  97.     {
  98.         $this->crawlDate $crawlDate;
  99.         return $this;
  100.     }
  101.     public function getHackishness(): ?float
  102.     {
  103.         return $this->hackishness;
  104.     }
  105.     public function setHackishness(float $hackishness): self
  106.     {
  107.         $this->hackishness $hackishness;
  108.         return $this;
  109.     }
  110.     public function getUrl(): ?string
  111.     {
  112.         return $this->url;
  113.     }
  114.     public function setUrl(string $url): self
  115.     {
  116.         $this->url $url;
  117.         return $this;
  118.     }
  119.     public function getFileSize(): ?float
  120.     {
  121.         return $this->fileSize;
  122.     }
  123.     public function setFileSize(float $fileSize): self
  124.     {
  125.         $this->fileSize $fileSize;
  126.         return $this;
  127.     }
  128.     public function getDocumentID(): ?string
  129.     {
  130.         return $this->documentID;
  131.     }
  132.     public function setDocumentID(string $documentID): self
  133.     {
  134.         $this->documentID $documentID;
  135.         return $this;
  136.     }
  137.     public function getDomain(): ?Domain
  138.     {
  139.         return $this->domain;
  140.     }
  141.     public function setDomain(?Domain $domain): self
  142.     {
  143.         $this->domain $domain;
  144.         return $this;
  145.     }
  146.     /**
  147.      * @return Collection<int, LeakEmail>
  148.      */
  149.     public function getEmails(): Collection
  150.     {
  151.         return $this->emails;
  152.     }
  153.     public function addEmail(LeakEmail $email): self
  154.     {
  155.         if (!$this->emails->contains($email)) {
  156.             $this->emails[] = $email;
  157.             $email->setDarkOwl($this);
  158.         }
  159.         return $this;
  160.     }
  161.     public function removeEmail(LeakEmail $email): self
  162.     {
  163.         if ($this->emails->removeElement($email)) {
  164.             // set the owning side to null (unless already changed)
  165.             if ($email->getDarkOwl() === $this) {
  166.                 $email->setDarkOwl(null);
  167.             }
  168.         }
  169.         return $this;
  170.     }
  171.     public function getLeakInfo(): ?LeakInfo
  172.     {
  173.         return $this->leakInfo;
  174.     }
  175.     public function setLeakInfo(?LeakInfo $leakInfo): self
  176.     {
  177.         $this->leakInfo $leakInfo;
  178.         return $this;
  179.     }
  180. }