src/Entity/BillingCenter.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\BillingCenterRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassBillingCenterRepository::class)]
  8. class BillingCenter
  9. {
  10.     use IdentifiableTrait;
  11.     #[ORM\Column(length255)]
  12.     private ?string $code null;
  13.     #[ORM\Column(length255)]
  14.     private ?string $name null;
  15.     #[ORM\Column(length255)]
  16.     private ?string $slug null;
  17.     #[ORM\Column]
  18.     private ?bool $active null;
  19.     #[ORM\OneToMany(mappedBy'billingCenter'targetEntityInvoice::class)]
  20.     private Collection $invoices;
  21.     #[ORM\OneToMany(mappedBy'billingCenter'targetEntityPrescriberPoint::class)]
  22.     private Collection $prescriberPoints;
  23.     #[ORM\Column(length20nullabletrue)]
  24.     private ?string $backgroundColor null;
  25.     #[ORM\OneToMany(mappedBy'billingCenter'targetEntityPrescriber::class)]
  26.     private Collection $prescribers;
  27.     #[ORM\Column(nullabletrue)]
  28.     private ?int $codialShopId null;
  29.     #[ORM\Column(length255nullabletrue)]
  30.     private ?string $prestashopUrl null;
  31.     #[ORM\OneToMany(mappedBy'mainBillingCenter'targetEntityCommercial::class)]
  32.     private Collection $commercials;
  33.     public function __construct()
  34.     {
  35.         $this->invoices         = new ArrayCollection();
  36.         $this->prescriberPoints = new ArrayCollection();
  37.         $this->prescribers      = new ArrayCollection();
  38.         $this->commercials      = new ArrayCollection();
  39.     }
  40.     public function __toString(): string
  41.     {
  42.         return $this->getName();
  43.     }
  44.     public function getId(): ?int
  45.     {
  46.         return $this->id;
  47.     }
  48.     public function getCode(): ?string
  49.     {
  50.         return $this->code;
  51.     }
  52.     public function setCode(string $code): self
  53.     {
  54.         $this->code $code;
  55.         return $this;
  56.     }
  57.     public function getName(): ?string
  58.     {
  59.         return $this->name;
  60.     }
  61.     public function setName(string $name): self
  62.     {
  63.         $this->name $name;
  64.         return $this;
  65.     }
  66.     public function getSlug(): ?string
  67.     {
  68.         return $this->slug;
  69.     }
  70.     public function setSlug(string $slug): self
  71.     {
  72.         $this->slug $slug;
  73.         return $this;
  74.     }
  75.     public function isActive(): ?bool
  76.     {
  77.         return $this->active;
  78.     }
  79.     public function setActive(bool $active): self
  80.     {
  81.         $this->active $active;
  82.         return $this;
  83.     }
  84.     /**
  85.      * @return Collection<int, Invoice>
  86.      */
  87.     public function getInvoices(): Collection
  88.     {
  89.         return $this->invoices;
  90.     }
  91.     public function addInvoice(Invoice $invoice): self
  92.     {
  93.         if (!$this->invoices->contains($invoice)) {
  94.             $this->invoices->add($invoice);
  95.             $invoice->setBillingCenter($this);
  96.         }
  97.         return $this;
  98.     }
  99.     public function removeInvoice(Invoice $invoice): self
  100.     {
  101.         if ($this->invoices->removeElement($invoice)) {
  102.             // set the owning side to null (unless already changed)
  103.             if ($invoice->getBillingCenter() === $this) {
  104.                 $invoice->setBillingCenter(null);
  105.             }
  106.         }
  107.         return $this;
  108.     }
  109.     /**
  110.      * @return Collection<int, PrescriberPoint>
  111.      */
  112.     public function getPrescriberPoints(): Collection
  113.     {
  114.         return $this->prescriberPoints;
  115.     }
  116.     public function addPrescriberPoint(PrescriberPoint $prescriberPoint): self
  117.     {
  118.         if (!$this->prescriberPoints->contains($prescriberPoint)) {
  119.             $this->prescriberPoints->add($prescriberPoint);
  120.             $prescriberPoint->setBillingCenter($this);
  121.         }
  122.         return $this;
  123.     }
  124.     public function removePrescriberPoint(PrescriberPoint $prescriberPoint): self
  125.     {
  126.         if ($this->prescriberPoints->removeElement($prescriberPoint)) {
  127.             // set the owning side to null (unless already changed)
  128.             if ($prescriberPoint->getBillingCenter() === $this) {
  129.                 $prescriberPoint->setBillingCenter(null);
  130.             }
  131.         }
  132.         return $this;
  133.     }
  134.     public function getBackgroundColor(): ?string
  135.     {
  136.         return $this->backgroundColor;
  137.     }
  138.     public function setBackgroundColor(?string $backgroundColor): self
  139.     {
  140.         $this->backgroundColor $backgroundColor;
  141.         return $this;
  142.     }
  143.     /**
  144.      * @return Collection<int, Prescriber>
  145.      */
  146.     public function getPrescribers(): Collection
  147.     {
  148.         return $this->prescribers;
  149.     }
  150.     public function addPrescriber(Prescriber $prescriber): self
  151.     {
  152.         if (!$this->prescribers->contains($prescriber)) {
  153.             $this->prescribers->add($prescriber);
  154.             $prescriber->setBillingCenter($this);
  155.         }
  156.         return $this;
  157.     }
  158.     public function removePrescriber(Prescriber $prescriber): self
  159.     {
  160.         if ($this->prescribers->removeElement($prescriber)) {
  161.             // set the owning side to null (unless already changed)
  162.             if ($prescriber->getBillingCenter() === $this) {
  163.                 $prescriber->setBillingCenter(null);
  164.             }
  165.         }
  166.         return $this;
  167.     }
  168.     public function getCodialShopId(): ?int
  169.     {
  170.         return $this->codialShopId;
  171.     }
  172.     public function setCodialShopId(?int $codialShopId): self
  173.     {
  174.         $this->codialShopId $codialShopId;
  175.         return $this;
  176.     }
  177.     public function getPrestashopUrl(): ?string
  178.     {
  179.         return $this->prestashopUrl;
  180.     }
  181.     public function setPrestashopUrl(?string $prestashopUrl): static
  182.     {
  183.         $this->prestashopUrl $prestashopUrl;
  184.         return $this;
  185.     }
  186.     /**
  187.      * @return Collection<int, Commercial>
  188.      */
  189.     public function getCommercials(): Collection
  190.     {
  191.         return $this->commercials;
  192.     }
  193.     public function addCommercial(Commercial $commercial): static
  194.     {
  195.         if (!$this->commercials->contains($commercial)) {
  196.             $this->commercials->add($commercial);
  197.             $commercial->setMainBillingCenter($this);
  198.         }
  199.         return $this;
  200.     }
  201.     public function removeCommercial(Commercial $commercial): static
  202.     {
  203.         if ($this->commercials->removeElement($commercial)) {
  204.             // set the owning side to null (unless already changed)
  205.             if ($commercial->getMainBillingCenter() === $this) {
  206.                 $commercial->setMainBillingCenter(null);
  207.             }
  208.         }
  209.         return $this;
  210.     }
  211. }