src/Entity/CRM/Branch.php line 19

  1. <?php
  2. namespace App\Entity\CRM;
  3. use App\Entity\CRM\Notification;
  4. use App\Entity\CRM\Order;
  5. use App\Entity\CRM\Product;
  6. use App\Entity\CRM\Room;
  7. use App\Entity\CRM\Worker;
  8. use App\Entity\CRM\ZoomMeeting;
  9. use App\Entity\CRM\NumberBlocking;
  10. use App\Repository\BranchRepository;
  11. use Doctrine\Common\Collections\ArrayCollection;
  12. use Doctrine\Common\Collections\Collection;
  13. use Doctrine\DBAL\Types\Types;
  14. use Doctrine\ORM\Mapping as ORM;
  15. #[ORM\Entity(repositoryClassBranchRepository::class)]
  16. class Branch
  17. {
  18.     #[ORM\Id]
  19.     #[ORM\GeneratedValue]
  20.     #[ORM\Column]
  21.     private ?int $id null;
  22.     #[ORM\Column(length255)]
  23.     private ?string $name null;
  24.     #[ORM\Column(length255nullabletrue)]
  25.     private ?string $address null;
  26.     #[ORM\Column]
  27.     private ?bool $isActive null;
  28.     #[ORM\ManyToMany(targetEntityAdmin::class,mappedBy'branches')]
  29.     private Collection $admins;
  30.     #[ORM\OneToMany(mappedBy'branch'targetEntityDepartment::class, orphanRemovaltrue)]
  31.     private Collection $departments;
  32.     #[ORM\OneToMany(mappedBy'branch'targetEntityWorker::class)]
  33.     private Collection $workers;
  34.     #[ORM\OneToOne(mappedBy'branch'cascade: ['persist''remove'])]
  35.     private ?MailConfig $mailConfig null;
  36.     #[ORM\OneToMany(mappedBy'branch'targetEntityOrder::class)]
  37.     private Collection $orders;
  38.     #[ORM\OneToMany(mappedBy'branch'targetEntityRoom::class, orphanRemovaltrue)]
  39.     private Collection $rooms;
  40.     #[ORM\Column(length9)]
  41.     private ?string $regon null;
  42.     #[ORM\Column(length10)]
  43.     private ?string $nip null;
  44.     #[ORM\OneToOne(mappedBy'branch'cascade: ['persist''remove'])]
  45.     private ?BranchConfig $branchConfig null;
  46.     #[ORM\OneToMany(mappedBy'branch'targetEntityBhpOrderProduct::class)]
  47.     private Collection $BhpOrderProducts;
  48.     #[ORM\Column(length255nullabletrue)]
  49.     private ?string $wdrozeniaMail null;
  50.     #[ORM\Column(length255nullabletrue)]
  51.     private ?string $wdrozeniaMailPassword null;
  52.     #[ORM\Column(typeTypes::ARRAY, nullabletrue)]
  53.     private ?array $contractSignedMail = [];
  54.     #[ORM\Column]
  55.     private ?int $platformaOddzialId null;
  56.     #[ORM\OneToMany(mappedBy'branch'targetEntityCommercialOfferIndividual::class)]
  57.     private Collection $commercialOfferIndividuals;
  58.     #[ORM\Column(length255)]
  59.     private ?string $color null;
  60.     #[ORM\OneToMany(mappedBy'branch'targetEntityNotification::class)]
  61.     private Collection $notifications;
  62.     #[ORM\Column(typeTypes::JSONnullabletrue)]
  63.     private ?array $bhpMail null;
  64.     #[ORM\Column(length255nullabletrue)]
  65.     private ?string $phone null;
  66.     #[ORM\ManyToMany(targetEntityAdmin::class)]
  67.     private Collection $adminHr;
  68.     #[ORM\ManyToMany(targetEntityZoomMeeting::class, mappedBy'branches')]
  69.     private Collection $zoomMeetings;
  70.     #[ORM\Column(typeTypes::JSONnullabletrue)]
  71.     private ?array $implementerMailsForAuditReady null;
  72.     #[ORM\Column(typeTypes::JSONnullabletrue)]
  73.     private ?array $orderReturnedMail = [];
  74.     #[ORM\ManyToMany(targetEntityProduct::class)]
  75.     private ?Collection $orderReturnedProducts;
  76.     #[ORM\Column(length255nullabletrue)]
  77.     private ?string $firmName null;
  78.     #[ORM\Column(length20nullabletrue)]
  79.     private ?string $optimaInvoiceSeries null;
  80.     #[ORM\Column(length255nullabletrue)]
  81.     private ?string $sellerName null;
  82.     #[ORM\Column(length255nullabletrue)]
  83.     private ?string $bankName null;
  84.     #[ORM\Column(length255nullabletrue)]
  85.     private ?string $bankAccount null;
  86.     #[ORM\OneToMany(mappedBy'branch'targetEntityNumberBlocking::class)]
  87.     private Collection $numberBlockings;
  88.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  89.     private ?string $addressDataForPlatform null;
  90.     public function __construct()
  91.     {
  92.         $this->admins = new ArrayCollection();
  93.         $this->departments = new ArrayCollection();
  94.         $this->workers = new ArrayCollection();
  95.         $this->rooms = new ArrayCollection();
  96.         $this->orders = new ArrayCollection();
  97.         $this->BhpOrderProducts = new ArrayCollection();
  98.         $this->commercialOfferIndividuals = new ArrayCollection();
  99.         $this->notifications = new ArrayCollection();
  100.         $this->adminHr = new ArrayCollection();
  101.         $this->zoomMeetings = new ArrayCollection();
  102.         $this->orderReturnedProducts = new ArrayCollection();
  103.         $this->numberBlockings = new ArrayCollection();
  104.     }
  105.     public function __toString()
  106.     {
  107.         return $this->name;
  108.     }
  109.     public function getId(): ?int
  110.     {
  111.         return $this->id;
  112.     }
  113.     public function getName(): ?string
  114.     {
  115.         return $this->name;
  116.     }
  117.     public function setName(string $name): self
  118.     {
  119.         $this->name $name;
  120.         return $this;
  121.     }
  122.     public function getAddress(): ?string
  123.     {
  124.         return $this->address;
  125.     }
  126.     public function setAddress(?string $address): self
  127.     {
  128.         $this->address $address;
  129.         return $this;
  130.     }
  131.     public function isIsActive(): ?bool
  132.     {
  133.         return $this->isActive;
  134.     }
  135.     public function setIsActive(bool $isActive): self
  136.     {
  137.         $this->isActive $isActive;
  138.         return $this;
  139.     }
  140.     /**
  141.      * @return Collection|Admin[]
  142.      */
  143.     public function getAdmins(): Collection
  144.     {
  145.         return $this->admins;
  146.     }
  147.     public function addAdmin(Admin $admin): self
  148.     {
  149.         if (!$this->admins->contains($admin)) {
  150.             $this->admins[] = $admin;
  151.         }
  152.         return $this;
  153.     }
  154.     public function removeAdmin(Admin $admin): self
  155.     {
  156.         $this->admins->removeElement($admin);
  157.         return $this;
  158.     }
  159.     public function countAdmins(): int
  160.     {
  161.         return $this->admins->count();
  162.     }
  163.     /**
  164.      * @return Collection<int, Department>
  165.      */
  166.     public function getDepartments(): Collection
  167.     {
  168.         return $this->departments;
  169.     }
  170.     public function addDepartment(Department $department): self
  171.     {
  172.         if (!$this->departments->contains($department)) {
  173.             $this->departments->add($department);
  174.             $department->setBranch($this);
  175.         }
  176.         return $this;
  177.     }
  178.     public function removeDepartment(Department $department): self
  179.     {
  180.         if ($this->departments->removeElement($department)) {
  181.             // set the owning side to null (unless already changed)
  182.             if ($department->getBranch() === $this) {
  183.                 $department->setBranch(null);
  184.             }
  185.         }
  186.         return $this;
  187.     }
  188.     /**
  189.      * @return Collection<int, Worker>
  190.      */
  191.     public function getWorkers(): Collection
  192.     {
  193.         return $this->workers;
  194.     }
  195.     public function addWorker(Worker $worker): self
  196.     {
  197.         if (!$this->workers->contains($worker)) {
  198.             $this->workers->add($worker);
  199.             $worker->setBranch($this);
  200.         }
  201.         return $this;
  202.     }
  203.     public function removeWorker(Worker $worker): self
  204.     {
  205.         if ($this->workers->removeElement($worker)) {
  206.             // set the owning side to null (unless already changed)
  207.             if ($worker->getBranch() === $this) {
  208.                 $worker->setBranch(null);
  209.             }
  210.         }
  211.         return $this;
  212.     }
  213.     public function getMailConfig(): ?MailConfig
  214.     {
  215.         return $this->mailConfig;
  216.     }
  217.     public function setMailConfig(MailConfig $mailConfig): static
  218.     {
  219.         // set the owning side of the relation if necessary
  220.         if ($mailConfig->getBranch() !== $this) {
  221.             $mailConfig->setBranch($this);
  222.         }
  223.         $this->mailConfig $mailConfig;
  224.         return $this;
  225.     }
  226.     /**
  227.      * @return Collection<int, Order>
  228.      */
  229.     public function getOrders(): Collection
  230.     {
  231.         return $this->orders;
  232.     }
  233.     public function addOrder(Order $order): static
  234.     {
  235.         if (!$this->orders->contains($order)) {
  236.             $this->orders->add($order);
  237.             $order->setBranch($this);
  238.         }
  239.         return $this;
  240.     }
  241.     public function removeOrder(Order $order): static
  242.     {
  243.         if ($this->orders->removeElement($order)) {
  244.             // set the owning side to null (unless already changed)
  245.             if ($order->getBranch() === $this) {
  246.                 $order->setBranch(null);
  247.             }
  248.         }
  249.         return $this;
  250.     }
  251.     /**
  252.      * @return Collection<int, Room>
  253.      */
  254.     public function getRooms(): Collection
  255.     {
  256.         return $this->rooms;
  257.     }
  258.     public function addRoom(Room $room): static
  259.     {
  260.         if (!$this->rooms->contains($room)) {
  261.             $this->rooms->add($room);
  262.             $room->setBranch($this);
  263.         }
  264.         return $this;
  265.     }
  266.     public function removeRoom(Room $room): static
  267.     {
  268.         if ($this->rooms->removeElement($room)) {
  269.             // set the owning side to null (unless already changed)
  270.             if ($room->getBranch() === $this) {
  271.                 $room->setBranch(null);
  272.             }
  273.         }
  274.         return $this;
  275.     }
  276.     public function getRegon(): ?string
  277.     {
  278.         return $this->regon;
  279.     }
  280.     public function setRegon(string $regon): static
  281.     {
  282.         $this->regon $regon;
  283.         return $this;
  284.     }
  285.     public function getNip(): ?string
  286.     {
  287.         return $this->nip;
  288.     }
  289.     public function setNip(string $nip): static
  290.     {
  291.         $this->nip $nip;
  292.         return $this;
  293.     }
  294.     /**
  295.      * @param int|null $id
  296.      */
  297.     public function setId(?int $id): void
  298.     {
  299.         $this->id $id;
  300.     }
  301.     public function getBranchConfig(): ?BranchConfig
  302.     {
  303.         return $this->branchConfig;
  304.     }
  305.     public function setBranchConfig(BranchConfig $branchConfig): static
  306.     {
  307.         // set the owning side of the relation if necessary
  308.         if ($branchConfig->getBranch() !== $this) {
  309.             $branchConfig->setBranch($this);
  310.         }
  311.         $this->branchConfig $branchConfig;
  312.         return $this;
  313.     }
  314.     /**
  315.      * @return Collection<int, BhpOrderProduct>
  316.      */
  317.     public function getBhpOrderProducts(): Collection
  318.     {
  319.         return $this->BhpOrderProducts;
  320.     }
  321.     public function addBhpOrderProduct(BhpOrderProduct $BhpOrderProduct): static
  322.     {
  323.         if (!$this->BhpOrderProducts->contains($BhpOrderProduct)) {
  324.             $this->BhpOrderProducts->add($BhpOrderProduct);
  325.             $BhpOrderProduct->setBranch($this);
  326.         }
  327.         return $this;
  328.     }
  329.     public function getWdrozeniaMail(): ?string
  330.     {
  331.         return $this->wdrozeniaMail;
  332.     }
  333.     public function setWdrozeniaMail(?string $wdrozeniaMail): static
  334.     {
  335.         $this->wdrozeniaMail $wdrozeniaMail;
  336.         return $this;
  337.     }
  338.     public function removeBhpOrderProduct(BhpOrderProduct $BhpOrderProduct): static
  339.     {
  340.         if ($this->BhpOrderProducts->removeElement($BhpOrderProduct)) {
  341.             // set the owning side to null (unless already changed)
  342.             if ($BhpOrderProduct->getBranch() === $this) {
  343.                 $BhpOrderProduct->setBranch(null);
  344.             }
  345.         }
  346.         return $this;
  347.     }
  348.     public function getWdrozeniaMailPassword(): ?string
  349.     {
  350.         return $this->wdrozeniaMailPassword;
  351.     }
  352.     public function setWdrozeniaMailPassword(?string $wdrozeniaMailPassword): static
  353.     {
  354.         $this->wdrozeniaMailPassword $wdrozeniaMailPassword;
  355.         return $this;
  356.     }
  357.     public function getContractSignedMail(): array
  358.     {
  359.         return $this->contractSignedMail;
  360.     }
  361.     public function setContractSignedMail(?array $contractSignedMail): static
  362.     {
  363.         $this->contractSignedMail $contractSignedMail;
  364.         return $this;
  365.     }
  366.     public function getPlatformaOddzialId(): ?int
  367.     {
  368.         return $this->platformaOddzialId;
  369.     }
  370.     public function setPlatformaOddzialId(int $platformaOddzialId): static
  371.     {
  372.         $this->platformaOddzialId $platformaOddzialId;
  373.         return $this;
  374.     }
  375.     /**
  376.      * @return Collection<int, CommercialOfferIndividual>
  377.      */
  378.     public function getCommercialOfferIndividuals(): Collection
  379.     {
  380.         return $this->commercialOfferIndividuals;
  381.     }
  382.     public function addCommercialOfferIndividual(CommercialOfferIndividual $commercialOfferIndividual): static
  383.     {
  384.         if (!$this->commercialOfferIndividuals->contains($commercialOfferIndividual)) {
  385.             $this->commercialOfferIndividuals->add($commercialOfferIndividual);
  386.             $commercialOfferIndividual->setBranch($this);
  387.         }
  388.         return $this;
  389.     }
  390.     public function removeCommercialOfferIndividual(CommercialOfferIndividual $commercialOfferIndividual): static
  391.     {
  392.         if ($this->commercialOfferIndividuals->removeElement($commercialOfferIndividual)) {
  393.             // set the owning side to null (unless already changed)
  394.             if ($commercialOfferIndividual->getBranch() === $this) {
  395.                 $commercialOfferIndividual->setBranch(null);
  396.             }
  397.         }
  398.         return $this;
  399.     }
  400.     public function getColor(): ?string
  401.     {
  402.         return $this->color;
  403.     }
  404.     public function setColor(string $color): static
  405.     {
  406.         $this->color $color;
  407.         return $this;
  408.     }
  409.     /**
  410.      * @return Collection<int, Notification>
  411.      */
  412.     public function getNotifications(): Collection
  413.     {
  414.         return $this->notifications;
  415.     }
  416.     public function addNotification(Notification $notification): static
  417.     {
  418.         if (!$this->notifications->contains($notification)) {
  419.             $this->notifications->add($notification);
  420.             $notification->setBranch($this);
  421.         }
  422.         return $this;
  423.     }
  424.     public function removeNotification(Notification $notification): static
  425.     {
  426.         if ($this->notifications->removeElement($notification)) {
  427.             // set the owning side to null (unless already changed)
  428.             if ($notification->getBranch() === $this) {
  429.                 $notification->setBranch(null);
  430.             }
  431.         }
  432.         return $this;
  433.     }
  434.     public function getBhpMail(): ?array
  435.     {
  436.         return $this->bhpMail;
  437.     }
  438.     public function setBhpMail(?array $bhpMail): static
  439.     {
  440.         $this->bhpMail $bhpMail;
  441.         return $this;
  442.     }
  443.     public function getPhone(): ?string
  444.     {
  445.         return $this->phone;
  446.     }
  447.     public function setPhone(?string $phone): static
  448.     {
  449.         $this->phone $phone;
  450.         return $this;
  451.     }
  452.     /**
  453.      * @return Collection<int, Admin>
  454.      */
  455.     public function getAdminHr(): Collection
  456.     {
  457.         return $this->adminHr;
  458.     }
  459.     public function addAdminHr(Admin $adminHr): static
  460.     {
  461.         if (!$this->adminHr->contains($adminHr)) {
  462.             $this->adminHr->add($adminHr);
  463.         }
  464.         return $this;
  465.     }
  466.     public function removeAdminHr(Admin $adminHr): static
  467.     {
  468.         $this->adminHr->removeElement($adminHr);
  469.         return $this;
  470.     }
  471.     /**
  472.      * @return Collection<int, ZoomMeeting>
  473.      */
  474.     public function getZoomMeetings(): Collection
  475.     {
  476.         return $this->zoomMeetings;
  477.     }
  478.     public function addZoomMeeting(ZoomMeeting $zoomMeeting): static
  479.     {
  480.         if (!$this->zoomMeetings->contains($zoomMeeting)) {
  481.             $this->zoomMeetings->add($zoomMeeting);
  482.             $zoomMeeting->addBranch($this);
  483.         }
  484.         return $this;
  485.     }
  486.     public function removeZoomMeeting(ZoomMeeting $zoomMeeting): static
  487.     {
  488.         if ($this->zoomMeetings->removeElement($zoomMeeting)) {
  489.             $zoomMeeting->removeBranch($this);
  490.         }
  491.         return $this;
  492.     }
  493.     public function getImplementerMailsForAuditReady(): ?array
  494.     {
  495.         return $this->implementerMailsForAuditReady;
  496.     }
  497.     public function setImplementerMailsForAuditReady(?array $implementerMailsForAuditReady): static
  498.     {
  499.         $this->implementerMailsForAuditReady $implementerMailsForAuditReady;
  500.         return $this;
  501.     }
  502.     public function getOrderReturnedMail(): ?array
  503.     {
  504.         return $this->orderReturnedMail;
  505.     }
  506.     public function setOrderReturnedMail(?array $orderReturnedMail): static
  507.     {
  508.         $this->orderReturnedMail $orderReturnedMail;
  509.         return $this;
  510.     }
  511.     /**
  512.      * @return Collection|null
  513.      */
  514.     public function getOrderReturnedProducts(): ?Collection
  515.     {
  516.         return $this->orderReturnedProducts;
  517.     }
  518.     public function addOrderReturnedProduct(Product $orderReturnedProduct): static
  519.     {
  520.         if (!$this->orderReturnedProducts->contains($orderReturnedProduct)) {
  521.             $this->orderReturnedProducts->add($orderReturnedProduct);
  522.         }
  523.         return $this;
  524.     }
  525.     public function removeOrderReturnedProduct(Product $orderReturnedProduct): static
  526.     {
  527.         $this->orderReturnedProducts->removeElement($orderReturnedProduct);
  528.         return $this;
  529.     }
  530.     public function getFirmName(): ?string
  531.     {
  532.         return $this->firmName;
  533.     }
  534.     public function setFirmName(?string $firmName): static
  535.     {
  536.         $this->firmName $firmName;
  537.         return $this;
  538.     }
  539.     public function getOptimaInvoiceSeries(): ?string
  540.     {
  541.         return $this->optimaInvoiceSeries;
  542.     }
  543.     public function setOptimaInvoiceSeries(?string $optimaInvoiceSeries): static
  544.     {
  545.         $this->optimaInvoiceSeries $optimaInvoiceSeries;
  546.         return $this;
  547.     }
  548.     public function getSellerName(): ?string
  549.     {
  550.         return $this->sellerName;
  551.     }
  552.     public function setSellerName(?string $sellerName): static
  553.     {
  554.         $this->sellerName $sellerName;
  555.         return $this;
  556.     }
  557.     public function getBankName(): ?string
  558.     {
  559.         return $this->bankName;
  560.     }
  561.     public function setBankName(?string $bankName): static
  562.     {
  563.         $this->bankName $bankName;
  564.         return $this;
  565.     }
  566.     public function getBankAccount(): ?string
  567.     {
  568.         return $this->bankAccount;
  569.     }
  570.     public function setBankAccount(?string $bankAccount): static
  571.     {
  572.         $this->bankAccount $bankAccount;
  573.         return $this;
  574.     }
  575.     /**
  576.      * @return Collection<int, NumberBlocking>
  577.      */
  578.     public function getNumberBlockings(): Collection
  579.     {
  580.         return $this->numberBlockings;
  581.     }
  582.     public function addNumberBlocking(NumberBlocking $numberBlocking): static
  583.     {
  584.         if (!$this->numberBlockings->contains($numberBlocking)) {
  585.             $this->numberBlockings->add($numberBlocking);
  586.             $numberBlocking->setBranch($this);
  587.         }
  588.         return $this;
  589.     }
  590.     public function removeNumberBlocking(NumberBlocking $numberBlocking): static
  591.     {
  592.         if ($this->numberBlockings->removeElement($numberBlocking)) {
  593.             // set the owning side to null (unless already changed)
  594.             if ($numberBlocking->getBranch() === $this) {
  595.                 $numberBlocking->setBranch(null);
  596.             }
  597.         }
  598.         return $this;
  599.     }
  600.     public function getAddressDataForPlatform(): ?string
  601.     {
  602.         return $this->addressDataForPlatform;
  603.     }
  604.     public function setAddressDataForPlatform(?string $addressDataForPlatform): static
  605.     {
  606.         $this->addressDataForPlatform $addressDataForPlatform;
  607.         return $this;
  608.     }
  609. }