<?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\CustomerRepository")
* @ORM\Table(name="customers", indexes={@ORM\Index(name="id_index", columns={"id"})})
*/
class Customer
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\Column(type="string", length=255, nullable=false)
*/
private $name;
/**
* @ORM\Column(type="boolean", nullable=false)
*/
private $status;
/**
* @ORM\Column(type="integer", nullable=false)
*/
private $number_of_brands_allowed;
/**
* @ORM\Column(type="integer", nullable=false)
*/
private $number_of_keywords_per_brand_allowed;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Brand", mappedBy="customer")
*/
private $brands;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Setting", mappedBy="customer")
*/
private $settings;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Smtp", mappedBy="customer")
*/
private $smtps;
/**
* @ORM\OneToMany(targetEntity="App\Entity\UserCustomer", mappedBy="customer")
*/
private $userCustomers;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Profile", mappedBy="customer")
*/
private $profiles;
/**
* @ORM\ManyToMany(targetEntity="App\Entity\CheckType", inversedBy="customers")
* @ORM\JoinTable(
* name="check_types_customers",
* joinColumns={@ORM\JoinColumn(name="customer_id", referencedColumnName="id", nullable=false)},
* inverseJoinColumns={@ORM\JoinColumn(name="check_type_id", referencedColumnName="id", nullable=false)}
* )
*/
private $checkTypes;
public function __construct()
{
$this->brands = new ArrayCollection();
$this->settings = new ArrayCollection();
$this->smtps = new ArrayCollection();
$this->userCustomers = new ArrayCollection();
$this->profiles = new ArrayCollection();
$this->checkTypes = 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 getStatus(): ?bool
{
return $this->status;
}
public function setStatus(bool $status): self
{
$this->status = $status;
return $this;
}
public function getNumberOfBrandsAllowed(): ?int
{
return $this->number_of_brands_allowed;
}
public function setNumberOfBrandsAllowed(int $number_of_brands_allowed): self
{
$this->number_of_brands_allowed = $number_of_brands_allowed;
return $this;
}
public function getNumberOfKeywordsPerBrandAllowed(): ?int
{
return $this->number_of_keywords_per_brand_allowed;
}
public function setNumberOfKeywordsPerBrandAllowed(int $number_of_keywords_per_brand_allowed): self
{
$this->number_of_keywords_per_brand_allowed = $number_of_keywords_per_brand_allowed;
return $this;
}
/**
* @return Collection<int, Brand>
*/
public function getBrands(): Collection
{
return $this->brands;
}
public function addBrand(Brand $brand): self
{
if (!$this->brands->contains($brand)) {
$this->brands[] = $brand;
$brand->setCustomer($this);
}
return $this;
}
public function removeBrand(Brand $brand): self
{
if ($this->brands->removeElement($brand)) {
// set the owning side to null (unless already changed)
if ($brand->getCustomer() === $this) {
$brand->setCustomer(null);
}
}
return $this;
}
/**
* @return Collection<int, Setting>
*/
public function getSettings(): Collection
{
return $this->settings;
}
public function addSetting(Setting $setting): self
{
if (!$this->settings->contains($setting)) {
$this->settings[] = $setting;
$setting->setCustomer($this);
}
return $this;
}
public function removeSetting(Setting $setting): self
{
if ($this->settings->removeElement($setting)) {
// set the owning side to null (unless already changed)
if ($setting->getCustomer() === $this) {
$setting->setCustomer(null);
}
}
return $this;
}
/**
* @return Collection<int, Smtp>
*/
public function getSmtps(): Collection
{
return $this->smtps;
}
public function addSmtp(Smtp $smtp): self
{
if (!$this->smtps->contains($smtp)) {
$this->smtps[] = $smtp;
$smtp->setCustomer($this);
}
return $this;
}
public function removeSmtp(Smtp $smtp): self
{
if ($this->smtps->removeElement($smtp)) {
// set the owning side to null (unless already changed)
if ($smtp->getCustomer() === $this) {
$smtp->setCustomer(null);
}
}
return $this;
}
/**
* @return Collection<int, UserCustomer>
*/
public function getUserCustomers(): Collection
{
return $this->userCustomers;
}
public function addUserCustomer(UserCustomer $userCustomer): self
{
if (!$this->userCustomers->contains($userCustomer)) {
$this->userCustomers[] = $userCustomer;
$userCustomer->setCustomer($this);
}
return $this;
}
public function removeUserCustomer(UserCustomer $userCustomer): self
{
if ($this->userCustomers->removeElement($userCustomer)) {
// set the owning side to null (unless already changed)
if ($userCustomer->getCustomer() === $this) {
$userCustomer->setCustomer(null);
}
}
return $this;
}
/**
* @return Collection<int, Profile>
*/
public function getProfiles(): Collection
{
return $this->profiles;
}
public function addProfile(Profile $profile): self
{
if (!$this->profiles->contains($profile)) {
$this->profiles[] = $profile;
$profile->setCustomer($this);
}
return $this;
}
public function removeProfile(Profile $profile): self
{
if ($this->profiles->removeElement($profile)) {
// set the owning side to null (unless already changed)
if ($profile->getCustomer() === $this) {
$profile->setCustomer(null);
}
}
return $this;
}
/**
* @return Collection<int, CheckType>
*/
public function getCheckTypes(): Collection
{
return $this->checkTypes;
}
public function addCheckType(CheckType $checkType): self
{
if (!$this->checkTypes->contains($checkType)) {
$this->checkTypes[] = $checkType;
}
return $this;
}
public function removeCheckType(CheckType $checkType): self
{
$this->checkTypes->removeElement($checkType);
return $this;
}
}