src/Entity/Brand.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\BrandRepository")
  8.  * @ORM\Table(name="brands", indexes={@ORM\Index(name="id_index", columns={"id"})})
  9.  */
  10. class Brand
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\Column(type="integer")
  15.      * @ORM\GeneratedValue(strategy="AUTO")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=255, nullable=false)
  20.      */
  21.     private $name;
  22.     /**
  23.      * @ORM\Column(type="string", length=150, nullable=true)
  24.      */
  25.     private $twitter;
  26.     /**
  27.      * @ORM\Column(type="string", length=320, nullable=true)
  28.      */
  29.     private $email;
  30.     /**
  31.      * @ORM\Column(type="string", length=30, nullable=true)
  32.      */
  33.     private $pushover_group_api_key;
  34.     /**
  35.      * @ORM\Column(type="boolean", nullable=false)
  36.      */
  37.     private $status;
  38.     /**
  39.      * @ORM\OneToMany(targetEntity="App\Entity\Keyword", mappedBy="brand")
  40.      */
  41.     private $keywords;
  42.     /**
  43.      * @ORM\OneToMany(targetEntity="App\Entity\Setting", mappedBy="brand")
  44.      */
  45.     private $settings;
  46.     /**
  47.      * @ORM\OneToMany(targetEntity="App\Entity\BrandDomain", mappedBy="brand")
  48.      */
  49.     private $brandDomains;
  50.     /**
  51.      * @ORM\OneToMany(targetEntity="App\Entity\Page", mappedBy="brand")
  52.      */
  53.     private $pages;
  54.     /**
  55.      * @ORM\OneToMany(targetEntity="App\Entity\CheckNuked", mappedBy="brand")
  56.      */
  57.     private $checkNukeds;
  58.     /**
  59.      * @ORM\ManyToOne(targetEntity="App\Entity\Customer", inversedBy="brands")
  60.      * @ORM\JoinColumn(name="customer_id", referencedColumnName="id", nullable=false)
  61.      */
  62.     private $customer;
  63.     /**
  64.      * @ORM\ManyToMany(targetEntity="App\Entity\CheckType", inversedBy="brands")
  65.      * @ORM\JoinTable(
  66.      *     name="check_types_brands",
  67.      *     joinColumns={@ORM\JoinColumn(name="brand_id", referencedColumnName="id", nullable=false)},
  68.      *     inverseJoinColumns={@ORM\JoinColumn(name="check_type_id", referencedColumnName="id", nullable=false)}
  69.      * )
  70.      */
  71.     private $checkTypes;
  72.     public function __construct()
  73.     {
  74.         $this->keywords = new ArrayCollection();
  75.         $this->settings = new ArrayCollection();
  76.         $this->brandDomains = new ArrayCollection();
  77.         $this->pages = new ArrayCollection();
  78.         $this->checkNukeds = new ArrayCollection();
  79.         $this->checkTypes = new ArrayCollection();
  80.     }
  81.     public function getId(): ?int
  82.     {
  83.         return $this->id;
  84.     }
  85.     public function getName(): ?string
  86.     {
  87.         return $this->name;
  88.     }
  89.     public function setName(string $name): self
  90.     {
  91.         $this->name $name;
  92.         return $this;
  93.     }
  94.     public function getTwitter(): ?string
  95.     {
  96.         return $this->twitter;
  97.     }
  98.     public function setTwitter(?string $twitter): self
  99.     {
  100.         $this->twitter $twitter;
  101.         return $this;
  102.     }
  103.     public function getEmail(): ?string
  104.     {
  105.         return $this->email;
  106.     }
  107.     public function setEmail(?string $email): self
  108.     {
  109.         $this->email $email;
  110.         return $this;
  111.     }
  112.     public function getPushoverGroupApiKey(): ?string
  113.     {
  114.         return $this->pushover_group_api_key;
  115.     }
  116.     public function setPushoverGroupApiKey(?string $pushover_group_api_key): self
  117.     {
  118.         $this->pushover_group_api_key $pushover_group_api_key;
  119.         return $this;
  120.     }
  121.     public function getStatus(): ?bool
  122.     {
  123.         return $this->status;
  124.     }
  125.     public function setStatus(bool $status): self
  126.     {
  127.         $this->status $status;
  128.         return $this;
  129.     }
  130.     /**
  131.      * @return Collection<int, Keyword>
  132.      */
  133.     public function getKeywords(): Collection
  134.     {
  135.         return $this->keywords;
  136.     }
  137.     public function addKeyword(Keyword $keyword): self
  138.     {
  139.         if (!$this->keywords->contains($keyword)) {
  140.             $this->keywords[] = $keyword;
  141.             $keyword->setBrand($this);
  142.         }
  143.         return $this;
  144.     }
  145.     public function removeKeyword(Keyword $keyword): self
  146.     {
  147.         if ($this->keywords->removeElement($keyword)) {
  148.             // set the owning side to null (unless already changed)
  149.             if ($keyword->getBrand() === $this) {
  150.                 $keyword->setBrand(null);
  151.             }
  152.         }
  153.         return $this;
  154.     }
  155.     /**
  156.      * @return Collection<int, Setting>
  157.      */
  158.     public function getSettings(): Collection
  159.     {
  160.         return $this->settings;
  161.     }
  162.     public function addSetting(Setting $setting): self
  163.     {
  164.         if (!$this->settings->contains($setting)) {
  165.             $this->settings[] = $setting;
  166.             $setting->setBrand($this);
  167.         }
  168.         return $this;
  169.     }
  170.     public function removeSetting(Setting $setting): self
  171.     {
  172.         if ($this->settings->removeElement($setting)) {
  173.             // set the owning side to null (unless already changed)
  174.             if ($setting->getBrand() === $this) {
  175.                 $setting->setBrand(null);
  176.             }
  177.         }
  178.         return $this;
  179.     }
  180.     /**
  181.      * @return Collection<int, BrandDomain>
  182.      */
  183.     public function getBrandDomains(): Collection
  184.     {
  185.         return $this->brandDomains;
  186.     }
  187.     public function addBrandDomain(BrandDomain $brandDomain): self
  188.     {
  189.         if (!$this->brandDomains->contains($brandDomain)) {
  190.             $this->brandDomains[] = $brandDomain;
  191.             $brandDomain->setBrand($this);
  192.         }
  193.         return $this;
  194.     }
  195.     public function removeBrandDomain(BrandDomain $brandDomain): self
  196.     {
  197.         if ($this->brandDomains->removeElement($brandDomain)) {
  198.             // set the owning side to null (unless already changed)
  199.             if ($brandDomain->getBrand() === $this) {
  200.                 $brandDomain->setBrand(null);
  201.             }
  202.         }
  203.         return $this;
  204.     }
  205.     /**
  206.      * @return Collection<int, Page>
  207.      */
  208.     public function getPages(): Collection
  209.     {
  210.         return $this->pages;
  211.     }
  212.     public function addPage(Page $page): self
  213.     {
  214.         if (!$this->pages->contains($page)) {
  215.             $this->pages[] = $page;
  216.             $page->setBrand($this);
  217.         }
  218.         return $this;
  219.     }
  220.     public function removePage(Page $page): self
  221.     {
  222.         if ($this->pages->removeElement($page)) {
  223.             // set the owning side to null (unless already changed)
  224.             if ($page->getBrand() === $this) {
  225.                 $page->setBrand(null);
  226.             }
  227.         }
  228.         return $this;
  229.     }
  230.     /**
  231.      * @return Collection<int, CheckNuked>
  232.      */
  233.     public function getCheckNukeds(): Collection
  234.     {
  235.         return $this->checkNukeds;
  236.     }
  237.     public function addCheckNuked(CheckNuked $checkNuked): self
  238.     {
  239.         if (!$this->checkNukeds->contains($checkNuked)) {
  240.             $this->checkNukeds[] = $checkNuked;
  241.             $checkNuked->setBrand($this);
  242.         }
  243.         return $this;
  244.     }
  245.     public function removeCheckNuked(CheckNuked $checkNuked): self
  246.     {
  247.         if ($this->checkNukeds->removeElement($checkNuked)) {
  248.             // set the owning side to null (unless already changed)
  249.             if ($checkNuked->getBrand() === $this) {
  250.                 $checkNuked->setBrand(null);
  251.             }
  252.         }
  253.         return $this;
  254.     }
  255.     public function getCustomer(): ?Customer
  256.     {
  257.         return $this->customer;
  258.     }
  259.     public function setCustomer(?Customer $customer): self
  260.     {
  261.         $this->customer $customer;
  262.         return $this;
  263.     }
  264.     /**
  265.      * @return Collection<int, CheckType>
  266.      */
  267.     public function getCheckTypes(): Collection
  268.     {
  269.         return $this->checkTypes;
  270.     }
  271.     public function addCheckType(CheckType $checkType): self
  272.     {
  273.         if (!$this->checkTypes->contains($checkType)) {
  274.             $this->checkTypes[] = $checkType;
  275.         }
  276.         return $this;
  277.     }
  278.     public function removeCheckType(CheckType $checkType): self
  279.     {
  280.         $this->checkTypes->removeElement($checkType);
  281.         return $this;
  282.     }
  283. }