src/Entity/Customer.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\CustomerRepository")
  8.  * @ORM\Table(name="customers", indexes={@ORM\Index(name="id_index", columns={"id"})})
  9.  */
  10. class Customer
  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="boolean", nullable=false)
  24.      */
  25.     private $status;
  26.     /**
  27.      * @ORM\Column(type="integer", nullable=false)
  28.      */
  29.     private $number_of_brands_allowed;
  30.     /**
  31.      * @ORM\Column(type="integer", nullable=false)
  32.      */
  33.     private $number_of_keywords_per_brand_allowed;
  34.     /**
  35.      * @ORM\OneToMany(targetEntity="App\Entity\Brand", mappedBy="customer")
  36.      */
  37.     private $brands;
  38.     /**
  39.      * @ORM\OneToMany(targetEntity="App\Entity\Setting", mappedBy="customer")
  40.      */
  41.     private $settings;
  42.     /**
  43.      * @ORM\OneToMany(targetEntity="App\Entity\Smtp", mappedBy="customer")
  44.      */
  45.     private $smtps;
  46.     /**
  47.      * @ORM\OneToMany(targetEntity="App\Entity\UserCustomer", mappedBy="customer")
  48.      */
  49.     private $userCustomers;
  50.     /**
  51.      * @ORM\OneToMany(targetEntity="App\Entity\Profile", mappedBy="customer")
  52.      */
  53.     private $profiles;
  54.     /**
  55.      * @ORM\ManyToMany(targetEntity="App\Entity\CheckType", inversedBy="customers")
  56.      * @ORM\JoinTable(
  57.      *     name="check_types_customers",
  58.      *     joinColumns={@ORM\JoinColumn(name="customer_id", referencedColumnName="id", nullable=false)},
  59.      *     inverseJoinColumns={@ORM\JoinColumn(name="check_type_id", referencedColumnName="id", nullable=false)}
  60.      * )
  61.      */
  62.     private $checkTypes;
  63.     public function __construct()
  64.     {
  65.         $this->brands = new ArrayCollection();
  66.         $this->settings = new ArrayCollection();
  67.         $this->smtps = new ArrayCollection();
  68.         $this->userCustomers = new ArrayCollection();
  69.         $this->profiles = new ArrayCollection();
  70.         $this->checkTypes = new ArrayCollection();
  71.     }
  72.     public function getId(): ?int
  73.     {
  74.         return $this->id;
  75.     }
  76.     public function getName(): ?string
  77.     {
  78.         return $this->name;
  79.     }
  80.     public function setName(string $name): self
  81.     {
  82.         $this->name $name;
  83.         return $this;
  84.     }
  85.     public function getStatus(): ?bool
  86.     {
  87.         return $this->status;
  88.     }
  89.     public function setStatus(bool $status): self
  90.     {
  91.         $this->status $status;
  92.         return $this;
  93.     }
  94.     public function getNumberOfBrandsAllowed(): ?int
  95.     {
  96.         return $this->number_of_brands_allowed;
  97.     }
  98.     public function setNumberOfBrandsAllowed(int $number_of_brands_allowed): self
  99.     {
  100.         $this->number_of_brands_allowed $number_of_brands_allowed;
  101.         return $this;
  102.     }
  103.     public function getNumberOfKeywordsPerBrandAllowed(): ?int
  104.     {
  105.         return $this->number_of_keywords_per_brand_allowed;
  106.     }
  107.     public function setNumberOfKeywordsPerBrandAllowed(int $number_of_keywords_per_brand_allowed): self
  108.     {
  109.         $this->number_of_keywords_per_brand_allowed $number_of_keywords_per_brand_allowed;
  110.         return $this;
  111.     }
  112.     /**
  113.      * @return Collection<int, Brand>
  114.      */
  115.     public function getBrands(): Collection
  116.     {
  117.         return $this->brands;
  118.     }
  119.     public function addBrand(Brand $brand): self
  120.     {
  121.         if (!$this->brands->contains($brand)) {
  122.             $this->brands[] = $brand;
  123.             $brand->setCustomer($this);
  124.         }
  125.         return $this;
  126.     }
  127.     public function removeBrand(Brand $brand): self
  128.     {
  129.         if ($this->brands->removeElement($brand)) {
  130.             // set the owning side to null (unless already changed)
  131.             if ($brand->getCustomer() === $this) {
  132.                 $brand->setCustomer(null);
  133.             }
  134.         }
  135.         return $this;
  136.     }
  137.     /**
  138.      * @return Collection<int, Setting>
  139.      */
  140.     public function getSettings(): Collection
  141.     {
  142.         return $this->settings;
  143.     }
  144.     public function addSetting(Setting $setting): self
  145.     {
  146.         if (!$this->settings->contains($setting)) {
  147.             $this->settings[] = $setting;
  148.             $setting->setCustomer($this);
  149.         }
  150.         return $this;
  151.     }
  152.     public function removeSetting(Setting $setting): self
  153.     {
  154.         if ($this->settings->removeElement($setting)) {
  155.             // set the owning side to null (unless already changed)
  156.             if ($setting->getCustomer() === $this) {
  157.                 $setting->setCustomer(null);
  158.             }
  159.         }
  160.         return $this;
  161.     }
  162.     /**
  163.      * @return Collection<int, Smtp>
  164.      */
  165.     public function getSmtps(): Collection
  166.     {
  167.         return $this->smtps;
  168.     }
  169.     public function addSmtp(Smtp $smtp): self
  170.     {
  171.         if (!$this->smtps->contains($smtp)) {
  172.             $this->smtps[] = $smtp;
  173.             $smtp->setCustomer($this);
  174.         }
  175.         return $this;
  176.     }
  177.     public function removeSmtp(Smtp $smtp): self
  178.     {
  179.         if ($this->smtps->removeElement($smtp)) {
  180.             // set the owning side to null (unless already changed)
  181.             if ($smtp->getCustomer() === $this) {
  182.                 $smtp->setCustomer(null);
  183.             }
  184.         }
  185.         return $this;
  186.     }
  187.     /**
  188.      * @return Collection<int, UserCustomer>
  189.      */
  190.     public function getUserCustomers(): Collection
  191.     {
  192.         return $this->userCustomers;
  193.     }
  194.     public function addUserCustomer(UserCustomer $userCustomer): self
  195.     {
  196.         if (!$this->userCustomers->contains($userCustomer)) {
  197.             $this->userCustomers[] = $userCustomer;
  198.             $userCustomer->setCustomer($this);
  199.         }
  200.         return $this;
  201.     }
  202.     public function removeUserCustomer(UserCustomer $userCustomer): self
  203.     {
  204.         if ($this->userCustomers->removeElement($userCustomer)) {
  205.             // set the owning side to null (unless already changed)
  206.             if ($userCustomer->getCustomer() === $this) {
  207.                 $userCustomer->setCustomer(null);
  208.             }
  209.         }
  210.         return $this;
  211.     }
  212.     /**
  213.      * @return Collection<int, Profile>
  214.      */
  215.     public function getProfiles(): Collection
  216.     {
  217.         return $this->profiles;
  218.     }
  219.     public function addProfile(Profile $profile): self
  220.     {
  221.         if (!$this->profiles->contains($profile)) {
  222.             $this->profiles[] = $profile;
  223.             $profile->setCustomer($this);
  224.         }
  225.         return $this;
  226.     }
  227.     public function removeProfile(Profile $profile): self
  228.     {
  229.         if ($this->profiles->removeElement($profile)) {
  230.             // set the owning side to null (unless already changed)
  231.             if ($profile->getCustomer() === $this) {
  232.                 $profile->setCustomer(null);
  233.             }
  234.         }
  235.         return $this;
  236.     }
  237.     /**
  238.      * @return Collection<int, CheckType>
  239.      */
  240.     public function getCheckTypes(): Collection
  241.     {
  242.         return $this->checkTypes;
  243.     }
  244.     public function addCheckType(CheckType $checkType): self
  245.     {
  246.         if (!$this->checkTypes->contains($checkType)) {
  247.             $this->checkTypes[] = $checkType;
  248.         }
  249.         return $this;
  250.     }
  251.     public function removeCheckType(CheckType $checkType): self
  252.     {
  253.         $this->checkTypes->removeElement($checkType);
  254.         return $this;
  255.     }
  256. }