src/Entity/CRM/Consultant.php line 27

  1. <?php
  2. namespace App\Entity\CRM;
  3. use App\Entity\CRM\NominalWorkTime;
  4. use App\Entity\CRM\Notification;
  5. use App\Entity\CRM\Order;
  6. use App\Entity\CRM\OrderDivided;
  7. use App\Entity\CRM\OrderHistory;
  8. use App\Entity\CRM\OrderNote;
  9. use App\Entity\CRM\Position;
  10. use App\Entity\CRM\Reservations;
  11. use App\Entity\CRM\SmsHistory;
  12. use App\Entity\CRM\SurveyResponse;
  13. use App\Entity\CRM\WorkHistory;
  14. use App\Entity\CRM\WorkTime;
  15. use App\Entity\CRM\ZoomList;
  16. use App\Repository\ConsultantRepository;
  17. use Doctrine\Common\Collections\ArrayCollection;
  18. use Doctrine\Common\Collections\Collection;
  19. use Doctrine\DBAL\Types\Types;
  20. use Doctrine\ORM\Mapping as ORM;
  21. use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
  22. use Symfony\Component\Security\Core\User\UserInterface;
  23. #[ORM\Entity(repositoryClassConsultantRepository::class)]
  24. class Consultant implements UserInterfacePasswordAuthenticatedUserInterface
  25. {
  26.     #[ORM\Id]
  27.     #[ORM\GeneratedValue]
  28.     #[ORM\Column]
  29.     private ?int $id null;
  30.     #[ORM\Column(length255)]
  31.     private string $firstName;
  32.     #[ORM\Column(length255)]
  33.     private string $lastName;
  34.     #[ORM\Column(length255)]
  35.     private string $email;
  36.     #[ORM\Column(length255nullabletrue)]
  37.     private ?string $phone null;
  38.     #[ORM\Column(length64nullabletrue)]
  39.     private ?string $lineNumber null;
  40.     #[ORM\Column(length255nullabletrue)]
  41.     private ?string $photo null;
  42.     #[ORM\Column(length255options: ['default' => 'sip.ipfon.pl'])]
  43.     private string $sipServer 'sip.ipfon.pl';
  44.     #[ORM\Column(length255nullabletrue)]
  45.     private ?string $sipLogin null;
  46.     #[ORM\Column(length255nullabletrue)]
  47.     private ?string $sipPassword null;
  48.     #[ORM\Column]
  49.     private ?bool $isActive null;
  50.     #[ORM\Column]
  51.     private ?bool $featureTester null;
  52.     /**
  53.      * @var string The hashed password
  54.      */
  55.     #[ORM\Column]
  56.     private string $password;
  57.     #[ORM\Column]
  58.     private array $roles = [];
  59.     #[ORM\ManyToOne(inversedBy'consultants')]
  60.     #[ORM\JoinColumn(nullablefalse)]
  61.     private ?Department $department null;
  62.     #[ORM\OneToMany(mappedBy'consultant'targetEntityOrder::class)]
  63.     private Collection $orders;
  64.     #[ORM\OneToMany(mappedBy'consultant'targetEntityCustomer::class)]
  65.     private Collection $customers;
  66.     #[ORM\ManyToMany(targetEntityNotification::class, mappedBy'consultant')]
  67.     private Collection $notifications;
  68.     #[ORM\OneToMany(mappedBy'consultant'targetEntityOrderNote::class)]
  69.     private Collection $orderNotes;
  70.     #[ORM\OneToMany(mappedBy'orderDividedConsultant'targetEntityOrder::class)]
  71.     private Collection $dividedOrders;
  72.     #[ORM\OneToMany(mappedBy'consultant'targetEntityOrderHistory::class)]
  73.     private Collection $orderHistories;
  74.     #[ORM\Column]
  75.     private ?int $bonusPercentage null;
  76.     #[ORM\OneToMany(mappedBy'consultant'targetEntityConsultantReward::class, orphanRemovaltrue)]
  77.     private Collection $consultantRewards;
  78.     #[ORM\ManyToMany(targetEntityCommercialOffer::class, mappedBy'AvailableForConsultants')]
  79.     private Collection $commercialOffers;
  80.     #[ORM\OneToMany(mappedBy'consultant'targetEntityWorkHistory::class)]
  81.     private Collection $workHistories;
  82.     #[ORM\OneToMany(mappedBy'createdByConsultant'targetEntityCommercialOfferIndividual::class)]
  83.     private Collection $commercialOfferIndividuals;
  84.     #[ORM\OneToMany(mappedBy'addedByConsultant'targetEntityCommercialOfferSendings::class)]
  85.     private Collection $commercialOfferSendings;
  86.     #[ORM\OneToMany(mappedBy'senderConsultant'targetEntityDirectMessage::class)]
  87.     private Collection $directMessagesSent;
  88.     #[ORM\OneToMany(mappedBy'receiverConsultant'targetEntityDirectMessage::class)]
  89.     private Collection $directMessagesReceived;
  90.     #[ORM\Column]
  91.     private ?bool $remoteAccess null;
  92.     #[ORM\OneToMany(mappedBy'addedByConsultant'targetEntityReservations::class)]
  93.     private Collection $reservations;
  94.     #[ORM\Column(length255nullabletrue)]
  95.     private ?string $color null;
  96.     #[ORM\OneToMany(mappedBy'Consultant'targetEntityDebtNote::class)]
  97.     private Collection $debtNotes;
  98.     #[ORM\OneToMany(mappedBy'consultant'targetEntityOrderDivided::class, orphanRemovaltrue)]
  99.     private Collection $orderDivideds;
  100.     #[ORM\OneToMany(mappedBy'consultant'targetEntityCustomerHistory::class)]
  101.     private Collection $customerHistories;
  102.     #[ORM\OneToMany(mappedBy'consultant'targetEntityAwards::class, orphanRemovaltrue)]
  103.     private Collection $awards;
  104.     #[ORM\ManyToOne(inversedBy'consultants')]
  105.     private ?AwardLeague $awardLeague null;
  106.     #[ORM\OneToMany(mappedBy'consultant'targetEntityAwardPtSum::class, orphanRemovaltrue)]
  107.     private Collection $awardPtSums;
  108.     #[ORM\OneToMany(mappedBy'consultant'targetEntityAwardsDraw::class, orphanRemovaltrue)]
  109.     private Collection $awardsDraws;
  110.     #[ORM\Column]
  111.     private bool $inAwards true;
  112.     #[ORM\ManyToMany(targetEntityOrder::class, mappedBy'consultantForNotes')]
  113.     private Collection $ordersToNotes;
  114.     #[ORM\OneToMany(mappedBy'sendByConsultant'targetEntitySmsHistory::class)]
  115.     private Collection $smsHistories;
  116.     #[ORM\OneToOne(mappedBy'Consultant'cascade: ['persist''remove'])]
  117.     private ?NominalWorkTime $nominalWorkTime null;
  118.     #[ORM\OneToMany(mappedBy'consultant'targetEntityWorkTime::class)]
  119.     private Collection $workTimes;
  120.     #[ORM\Column]
  121.     private ?bool $remoteWork null;
  122.     #[ORM\OneToMany(mappedBy'consultant'targetEntityLeaveRequest::class, orphanRemovaltrue)]
  123.     private Collection $leaveRequests;
  124.     #[ORM\OneToMany(mappedBy'changedByConsultant'targetEntityEntityChangeLog::class)]
  125.     private Collection $entityChangeLogs;
  126.     #[ORM\OneToMany(mappedBy'madeBy'targetEntitySurveyResponse::class)]
  127.     private Collection $surveyResponses;
  128.     #[ORM\ManyToOne(inversedBy'consultants')]
  129.     private ?Position $position null;
  130.     #[ORM\OneToMany(mappedBy'consultant'targetEntityZoomList::class)]
  131.     private Collection $zoomLists;
  132.     #[ORM\ManyToOne(inversedBy'consultants')]
  133.     private ?EmploymentContractType $consultantContractType null;
  134.     #[ORM\OneToMany(mappedBy'consultant'targetEntityAccountingOfficeSendingNote::class)]
  135.     private Collection $accountingOfficeSendingNotes;
  136.     #[ORM\Column]
  137.     private ?bool $acceptedRegulations null;
  138.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  139.     private ?\DateTimeInterface $acceptedRegulationsDate null;
  140.     #[ORM\Column]
  141.     private ?bool $acceptedZfss null;
  142.     #[ORM\Column(options: ['default' => false])]
  143.     private bool $canViewBranchOrderLicences false;
  144.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  145.     private ?\DateTimeInterface $acceptedZfssDate null;
  146.     #[ORM\OneToMany(mappedBy'consultant'targetEntityLeaveRequestBalance::class)]
  147.     private Collection $leaveRequestBalances;
  148.     #[ORM\Column]
  149.     private bool $disability false;
  150.     public function __construct()
  151.     {
  152.         $this->orders = new ArrayCollection();
  153.         $this->customers = new ArrayCollection();
  154.         $this->notifications = new ArrayCollection();
  155.         $this->orderNotes = new ArrayCollection();
  156.         $this->dividedOrders = new ArrayCollection();
  157.         $this->orderHistories = new ArrayCollection();
  158.         $this->consultantRewards = new ArrayCollection();
  159.         $this->commercialOffers = new ArrayCollection();
  160.         $this->workHistories = new ArrayCollection();
  161.         $this->commercialOfferIndividuals = new ArrayCollection();
  162.         $this->commercialOfferSendings = new ArrayCollection();
  163.         $this->directMessagesSent = new ArrayCollection();
  164.         $this->directMessagesReceived = new ArrayCollection();
  165.         $this->reservations = new ArrayCollection();
  166.         $this->debtNotes = new ArrayCollection();
  167.         $this->customerHistories = new ArrayCollection();
  168.         $this->awards = new ArrayCollection();
  169.         $this->awardPtSums = new ArrayCollection();
  170.         $this->awardsDraws = new ArrayCollection();
  171.         $this->inAwards true;
  172.         $this->ordersToNotes = new ArrayCollection();
  173.         $this->smsHistories = new ArrayCollection();
  174.         $this->workTimes = new ArrayCollection();
  175.         $this->leaveRequests = new ArrayCollection();
  176.         $this->entityChangeLogs = new ArrayCollection();
  177.         $this->surveyResponses = new ArrayCollection();
  178.         $this->position null;
  179.         $this->zoomLists = new ArrayCollection();
  180.         $this->accountingOfficeSendingNotes = new ArrayCollection();
  181.         $this->acceptedZfss false;
  182.         $this->acceptedZfssDate null;
  183.         $this->leaveRequestBalances = new ArrayCollection();
  184.     }
  185.     public function __toString()
  186.     {
  187.         return $this->firstName ' ' $this->lastName;
  188.     }
  189.     public function getId(): ?int
  190.     {
  191.         return $this->id;
  192.     }
  193.     public function getFullName(): ?string
  194.     {
  195.         return $this->lastName ' ' $this->firstName;
  196.     }
  197.     public function getFirstName(): ?string
  198.     {
  199.         return $this->firstName;
  200.     }
  201.     public function setFirstName(string $firstName): self
  202.     {
  203.         $this->firstName $firstName;
  204.         return $this;
  205.     }
  206.     public function getLastName(): ?string
  207.     {
  208.         return $this->lastName;
  209.     }
  210.     public function setLastName(string $lastName): self
  211.     {
  212.         $this->lastName $lastName;
  213.         return $this;
  214.     }
  215.     public function getEmail(): ?string
  216.     {
  217.         return $this->email;
  218.     }
  219.     public function setEmail(?string $email): self
  220.     {
  221.         $this->email $email;
  222.         return $this;
  223.     }
  224.     public function getPhone(): ?string
  225.     {
  226.         return $this->phone;
  227.     }
  228.     public function setPhone(?string $phone): self
  229.     {
  230.         $this->phone $phone;
  231.         return $this;
  232.     }
  233.     public function getLineNumber(): ?string
  234.     {
  235.         return $this->lineNumber;
  236.     }
  237.     public function setLineNumber(?string $lineNumber): self
  238.     {
  239.         $this->lineNumber $lineNumber;
  240.         return $this;
  241.     }
  242.     public function getPhoto(): ?string
  243.     {
  244.         return $this->photo;
  245.     }
  246.     public function setPhoto(?string $photo): self
  247.     {
  248.         $this->photo $photo;
  249.         return $this;
  250.     }
  251.     public function getSipServer(): string
  252.     {
  253.         return $this->sipServer;
  254.     }
  255.     public function setSipServer(string $sipServer): self
  256.     {
  257.         $this->sipServer $sipServer;
  258.         return $this;
  259.     }
  260.     public function getSipLogin(): ?string
  261.     {
  262.         return $this->sipLogin;
  263.     }
  264.     public function setSipLogin(?string $sipLogin): self
  265.     {
  266.         $this->sipLogin $sipLogin;
  267.         return $this;
  268.     }
  269.     public function getSipPassword(): ?string
  270.     {
  271.         return $this->sipPassword;
  272.     }
  273.     public function setSipPassword(?string $sipPassword): self
  274.     {
  275.         $this->sipPassword $sipPassword;
  276.         return $this;
  277.     }
  278.     public function isActive(): ?bool
  279.     {
  280.         return $this->isActive;
  281.     }
  282.     public function setIsActive(bool $isActive): self
  283.     {
  284.         $this->isActive $isActive;
  285.         return $this;
  286.     }
  287.     /**
  288.      * A visual identifier that represents this user.
  289.      *
  290.      * @see UserInterface
  291.      */
  292.     public function getUserIdentifier(): string
  293.     {
  294.         return (string) $this->email;
  295.     }
  296.     /**
  297.      * @see UserInterface
  298.      */
  299.     public function getRoles(): array
  300.     {
  301.         $roles $this->roles;
  302.         // guarantee every user at least has ROLE_USER
  303.         $roles[] = 'ROLE_CONSULTANT';
  304.         return array_unique($roles);
  305.     }
  306.     /**
  307.      * @see UserInterface
  308.      */
  309.     public function eraseCredentials()
  310.     {
  311.         // If you store any temporary, sensitive data on the user, clear it here
  312.         // $this->plainPassword = null;
  313.     }
  314.     public function setRoles(array $roles): self
  315.     {
  316.         $this->roles $roles;
  317.         return $this;
  318.     }
  319.     public function getPassword(): ?string
  320.     {
  321.         return $this->password;
  322.     }
  323.     public function setPassword(string $password): self
  324.     {
  325.         $this->password $password;
  326.         return $this;
  327.     }
  328.     public function getDepartment(): ?department
  329.     {
  330.         return $this->department;
  331.     }
  332.     public function setDepartment(?department $department): self
  333.     {
  334.         $this->department $department;
  335.         return $this;
  336.     }
  337.     /**
  338.      * @return Collection<int, Order>
  339.      */
  340.     public function getOrders(): Collection
  341.     {
  342.         return $this->orders;
  343.     }
  344.     public function addOrder(Order $order): self
  345.     {
  346.         if (!$this->orders->contains($order)) {
  347.             $this->orders->add($order);
  348.             $order->setConsultant($this);
  349.         }
  350.         return $this;
  351.     }
  352.     public function removeOrder(Order $order): self
  353.     {
  354.         if ($this->orders->removeElement($order)) {
  355.             // set the owning side to null (unless already changed)
  356.             if ($order->getConsultant() === $this) {
  357.                 $order->setConsultant(null);
  358.             }
  359.         }
  360.         return $this;
  361.     }
  362.     /**
  363.      * @return Collection<int, Customer>
  364.      */
  365.     public function getCustomers(): Collection
  366.     {
  367.         return $this->customers;
  368.     }
  369.     public function addCustomer(Customer $customer): static
  370.     {
  371.         if (!$this->customers->contains($customer)) {
  372.             $this->customers->add($customer);
  373.             $customer->setConsultant($this);
  374.         }
  375.         return $this;
  376.     }
  377.     public function removeCustomer(Customer $customer): static
  378.     {
  379.         if ($this->customers->removeElement($customer)) {
  380.             // set the owning side to null (unless already changed)
  381.             if ($customer->getConsultant() === $this) {
  382.                 $customer->setConsultant(null);
  383.             }
  384.         }
  385.         return $this;
  386.     }
  387.     /**
  388.      * @return Collection<int, Notification>
  389.      */
  390.     public function getNotifications(): Collection
  391.     {
  392.         return $this->notifications;
  393.     }
  394.     public function addNotification(Notification $notification): static
  395.     {
  396.         if (!$this->notifications->contains($notification)) {
  397.             $this->notifications->add($notification);
  398.             $notification->addConsultant($this);
  399.         }
  400.         return $this;
  401.     }
  402.     public function removeNotification(Notification $notification): static
  403.     {
  404.         if ($this->notifications->removeElement($notification)) {
  405.             $notification->removeConsultant($this);
  406.         }
  407.         return $this;
  408.     }
  409.     /**
  410.      * @return Collection<int, OrderNote>
  411.      */
  412.     public function getOrderNotes(): Collection
  413.     {
  414.         return $this->orderNotes;
  415.     }
  416.     public function addOrderNote(OrderNote $orderNote): static
  417.     {
  418.         if (!$this->orderNotes->contains($orderNote)) {
  419.             $this->orderNotes->add($orderNote);
  420.             $orderNote->setConsultant($this);
  421.         }
  422.         return $this;
  423.     }
  424.     public function removeOrderNote(OrderNote $orderNote): static
  425.     {
  426.         if ($this->orderNotes->removeElement($orderNote)) {
  427.             // set the owning side to null (unless already changed)
  428.             if ($orderNote->getConsultant() === $this) {
  429.                 $orderNote->setConsultant(null);
  430.             }
  431.         }
  432.         return $this;
  433.     }
  434.     /**
  435.      * @return Collection<int, Order>
  436.      */
  437.     public function getDividedOrders(): Collection
  438.     {
  439.         return $this->dividedOrders;
  440.     }
  441.     public function addDividedOrder(Order $dividedOrder): static
  442.     {
  443.         if (!$this->dividedOrders->contains($dividedOrder)) {
  444.             $this->dividedOrders->add($dividedOrder);
  445.             $dividedOrder->setOrderDividedConsultant($this);
  446.         }
  447.         return $this;
  448.     }
  449.     public function removeDividedOrder(Order $dividedOrder): static
  450.     {
  451.         if ($this->dividedOrders->removeElement($dividedOrder)) {
  452.             // set the owning side to null (unless already changed)
  453.             if ($dividedOrder->getOrderDividedConsultant() === $this) {
  454.                 $dividedOrder->setOrderDividedConsultant(null);
  455.             }
  456.         }
  457.         return $this;
  458.     }
  459.     /**
  460.      * @return Collection<int, OrderHistory>
  461.      */
  462.     public function getOrderHistories(): Collection
  463.     {
  464.         return $this->orderHistories;
  465.     }
  466.     public function addOrderHistory(OrderHistory $orderHistory): static
  467.     {
  468.         if (!$this->orderHistories->contains($orderHistory)) {
  469.             $this->orderHistories->add($orderHistory);
  470.             $orderHistory->setConsultant($this);
  471.         }
  472.         return $this;
  473.     }
  474.     public function removeOrderHistory(OrderHistory $orderHistory): static
  475.     {
  476.         if ($this->orderHistories->removeElement($orderHistory)) {
  477.             // set the owning side to null (unless already changed)
  478.             if ($orderHistory->getConsultant() === $this) {
  479.                 $orderHistory->setConsultant(null);
  480.             }
  481.         }
  482.         return $this;
  483.     }
  484.     public function getBonusPercentage(): ?int
  485.     {
  486.         return $this->bonusPercentage;
  487.     }
  488.     public function setBonusPercentage(int $bonusPercentage): static
  489.     {
  490.         $this->bonusPercentage $bonusPercentage;
  491.         return $this;
  492.     }
  493.     /**
  494.      * @return Collection<int, ConsultantReward>
  495.      */
  496.     public function getConsultantRewards(): Collection
  497.     {
  498.         return $this->consultantRewards;
  499.     }
  500.     public function addConsultantReward(ConsultantReward $consultantReward): static
  501.     {
  502.         if (!$this->consultantRewards->contains($consultantReward)) {
  503.             $this->consultantRewards->add($consultantReward);
  504.             $consultantReward->setConsultant($this);
  505.         }
  506.         return $this;
  507.     }
  508.     public function removeConsultantReward(ConsultantReward $consultantReward): static
  509.     {
  510.         if ($this->consultantRewards->removeElement($consultantReward)) {
  511.             // set the owning side to null (unless already changed)
  512.             if ($consultantReward->getConsultant() === $this) {
  513.                 $consultantReward->setConsultant(null);
  514.             }
  515.         }
  516.         return $this;
  517.     }
  518.     /**
  519.      * @return Collection<int, CommercialOffer>
  520.      */
  521.     public function getCommercialOffers(): Collection
  522.     {
  523.         return $this->commercialOffers;
  524.     }
  525.     public function addCommercialOffer(CommercialOffer $commercialOffer): static
  526.     {
  527.         if (!$this->commercialOffers->contains($commercialOffer)) {
  528.             $this->commercialOffers->add($commercialOffer);
  529.             $commercialOffer->addAvailableForConsultant($this);
  530.         }
  531.         return $this;
  532.     }
  533.     public function removeCommercialOffer(CommercialOffer $commercialOffer): static
  534.     {
  535.         if ($this->commercialOffers->removeElement($commercialOffer)) {
  536.             $commercialOffer->removeAvailableForConsultant($this);
  537.         }
  538.         return $this;
  539.     }
  540.     /**
  541.      * @return Collection<int, WorkHistory>
  542.      */
  543.     public function getWorkHistories(): Collection
  544.     {
  545.         return $this->workHistories;
  546.     }
  547.     public function addWorkHistory(WorkHistory $workHistory): static
  548.     {
  549.         if (!$this->workHistories->contains($workHistory)) {
  550.             $this->workHistories->add($workHistory);
  551.             $workHistory->setConsultant($this);
  552.         }
  553.         return $this;
  554.     }
  555.     public function removeWorkHistory(WorkHistory $workHistory): static
  556.     {
  557.         if ($this->workHistories->removeElement($workHistory)) {
  558.             // set the owning side to null (unless already changed)
  559.             if ($workHistory->getConsultant() === $this) {
  560.                 $workHistory->setConsultant(null);
  561.             }
  562.         }
  563.         return $this;
  564.     }
  565.     /**
  566.      * @return Collection<int, CommercialOfferIndividual>
  567.      */
  568.     public function getIndividualCommercialOffers(): Collection
  569.     {
  570.         return $this->commercialOfferIndividuals;
  571.     }
  572.     public function addIndividualCommercialOffer(CommercialOfferIndividual $commercialOfferIndividual): static
  573.     {
  574.         if (!$this->commercialOfferIndividuals->contains($commercialOfferIndividual)) {
  575.             $this->commercialOfferIndividuals->add($commercialOfferIndividual);
  576.             $commercialOfferIndividual->setCreatedByConsultant($this);
  577.         }
  578.         return $this;
  579.     }
  580.     public function removeIndividualCommercialOffer(CommercialOfferIndividual $commercialOfferIndividual): static
  581.     {
  582.         if ($this->commercialOfferIndividuals->removeElement($commercialOfferIndividual)) {
  583.             // set the owning side to null (unless already changed)
  584.             if ($commercialOfferIndividual->getCreatedByConsultant() === $this) {
  585.                 $commercialOfferIndividual->setCreatedByConsultant(null);
  586.             }
  587.         }
  588.         return $this;
  589.     }
  590.     /**
  591.      * @return Collection<int, CommercialOfferSendings>
  592.      */
  593.     public function getCommercialOfferSendings(): Collection
  594.     {
  595.         return $this->commercialOfferSendings;
  596.     }
  597.     public function addCommercialOfferSending(CommercialOfferSendings $commercialOfferSending): static
  598.     {
  599.         if (!$this->commercialOfferSendings->contains($commercialOfferSending)) {
  600.             $this->commercialOfferSendings->add($commercialOfferSending);
  601.             $commercialOfferSending->setAddedByConsultant($this);
  602.         }
  603.         return $this;
  604.     }
  605.     public function removeCommercialOfferSending(CommercialOfferSendings $commercialOfferSending): static
  606.     {
  607.         if ($this->commercialOfferSendings->removeElement($commercialOfferSending)) {
  608.             // set the owning side to null (unless already changed)
  609.             if ($commercialOfferSending->getAddedByConsultant() === $this) {
  610.                 $commercialOfferSending->setAddedByConsultant(null);
  611.             }
  612.         }
  613.         return $this;
  614.     }
  615.     /**
  616.      * @return Collection<int, DirectMessage>
  617.      */
  618.     public function getDirectMessagesSent(): Collection
  619.     {
  620.         return $this->directMessagesSent;
  621.     }
  622.     public function addDirectMessagesSent(DirectMessage $directMessagesSent): static
  623.     {
  624.         if (!$this->directMessagesSent->contains($directMessagesSent)) {
  625.             $this->directMessagesSent->add($directMessagesSent);
  626.             $directMessagesSent->setSenderConsultant($this);
  627.         }
  628.         return $this;
  629.     }
  630.     public function removeDirectMessagesSent(DirectMessage $directMessagesSent): static
  631.     {
  632.         if ($this->directMessagesSent->removeElement($directMessagesSent)) {
  633.             // set the owning side to null (unless already changed)
  634.             if ($directMessagesSent->getSenderConsultant() === $this) {
  635.                 $directMessagesSent->setSenderConsultant(null);
  636.             }
  637.         }
  638.         return $this;
  639.     }
  640.     /**
  641.      * @return Collection<int, DirectMessage>
  642.      */
  643.     public function getDirectMessagesReceived(): Collection
  644.     {
  645.         return $this->directMessagesReceived;
  646.     }
  647.     public function addDirectMessagesReceived(DirectMessage $directMessagesReceived): static
  648.     {
  649.         if (!$this->directMessagesReceived->contains($directMessagesReceived)) {
  650.             $this->directMessagesReceived->add($directMessagesReceived);
  651.             $directMessagesReceived->setReceiverConsultant($this);
  652.         }
  653.         return $this;
  654.     }
  655.     public function removeDirectMessagesReceived(DirectMessage $directMessagesReceived): static
  656.     {
  657.         if ($this->directMessagesReceived->removeElement($directMessagesReceived)) {
  658.             // set the owning side to null (unless already changed)
  659.             if ($directMessagesReceived->getReceiverConsultant() === $this) {
  660.                 $directMessagesReceived->setReceiverConsultant(null);
  661.             }
  662.         }
  663.         return $this;
  664.     }
  665.     public function isRemoteAccess(): ?bool
  666.     {
  667.         return $this->remoteAccess;
  668.     }
  669.     public function setRemoteAccess(bool $remoteAccess): static
  670.     {
  671.         $this->remoteAccess $remoteAccess;
  672.         return $this;
  673.     }
  674.     /**
  675.      * @return Collection<int, Reservations>
  676.      */
  677.     public function getReservations(): Collection
  678.     {
  679.         return $this->reservations;
  680.     }
  681.     public function addReservation(Reservations $reservation): static
  682.     {
  683.         if (!$this->reservations->contains($reservation)) {
  684.             $this->reservations->add($reservation);
  685.             $reservation->setAddedByConsultant($this);
  686.         }
  687.         return $this;
  688.     }
  689.     public function removeReservation(Reservations $reservation): static
  690.     {
  691.         if ($this->reservations->removeElement($reservation)) {
  692.             // set the owning side to null (unless already changed)
  693.             if ($reservation->getAddedByConsultant() === $this) {
  694.                 $reservation->setAddedByConsultant(null);
  695.             }
  696.         }
  697.         return $this;
  698.     }
  699.     public function getColor(): ?string
  700.     {
  701.         return $this->color;
  702.     }
  703.     public function setColor(?string $color): static
  704.     {
  705.         $this->color $color;
  706.         return $this;
  707.     }
  708.     /**
  709.      * @return Collection<int, DebtNote>
  710.      */
  711.     public function getDebtNotes(): Collection
  712.     {
  713.         return $this->debtNotes;
  714.     }
  715.     public function addDebtNote(DebtNote $debtNote): static
  716.     {
  717.         if (!$this->debtNotes->contains($debtNote)) {
  718.             $this->debtNotes->add($debtNote);
  719.             $debtNote->setConsultant($this);
  720.         }
  721.         return $this;
  722.     }
  723.     public function removeDebtNote(DebtNote $debtNote): static
  724.     {
  725.         if ($this->debtNotes->removeElement($debtNote)) {
  726.             // set the owning side to null (unless already changed)
  727.             if ($debtNote->getConsultant() === $this) {
  728.                 $debtNote->setConsultant(null);
  729.             }
  730.         }
  731.         return $this;
  732.     }
  733.     public function getOrderDivideds(): Collection
  734.     {
  735.         return $this->orderDivideds;
  736.     }
  737.     public function setOrderDivideds(Collection $orderDivideds): void
  738.     {
  739.         $this->orderDivideds $orderDivideds;
  740.     }
  741.     public function removeOrderDivided(OrderDivided $orderDivided): static
  742.     {
  743.         if ($this->orderDivideds->removeElement($orderDivided)) {
  744.             // set the owning side to null (unless already changed)
  745.             if ($orderDivided->getConsultant() === $this) {
  746.                 $orderDivided->setConsultant(null);
  747.             }
  748.         }
  749.         return $this;
  750.     }
  751.     /**
  752.      * @return Collection<int, CustomerHistory>
  753.      */
  754.     public function getCustomerHistories(): Collection
  755.     {
  756.         return $this->customerHistories;
  757.     }
  758.     public function addCustomerHistory(CustomerHistory $customerHistory): static
  759.     {
  760.         if (!$this->customerHistories->contains($customerHistory)) {
  761.             $this->customerHistories->add($customerHistory);
  762.             $customerHistory->setConsultant($this);
  763.         }
  764.         return $this;
  765.     }
  766.     public function removeCustomerHistory(CustomerHistory $customerHistory): static
  767.     {
  768.         if ($this->customerHistories->removeElement($customerHistory)) {
  769.             // set the owning side to null (unless already changed)
  770.             if ($customerHistory->getConsultant() === $this) {
  771.                 $customerHistory->setConsultant(null);
  772.             }
  773.         }
  774.         return $this;
  775.     }
  776.     /**
  777.      * @return Collection<int, Awards>
  778.      */
  779.     public function getAwards(): Collection
  780.     {
  781.         return $this->awards;
  782.     }
  783.     public function addAward(Awards $award): static
  784.     {
  785.         if (!$this->awards->contains($award)) {
  786.             $this->awards->add($award);
  787.             $award->setConsultant($this);
  788.         }
  789.         return $this;
  790.     }
  791.     public function removeAward(Awards $award): static
  792.     {
  793.         if ($this->awards->removeElement($award)) {
  794.             // set the owning side to null (unless already changed)
  795.             if ($award->getConsultant() === $this) {
  796.                 $award->setConsultant(null);
  797.             }
  798.         }
  799.         return $this;
  800.     }
  801.     public function getAwardLeague(): ?AwardLeague
  802.     {
  803.         return $this->awardLeague;
  804.     }
  805.     public function setAwardLeague(?AwardLeague $awardLeague): static
  806.     {
  807.         $this->awardLeague $awardLeague;
  808.         return $this;
  809.     }
  810.     /**
  811.      * @return Collection<int, AwardPtSum>
  812.      */
  813.     public function getAwardPtSums(): Collection
  814.     {
  815.         return $this->awardPtSums;
  816.     }
  817.     public function addAwardPtSum(AwardPtSum $awardPtSum): static
  818.     {
  819.         if (!$this->awardPtSums->contains($awardPtSum)) {
  820.             $this->awardPtSums->add($awardPtSum);
  821.             $awardPtSum->setConsultant($this);
  822.         }
  823.         return $this;
  824.     }
  825.     public function removeAwardPtSum(AwardPtSum $awardPtSum): static
  826.     {
  827.         if ($this->awardPtSums->removeElement($awardPtSum)) {
  828.             // set the owning side to null (unless already changed)
  829.             if ($awardPtSum->getConsultant() === $this) {
  830.                 $awardPtSum->setConsultant(null);
  831.             }
  832.         }
  833.         return $this;
  834.     }
  835.     /**
  836.      * @return Collection<int, AwardsDraw>
  837.      */
  838.     public function getAwardsDraws(): Collection
  839.     {
  840.         return $this->awardsDraws;
  841.     }
  842.     public function addAwardsDraw(AwardsDraw $awardsDraw): static
  843.     {
  844.         if (!$this->awardsDraws->contains($awardsDraw)) {
  845.             $this->awardsDraws->add($awardsDraw);
  846.             $awardsDraw->setConsultant($this);
  847.         }
  848.         return $this;
  849.     }
  850.     public function removeAwardsDraw(AwardsDraw $awardsDraw): static
  851.     {
  852.         if ($this->awardsDraws->removeElement($awardsDraw)) {
  853.             // set the owning side to null (unless already changed)
  854.             if ($awardsDraw->getConsultant() === $this) {
  855.                 $awardsDraw->setConsultant(null);
  856.             }
  857.         }
  858.         return $this;
  859.     }
  860.     public function isInAwards(): bool
  861.     {
  862.         return $this->inAwards;
  863.     }
  864.     public function setInAwards(bool $inAwards): static
  865.     {
  866.         $this->inAwards $inAwards;
  867.         return $this;
  868.     }
  869.     /**
  870.      * @return Collection<int, Order>
  871.      */
  872.     public function getOrdersToNotes(): Collection
  873.     {
  874.         return $this->ordersToNotes;
  875.     }
  876.     public function addOrdersToNote(Order $ordersToNote): static
  877.     {
  878.         if (!$this->ordersToNotes->contains($ordersToNote)) {
  879.             $this->ordersToNotes->add($ordersToNote);
  880.             $ordersToNote->addConsultantForNote($this);
  881.         }
  882.         return $this;
  883.     }
  884.     public function removeOrdersToNote(Order $ordersToNote): static
  885.     {
  886.         if ($this->ordersToNotes->removeElement($ordersToNote)) {
  887.             $ordersToNote->removeConsultantForNote($this);
  888.         }
  889.         return $this;
  890.     }
  891.     /**
  892.      * @return Collection<int, SmsHistory>
  893.      */
  894.     public function getSmsHistories(): Collection
  895.     {
  896.         return $this->smsHistories;
  897.     }
  898.     public function addSmsHistory(SmsHistory $smsHistory): static
  899.     {
  900.         if (!$this->smsHistories->contains($smsHistory)) {
  901.             $this->smsHistories->add($smsHistory);
  902.             $smsHistory->setSendByConsultant($this);
  903.         }
  904.         return $this;
  905.     }
  906.     public function removeSmsHistory(SmsHistory $smsHistory): static
  907.     {
  908.         if ($this->smsHistories->removeElement($smsHistory)) {
  909.             // set the owning side to null (unless already changed)
  910.             if ($smsHistory->getSendByConsultant() === $this) {
  911.                 $smsHistory->setSendByConsultant(null);
  912.             }
  913.         }
  914.         return $this;
  915.     }
  916.     public function getNominalWorkTime(): ?NominalWorkTime
  917.     {
  918.         return $this->nominalWorkTime;
  919.     }
  920.     public function setNominalWorkTime(?NominalWorkTime $nominalWorkTime): static
  921.     {
  922.         // unset the owning side of the relation if necessary
  923.         if ($nominalWorkTime === null && $this->nominalWorkTime !== null) {
  924.             $this->nominalWorkTime->setConsultant(null);
  925.         }
  926.         // set the owning side of the relation if necessary
  927.         if ($nominalWorkTime !== null && $nominalWorkTime->getConsultant() !== $this) {
  928.             $nominalWorkTime->setConsultant($this);
  929.         }
  930.         $this->nominalWorkTime $nominalWorkTime;
  931.         return $this;
  932.     }
  933.     /**
  934.      * @return Collection<int, WorkTime>
  935.      */
  936.     public function getWorkTimes(): Collection
  937.     {
  938.         return $this->workTimes;
  939.     }
  940.     public function addWorkTime(WorkTime $workTime): static
  941.     {
  942.         if (!$this->workTimes->contains($workTime)) {
  943.             $this->workTimes->add($workTime);
  944.             $workTime->setConsultant($this);
  945.         }
  946.         return $this;
  947.     }
  948.     public function removeWorkTime(WorkTime $workTime): static
  949.     {
  950.         if ($this->workTimes->removeElement($workTime)) {
  951.             // set the owning side to null (unless already changed)
  952.             if ($workTime->getConsultant() === $this) {
  953.                 $workTime->setConsultant(null);
  954.             }
  955.         }
  956.         return $this;
  957.     }
  958.     public function isRemoteWork(): ?bool
  959.     {
  960.         return $this->remoteWork;
  961.     }
  962.     public function setRemoteWork(bool $remoteWork): static
  963.     {
  964.         $this->remoteWork $remoteWork;
  965.         return $this;
  966.     }
  967.     /**
  968.      * @return Collection<int, LeaveRequest>
  969.      */
  970.     public function getLeaveRequests(): Collection
  971.     {
  972.         return $this->leaveRequests;
  973.     }
  974.     public function getLeaveRequestsFrom2026(): Collection
  975.     {
  976.         return $this->leaveRequests->filter(function (LeaveRequest $lr) {
  977.             return $lr->getStartTime() >= new \DateTimeImmutable('2026-01-01 00:00:00');
  978.         });
  979.     }
  980.     public function addLeaveRequest(LeaveRequest $leaveRequest): static
  981.     {
  982.         if (!$this->leaveRequests->contains($leaveRequest)) {
  983.             $this->leaveRequests->add($leaveRequest);
  984.             $leaveRequest->setConsultant($this);
  985.         }
  986.         return $this;
  987.     }
  988.     public function removeLeaveRequest(LeaveRequest $leaveRequest): static
  989.     {
  990.         if ($this->leaveRequests->removeElement($leaveRequest)) {
  991.             // set the owning side to null (unless already changed)
  992.             if ($leaveRequest->getConsultant() === $this) {
  993.                 $leaveRequest->setConsultant(null);
  994.             }
  995.         }
  996.         return $this;
  997.     }
  998.     /**
  999.      * @return Collection<int, EntityChangeLog>
  1000.      */
  1001.     public function getEntityChangeLogs(): Collection
  1002.     {
  1003.         return $this->entityChangeLogs;
  1004.     }
  1005.     public function addEntityChangeLog(EntityChangeLog $entityChangeLog): static
  1006.     {
  1007.         if (!$this->entityChangeLogs->contains($entityChangeLog)) {
  1008.             $this->entityChangeLogs->add($entityChangeLog);
  1009.             $entityChangeLog->setChangedByConsultant($this);
  1010.         }
  1011.         return $this;
  1012.     }
  1013.     public function removeEntityChangeLog(EntityChangeLog $entityChangeLog): static
  1014.     {
  1015.         if ($this->entityChangeLogs->removeElement($entityChangeLog)) {
  1016.             // set the owning side to null (unless already changed)
  1017.             if ($entityChangeLog->getChangedByConsultant() === $this) {
  1018.                 $entityChangeLog->setChangedByConsultant(null);
  1019.             }
  1020.         }
  1021.         return $this;
  1022.     }
  1023.     /**
  1024.      * @return Collection<int, SurveyResponse>
  1025.      */
  1026.     public function getSurveyResponses(): Collection
  1027.     {
  1028.         return $this->surveyResponses;
  1029.     }
  1030.     public function addSurveyResponse(SurveyResponse $surveyResponse): static
  1031.     {
  1032.         if (!$this->surveyResponses->contains($surveyResponse)) {
  1033.             $this->surveyResponses->add($surveyResponse);
  1034.             $surveyResponse->setMadeBy($this);
  1035.         }
  1036.         return $this;
  1037.     }
  1038.     public function removeSurveyResponse(SurveyResponse $surveyResponse): static
  1039.     {
  1040.         if ($this->surveyResponses->removeElement($surveyResponse)) {
  1041.             // set the owning side to null (unless already changed)
  1042.             if ($surveyResponse->getMadeBy() === $this) {
  1043.                 $surveyResponse->setMadeBy(null);
  1044.             }
  1045.         }
  1046.         return $this;
  1047.     }
  1048.     public function getPosition(): ?Position
  1049.     {
  1050.         return $this->position;
  1051.     }
  1052.     public function setPosition(?Position $position): static
  1053.     {
  1054.         $this->position $position;
  1055.         return $this;
  1056.     }
  1057.     /**
  1058.      * @return Collection<int, ZoomList>
  1059.      */
  1060.     public function getZoomLists(): Collection
  1061.     {
  1062.         return $this->zoomLists;
  1063.     }
  1064.     public function addZoomList(ZoomList $zoomList): static
  1065.     {
  1066.         if (!$this->zoomLists->contains($zoomList)) {
  1067.             $this->zoomLists->add($zoomList);
  1068.             $zoomList->setConsultant($this);
  1069.         }
  1070.         return $this;
  1071.     }
  1072.     public function removeZoomList(ZoomList $zoomList): static
  1073.     {
  1074.         if ($this->zoomLists->removeElement($zoomList)) {
  1075.             // set the owning side to null (unless already changed)
  1076.             if ($zoomList->getConsultant() === $this) {
  1077.                 $zoomList->setConsultant(null);
  1078.             }
  1079.         }
  1080.         return $this;
  1081.     }
  1082.     public function getConsultantContractType(): ?EmploymentContractType
  1083.     {
  1084.         return $this->consultantContractType;
  1085.     }
  1086.     public function setConsultantContractType(?EmploymentContractType $consultantContractType): static
  1087.     {
  1088.         $this->consultantContractType $consultantContractType;
  1089.         return $this;
  1090.     }
  1091.     /**
  1092.      * @return Collection<int, AccountingOfficeSendingNote>
  1093.      */
  1094.     public function getAccountingOfficeSendingNotes(): Collection
  1095.     {
  1096.         return $this->accountingOfficeSendingNotes;
  1097.     }
  1098.     public function addAccountingOfficeSendingNote(AccountingOfficeSendingNote $accountingOfficeSendingNote): static
  1099.     {
  1100.         if (!$this->accountingOfficeSendingNotes->contains($accountingOfficeSendingNote)) {
  1101.             $this->accountingOfficeSendingNotes->add($accountingOfficeSendingNote);
  1102.             $accountingOfficeSendingNote->setConsultant($this);
  1103.         }
  1104.         return $this;
  1105.     }
  1106.     public function removeAccountingOfficeSendingNote(AccountingOfficeSendingNote $accountingOfficeSendingNote): static
  1107.     {
  1108.         if ($this->accountingOfficeSendingNotes->removeElement($accountingOfficeSendingNote)) {
  1109.             // set the owning side to null (unless already changed)
  1110.             if ($accountingOfficeSendingNote->getConsultant() === $this) {
  1111.                 $accountingOfficeSendingNote->setConsultant(null);
  1112.             }
  1113.         }
  1114.         return $this;
  1115.     }
  1116.     public function isAcceptedRegulations(): ?bool
  1117.     {
  1118.         return $this->acceptedRegulations;
  1119.     }
  1120.     public function setAcceptedRegulations(bool $acceptedRegulations): static
  1121.     {
  1122.         $this->acceptedRegulations $acceptedRegulations;
  1123.         return $this;
  1124.     }
  1125.     public function getAcceptedRegulationsDate(): ?\DateTimeInterface
  1126.     {
  1127.         return $this->acceptedRegulationsDate;
  1128.     }
  1129.     public function setAcceptedRegulationsDate(?\DateTimeInterface $acceptedRegulationsDate): static
  1130.     {
  1131.         $this->acceptedRegulationsDate $acceptedRegulationsDate;
  1132.         return $this;
  1133.     }
  1134.     public function isAcceptedZfss(): ?bool
  1135.     {
  1136.         return $this->acceptedZfss;
  1137.     }
  1138.     public function setAcceptedZfss(bool $acceptedZfss): static
  1139.     {
  1140.         $this->acceptedZfss $acceptedZfss;
  1141.         return $this;
  1142.     }
  1143.     public function isCanViewBranchOrderLicences(): bool
  1144.     {
  1145.         return $this->canViewBranchOrderLicences;
  1146.     }
  1147.     public function setCanViewBranchOrderLicences(bool $canViewBranchOrderLicences): static
  1148.     {
  1149.         $this->canViewBranchOrderLicences $canViewBranchOrderLicences;
  1150.         return $this;
  1151.     }
  1152.     public function getAcceptedZfssDate(): ?\DateTimeInterface
  1153.     {
  1154.         return $this->acceptedZfssDate;
  1155.     }
  1156.     public function setAcceptedZfssDate(?\DateTimeInterface $acceptedZfssDate): static
  1157.     {
  1158.         $this->acceptedZfssDate $acceptedZfssDate;
  1159.         return $this;
  1160.     }
  1161.     /**
  1162.      * @return Collection<int, LeaveRequestBalance>
  1163.      */
  1164.     public function getLeaveRequestBalances(): Collection
  1165.     {
  1166.         return $this->leaveRequestBalances;
  1167.     }
  1168.     public function addLeaveRequestBalance(LeaveRequestBalance $leaveRequestBalance): static
  1169.     {
  1170.         if (!$this->leaveRequestBalances->contains($leaveRequestBalance)) {
  1171.             $this->leaveRequestBalances->add($leaveRequestBalance);
  1172.             $leaveRequestBalance->setConsultant($this);
  1173.         }
  1174.         return $this;
  1175.     }
  1176.     public function removeLeaveRequestBalance(LeaveRequestBalance $leaveRequestBalance): static
  1177.     {
  1178.         if ($this->leaveRequestBalances->removeElement($leaveRequestBalance)) {
  1179.             // set the owning side to null (unless already changed)
  1180.             if ($leaveRequestBalance->getConsultant() === $this) {
  1181.                 $leaveRequestBalance->setConsultant(null);
  1182.             }
  1183.         }
  1184.         return $this;
  1185.     }
  1186.     public function getTodayWorkTimeFromLoadedCollection(): ?WorkTime
  1187.     {
  1188.         $today = (new \DateTimeImmutable('today'))->format('Y-m-d');
  1189.         foreach ($this->getWorkTimes() as $workTime) {
  1190.             if ($workTime->getWorkDate()?->format('Y-m-d') === $today) {
  1191.                 return $workTime;
  1192.             }
  1193.         }
  1194.         return null;
  1195.     }
  1196.     public function getFeatureTester(): ?bool
  1197.     {
  1198.         return $this->featureTester;
  1199.     }
  1200.     public function setFeatureTester(?bool $featureTester): void
  1201.     {
  1202.         $this->featureTester $featureTester;
  1203.     }
  1204.     public function isDisability(): bool
  1205.     {
  1206.         return $this->disability;
  1207.     }
  1208.     public function setDisability(bool $disability): void
  1209.     {
  1210.         $this->disability $disability;
  1211.     }
  1212. }