<?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\KeywordRepository")
* @ORM\Table(name="keywords", indexes={@ORM\Index(name="id_index", columns={"id"})})
*/
class Keyword
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\Column(type="string", length=10, nullable=false)
*/
private $type;
/**
* @ORM\Column(type="string", length=100, nullable=false)
*/
private $name;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $last_import;
/**
* @ORM\Column(type="integer", nullable=false)
*/
private $imported_from_dnpedia;
/**
* @ORM\Column(type="integer", nullable=false)
*/
private $imported_from_phishtank;
/**
* @ORM\Column(type="integer", nullable=false)
*/
private $imported_from_certstream;
/**
* @ORM\Column(type="boolean", nullable=false)
*/
private $is_root;
/**
* @ORM\Column(type="boolean", nullable=false)
*/
private $status;
/**
* @ORM\OneToMany(targetEntity="App\Entity\BrandDomain", mappedBy="keyword")
*/
private $brandDomains;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Brand", inversedBy="keywords")
* @ORM\JoinColumn(name="brand_id", referencedColumnName="id", nullable=false)
*/
private $brand;
public function __construct()
{
$this->brandDomains = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getType(): ?string
{
return $this->type;
}
public function setType(string $type): self
{
$this->type = $type;
return $this;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getLastImport(): ?\DateTimeInterface
{
return $this->last_import;
}
public function setLastImport(?\DateTimeInterface $last_import): self
{
$this->last_import = $last_import;
return $this;
}
public function getImportedFromDnpedia(): ?int
{
return $this->imported_from_dnpedia;
}
public function setImportedFromDnpedia(int $imported_from_dnpedia): self
{
$this->imported_from_dnpedia = $imported_from_dnpedia;
return $this;
}
public function getImportedFromPhishtank(): ?int
{
return $this->imported_from_phishtank;
}
public function setImportedFromPhishtank(int $imported_from_phishtank): self
{
$this->imported_from_phishtank = $imported_from_phishtank;
return $this;
}
public function getImportedFromCertstream(): ?int
{
return $this->imported_from_certstream;
}
public function setImportedFromCertstream(int $imported_from_certstream): self
{
$this->imported_from_certstream = $imported_from_certstream;
return $this;
}
public function getIsRoot(): ?bool
{
return $this->is_root;
}
public function setIsRoot(bool $is_root): self
{
$this->is_root = $is_root;
return $this;
}
public function getStatus(): ?bool
{
return $this->status;
}
public function setStatus(bool $status): self
{
$this->status = $status;
return $this;
}
/**
* @return Collection|BrandDomain[]
*/
public function getBrandDomains(): Collection
{
return $this->brandDomains;
}
public function addBrandDomain(BrandDomain $brandDomain): self
{
if (!$this->brandDomains->contains($brandDomain)) {
$this->brandDomains[] = $brandDomain;
$brandDomain->setKeyword($this);
}
return $this;
}
public function removeBrandDomain(BrandDomain $brandDomain): self
{
if ($this->brandDomains->removeElement($brandDomain)) {
// set the owning side to null (unless already changed)
if ($brandDomain->getKeyword() === $this) {
$brandDomain->setKeyword(null);
}
}
return $this;
}
public function getBrand(): ?Brand
{
return $this->brand;
}
public function setBrand(?Brand $brand): self
{
$this->brand = $brand;
return $this;
}
}