src/Entity/BrandDomain.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * @ORM\Entity(repositoryClass="App\Repository\BrandDomainRepository")
  8.  * @ORM\Table(name="brands_domains", indexes={@ORM\Index(name="id_index", columns={"id"})})
  9.  */
  10. class BrandDomain
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\Column(type="integer")
  15.      * @ORM\GeneratedValue(strategy="AUTO")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="text", length=254, nullable=false)
  20.      */
  21.     private $domain;
  22.     /**
  23.      * @ORM\Column(type="text", length=254, nullable=true)
  24.      */
  25.     private $url;
  26.     /**
  27.      * @ORM\Column(type="datetime", nullable=true)
  28.      */
  29.     private $last_activity;
  30.     /**
  31.      * @ORM\Column(type="string", length=20, nullable=false)
  32.      */
  33.     private $status;
  34.     /**
  35.      * @ORM\OneToMany(targetEntity="App\Entity\Check", mappedBy="brandDomain")
  36.      */
  37.     private $checks;
  38.     /**
  39.      * @ORM\OneToMany(targetEntity="App\Entity\CheckHistory", mappedBy="brandDomain")
  40.      */
  41.     private $checkHistories;
  42.     /**
  43.      * @ORM\ManyToOne(targetEntity="App\Entity\Brand", inversedBy="brandDomains")
  44.      * @ORM\JoinColumn(name="brand_id", referencedColumnName="id", nullable=false)
  45.      */
  46.     private $brand;
  47.     /**
  48.      * @ORM\ManyToOne(targetEntity="App\Entity\SuspiciousDomain", inversedBy="brandDomains")
  49.      * @ORM\JoinColumn(name="suspicious_domain_id", referencedColumnName="id", nullable=false)
  50.      */
  51.     private $suspiciousDomain;
  52.     /**
  53.      * @ORM\ManyToOne(targetEntity="App\Entity\Keyword", inversedBy="brandDomains")
  54.      * @ORM\JoinColumn(name="keyword_id", referencedColumnName="id")
  55.      */
  56.     private $keyword;
  57.     public function __construct()
  58.     {
  59.         $this->checks = new ArrayCollection();
  60.         $this->checkHistories = new ArrayCollection();
  61.     }
  62.     public function getId(): ?int
  63.     {
  64.         return $this->id;
  65.     }
  66.     public function getDomain(): ?string
  67.     {
  68.         return $this->domain;
  69.     }
  70.     public function setDomain(string $domain): self
  71.     {
  72.         $this->domain $domain;
  73.         return $this;
  74.     }
  75.     public function getUrl(): ?string
  76.     {
  77.         return $this->url;
  78.     }
  79.     public function setUrl(?string $url): self
  80.     {
  81.         $this->url $url;
  82.         return $this;
  83.     }
  84.     public function getLastActivity(): ?\DateTimeInterface
  85.     {
  86.         return $this->last_activity;
  87.     }
  88.     public function setLastActivity(?\DateTimeInterface $last_activity): self
  89.     {
  90.         $this->last_activity $last_activity;
  91.         return $this;
  92.     }
  93.     public function getStatus(): ?string
  94.     {
  95.         return $this->status;
  96.     }
  97.     public function setStatus(string $status): self
  98.     {
  99.         $this->status $status;
  100.         return $this;
  101.     }
  102.     /**
  103.      * @return Collection|Check[]
  104.      */
  105.     public function getChecks(): Collection
  106.     {
  107.         return $this->checks;
  108.     }
  109.     public function addCheck(Check $check): self
  110.     {
  111.         if (!$this->checks->contains($check)) {
  112.             $this->checks[] = $check;
  113.             $check->setBrandDomain($this);
  114.         }
  115.         return $this;
  116.     }
  117.     public function removeCheck(Check $check): self
  118.     {
  119.         if ($this->checks->removeElement($check)) {
  120.             // set the owning side to null (unless already changed)
  121.             if ($check->getBrandDomain() === $this) {
  122.                 $check->setBrandDomain(null);
  123.             }
  124.         }
  125.         return $this;
  126.     }
  127.     /**
  128.      * @return Collection|CheckHistory[]
  129.      */
  130.     public function getCheckHistories(): Collection
  131.     {
  132.         return $this->checkHistories;
  133.     }
  134.     public function addCheckHistory(CheckHistory $checkHistory): self
  135.     {
  136.         if (!$this->checkHistories->contains($checkHistory)) {
  137.             $this->checkHistories[] = $checkHistory;
  138.             $checkHistory->setBrandDomain($this);
  139.         }
  140.         return $this;
  141.     }
  142.     public function removeCheckHistory(CheckHistory $checkHistory): self
  143.     {
  144.         if ($this->checkHistories->removeElement($checkHistory)) {
  145.             // set the owning side to null (unless already changed)
  146.             if ($checkHistory->getBrandDomain() === $this) {
  147.                 $checkHistory->setBrandDomain(null);
  148.             }
  149.         }
  150.         return $this;
  151.     }
  152.     public function getBrand(): ?Brand
  153.     {
  154.         return $this->brand;
  155.     }
  156.     public function setBrand(?Brand $brand): self
  157.     {
  158.         $this->brand $brand;
  159.         return $this;
  160.     }
  161.     public function getSuspiciousDomain(): ?SuspiciousDomain
  162.     {
  163.         return $this->suspiciousDomain;
  164.     }
  165.     public function setSuspiciousDomain(?SuspiciousDomain $suspiciousDomain): self
  166.     {
  167.         $this->suspiciousDomain $suspiciousDomain;
  168.         return $this;
  169.     }
  170.     public function getKeyword(): ?Keyword
  171.     {
  172.         return $this->keyword;
  173.     }
  174.     public function setKeyword(?Keyword $keyword): self
  175.     {
  176.         $this->keyword $keyword;
  177.         return $this;
  178.     }
  179. }