<?php
namespace App\Entity;
use App\Repository\LeakInfoRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Overblog\GraphQLBundle\Annotation\Field;
#[ORM\Entity(repositoryClass: LeakInfoRepository::class)]
class LeakInfo extends BasicEntity
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: "integer")]
#[Field(name: "id", type: "int")]
private $id;
#[ORM\Column(type: "string", length: 255)]
#[Field(name: "name", type: "string")]
private $name;
#[ORM\Column(type: "string", length: 255)]
#[Field(name: "host", type: "string")]
private $host;
#[ORM\Column(type: "text", nullable: true)]
#[Field(name: "file_path", type: "string")]
private $filePath;
#[ORM\Column(type: "text", nullable: true)]
#[Field(name: "file_name", type: "string")]
private $fileName;
#[ORM\OneToMany(mappedBy: "leakInfo", targetEntity: LeakActor::class, cascade: ["persist"], orphanRemoval: true)]
#[Field(name: "leak_actors")]
private $leakActors;
#[ORM\OneToMany(mappedBy: "leakInfo", targetEntity: LeakAssociation::class, cascade: ["persist"], orphanRemoval: true)]
#[Field(name: "leak_associations")]
private $leakAssociations;
#[ORM\OneToMany(mappedBy: "leakInfo", targetEntity: LeakDownload::class, cascade: ["persist"], orphanRemoval: true)]
#[Field(name: "download_locations")]
private $downloadLocations;
public function __construct()
{
$this->leakActors = new ArrayCollection();
$this->leakAssociations = new ArrayCollection();
$this->downloadLocations = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getHost(): ?string
{
return $this->host;
}
public function setHost(string $host): self
{
$this->host = $host;
return $this;
}
public function getFilePath(): ?string
{
return $this->filePath;
}
public function setFilePath(?string $filePath): self
{
$this->filePath = $filePath;
return $this;
}
public function getFileName(): ?string
{
return $this->fileName;
}
public function setFileName(?string $fileName): self
{
$this->fileName = $fileName;
return $this;
}
/**
* @return Collection<int, LeakActor>
*/
public function getLeakActors(): Collection
{
return $this->leakActors;
}
public function addLeakActor(LeakActor $leakActor): self
{
if (!$this->leakActors->contains($leakActor)) {
$this->leakActors[] = $leakActor;
$leakActor->setLeakInfo($this);
}
return $this;
}
public function removeLeakActor(LeakActor $leakActor): self
{
if ($this->leakActors->removeElement($leakActor)) {
// set the owning side to null (unless already changed)
if ($leakActor->getLeakInfo() === $this) {
$leakActor->setLeakInfo(null);
}
}
return $this;
}
/**
* @return Collection<int, LeakAssociation>
*/
public function getLeakAssociations(): Collection
{
return $this->leakAssociations;
}
public function addLeakAssociation(LeakAssociation $leakAssociation): self
{
if (!$this->leakAssociations->contains($leakAssociation)) {
$this->leakAssociations[] = $leakAssociation;
$leakAssociation->setLeakInfo($this);
}
return $this;
}
public function removeLeakAssociation(LeakAssociation $leakAssociation): self
{
if ($this->leakAssociations->removeElement($leakAssociation)) {
// set the owning side to null (unless already changed)
if ($leakAssociation->getLeakInfo() === $this) {
$leakAssociation->setLeakInfo(null);
}
}
return $this;
}
/**
* @return Collection<int, LeakDownload>
*/
public function getDownloadLocations(): Collection
{
return $this->downloadLocations;
}
public function addDownloadLocation(LeakDownload $downloadLocation): self
{
if (!$this->downloadLocations->contains($downloadLocation)) {
$this->downloadLocations[] = $downloadLocation;
$downloadLocation->setLeakInfo($this);
}
return $this;
}
public function removeDownloadLocation(LeakDownload $downloadLocation): self
{
if ($this->downloadLocations->removeElement($downloadLocation)) {
// set the owning side to null (unless already changed)
if ($downloadLocation->getLeakInfo() === $this) {
$downloadLocation->setLeakInfo(null);
}
}
return $this;
}
}