src/Entity/Client.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ClientRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=ClientRepository::class)
  9.  */
  10. class Client
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=255)
  20.      */
  21.     private $code;
  22.     /**
  23.      * @ORM\Column(type="string", length=255)
  24.      */
  25.     private $name;
  26.     /**
  27.      * @ORM\Column(type="string", length=255, nullable=true)
  28.      */
  29.     private $themeCss;
  30.     /**
  31.      * @ORM\Column(type="string", length=255, nullable=true)
  32.      */
  33.     private $banner;
  34.     /**
  35.      * @ORM\Column(type="string", length=255)
  36.      */
  37.     private $idOrg;
  38.     /**
  39.      * @ORM\OneToMany(targetEntity=Projet::class, mappedBy="client")
  40.      */
  41.     private $projets;
  42.     /**
  43.      * @ORM\OneToMany(targetEntity=ClientProduit::class, mappedBy="client")
  44.      */
  45.     private $clientProduits;
  46.     /**
  47.      * @ORM\OneToMany(targetEntity=Subscriber::class, mappedBy="client")
  48.      */
  49.     private $subscribers;
  50.     /**
  51.      * @ORM\OneToMany(targetEntity=Groupe::class, mappedBy="client")
  52.      */
  53.     private $groupes;
  54.     public function __construct()
  55.     {
  56.         $this->projets = new ArrayCollection();
  57.         $this->clientProduits = new ArrayCollection();
  58.         $this->subscribers = new ArrayCollection();
  59.         $this->groupes = new ArrayCollection();
  60.     }
  61.     public function getId(): ?int
  62.     {
  63.         return $this->id;
  64.     }
  65.     public function getCode(): ?string
  66.     {
  67.         return $this->code;
  68.     }
  69.     public function setCode(string $code): self
  70.     {
  71.         $this->code $code;
  72.         return $this;
  73.     }
  74.     public function getName(): ?string
  75.     {
  76.         return $this->name;
  77.     }
  78.     public function setName(string $name): self
  79.     {
  80.         $this->name $name;
  81.         return $this;
  82.     }
  83.     public function getThemeCss(): ?string
  84.     {
  85.         return $this->themeCss;
  86.     }
  87.     public function setThemeCss(?string $themeCss): self
  88.     {
  89.         $this->themeCss $themeCss;
  90.         return $this;
  91.     }
  92.     public function getBanner(): ?string
  93.     {
  94.         return $this->banner;
  95.     }
  96.     public function setBanner(?string $banner): self
  97.     {
  98.         $this->banner $banner;
  99.         return $this;
  100.     }
  101.     public function getIdOrg(): ?string
  102.     {
  103.         return $this->idOrg;
  104.     }
  105.     public function setIdOrg(string $idOrg): self
  106.     {
  107.         $this->idOrg $idOrg;
  108.         return $this;
  109.     }
  110.     /**
  111.      * @return Collection|Projet[]
  112.      */
  113.     public function getProjets(): Collection
  114.     {
  115.         return $this->projets;
  116.     }
  117.     public function addProjet(Projet $projet): self
  118.     {
  119.         if (!$this->projets->contains($projet)) {
  120.             $this->projets[] = $projet;
  121.             $projet->setClient($this);
  122.         }
  123.         return $this;
  124.     }
  125.     public function removeProjet(Projet $projet): self
  126.     {
  127.         if ($this->projets->removeElement($projet)) {
  128.             // set the owning side to null (unless already changed)
  129.             if ($projet->getClient() === $this) {
  130.                 $projet->setClient(null);
  131.             }
  132.         }
  133.         return $this;
  134.     }
  135.     /**
  136.      * @return Collection|ClientProduit[]
  137.      */
  138.     public function getClientProduits(): Collection
  139.     {
  140.         return $this->clientProduits;
  141.     }
  142.     public function addClientProduit(ClientProduit $clientProduit): self
  143.     {
  144.         if (!$this->clientProduits->contains($clientProduit)) {
  145.             $this->clientProduits[] = $clientProduit;
  146.             $clientProduit->setClient($this);
  147.         }
  148.         return $this;
  149.     }
  150.     public function removeClientProduit(ClientProduit $clientProduit): self
  151.     {
  152.         if ($this->clientProduits->removeElement($clientProduit)) {
  153.             // set the owning side to null (unless already changed)
  154.             if ($clientProduit->getClient() === $this) {
  155.                 $clientProduit->setClient(null);
  156.             }
  157.         }
  158.         return $this;
  159.     }
  160.     /**
  161.      * @return Collection|Subscriber[]
  162.      */
  163.     public function getSubscribers(): Collection
  164.     {
  165.         return $this->subscribers;
  166.     }
  167.     public function addSubscriber(Subscriber $subscriber): self
  168.     {
  169.         if (!$this->subscribers->contains($subscriber)) {
  170.             $this->subscribers[] = $subscriber;
  171.             $subscriber->setClient($this);
  172.         }
  173.         return $this;
  174.     }
  175.     public function removeSubscriber(Subscriber $subscriber): self
  176.     {
  177.         if ($this->subscribers->removeElement($subscriber)) {
  178.             // set the owning side to null (unless already changed)
  179.             if ($subscriber->getClient() === $this) {
  180.                 $subscriber->setClient(null);
  181.             }
  182.         }
  183.         return $this;
  184.     }
  185.     /**
  186.      * @return Collection|Groupe[]
  187.      */
  188.     public function getGroupes(): Collection
  189.     {
  190.         return $this->groupes;
  191.     }
  192.     public function addGroupe(Groupe $groupe): self
  193.     {
  194.         if (!$this->groupes->contains($groupe)) {
  195.             $this->groupes[] = $groupe;
  196.             $groupe->setClient($this);
  197.         }
  198.         return $this;
  199.     }
  200.     public function removeGroupe(Groupe $groupe): self
  201.     {
  202.         if ($this->groupes->removeElement($groupe)) {
  203.             // set the owning side to null (unless already changed)
  204.             if ($groupe->getClient() === $this) {
  205.                 $groupe->setClient(null);
  206.             }
  207.         }
  208.         return $this;
  209.     }
  210. }