<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="App\Repository\BrandDomainRepository")
* @ORM\Table(name="brands_domains", indexes={@ORM\Index(name="id_index", columns={"id"})})
*/
class BrandDomain
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\Column(type="text", length=254, nullable=false)
*/
private $domain;
/**
* @ORM\Column(type="text", length=254, nullable=true)
*/
private $url;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $last_activity;
/**
* @ORM\Column(type="string", length=20, nullable=false)
*/
private $status;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Check", mappedBy="brandDomain")
*/
private $checks;
/**
* @ORM\OneToMany(targetEntity="App\Entity\CheckHistory", mappedBy="brandDomain")
*/
private $checkHistories;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Brand", inversedBy="brandDomains")
* @ORM\JoinColumn(name="brand_id", referencedColumnName="id", nullable=false)
*/
private $brand;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\SuspiciousDomain", inversedBy="brandDomains")
* @ORM\JoinColumn(name="suspicious_domain_id", referencedColumnName="id", nullable=false)
*/
private $suspiciousDomain;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Keyword", inversedBy="brandDomains")
* @ORM\JoinColumn(name="keyword_id", referencedColumnName="id")
*/
private $keyword;
public function __construct()
{
$this->checks = new ArrayCollection();
$this->checkHistories = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getDomain(): ?string
{
return $this->domain;
}
public function setDomain(string $domain): self
{
$this->domain = $domain;
return $this;
}
public function getUrl(): ?string
{
return $this->url;
}
public function setUrl(?string $url): self
{
$this->url = $url;
return $this;
}
public function getLastActivity(): ?\DateTimeInterface
{
return $this->last_activity;
}
public function setLastActivity(?\DateTimeInterface $last_activity): self
{
$this->last_activity = $last_activity;
return $this;
}
public function getStatus(): ?string
{
return $this->status;
}
public function setStatus(string $status): self
{
$this->status = $status;
return $this;
}
/**
* @return Collection|Check[]
*/
public function getChecks(): Collection
{
return $this->checks;
}
public function addCheck(Check $check): self
{
if (!$this->checks->contains($check)) {
$this->checks[] = $check;
$check->setBrandDomain($this);
}
return $this;
}
public function removeCheck(Check $check): self
{
if ($this->checks->removeElement($check)) {
// set the owning side to null (unless already changed)
if ($check->getBrandDomain() === $this) {
$check->setBrandDomain(null);
}
}
return $this;
}
/**
* @return Collection|CheckHistory[]
*/
public function getCheckHistories(): Collection
{
return $this->checkHistories;
}
public function addCheckHistory(CheckHistory $checkHistory): self
{
if (!$this->checkHistories->contains($checkHistory)) {
$this->checkHistories[] = $checkHistory;
$checkHistory->setBrandDomain($this);
}
return $this;
}
public function removeCheckHistory(CheckHistory $checkHistory): self
{
if ($this->checkHistories->removeElement($checkHistory)) {
// set the owning side to null (unless already changed)
if ($checkHistory->getBrandDomain() === $this) {
$checkHistory->setBrandDomain(null);
}
}
return $this;
}
public function getBrand(): ?Brand
{
return $this->brand;
}
public function setBrand(?Brand $brand): self
{
$this->brand = $brand;
return $this;
}
public function getSuspiciousDomain(): ?SuspiciousDomain
{
return $this->suspiciousDomain;
}
public function setSuspiciousDomain(?SuspiciousDomain $suspiciousDomain): self
{
$this->suspiciousDomain = $suspiciousDomain;
return $this;
}
public function getKeyword(): ?Keyword
{
return $this->keyword;
}
public function setKeyword(?Keyword $keyword): self
{
$this->keyword = $keyword;
return $this;
}
}