src/Entity/CRM/Admin.php line 19

  1. <?php
  2. namespace App\Entity\CRM;
  3. use App\Repository\AdminRepository;
  4. use DateTimeImmutable;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\DBAL\Types\Types;
  8. use Doctrine\ORM\Mapping as ORM;
  9. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  10. use Symfony\Component\Security\Core\User\EquatableInterface;
  11. use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
  12. use Symfony\Component\Security\Core\User\UserInterface;
  13. #[ORM\Entity(repositoryClassAdminRepository::class)]
  14. #[ORM\Table(name'`admin`')]
  15. #[UniqueEntity(fields: ['email'], message'Konto o takim adresie email już istnieje')]
  16. class Admin implements UserInterfacePasswordAuthenticatedUserInterfaceEquatableInterface
  17. {
  18.     #[ORM\Id]
  19.     #[ORM\GeneratedValue]
  20.     #[ORM\Column]
  21.     private ?int $id null;
  22.     #[ORM\Column(length180uniquetrue)]
  23.     private ?string $email null;
  24.     #[ORM\Column(type"string"nullablefalse)]
  25.     private string $firstName;
  26.     #[ORM\Column(type"string"nullablefalse)]
  27.     private string $lastName;
  28.     #[ORM\Column(length255nullabletrue)]
  29.     private ?string $phone null;
  30.     #[ORM\Column(length64nullabletrue)]
  31.     private ?string $lineNumber null;
  32.     #[ORM\Column(type"boolean"nullablefalse)]
  33.     private bool $isActive true;
  34.     #[ORM\Column]
  35.     private array $roles = [];
  36.     /**
  37.      * @var string The hashed password
  38.      */
  39.     #[ORM\Column]
  40.     private string $password;
  41.     #[ORM\ManyToMany(targetEntityBranch::class, inversedBy'admins')]
  42.     #[ORM\JoinColumn(nullablefalse)]
  43.     private Collection $branches;
  44.     #[ORM\OneToOne(mappedBy'admin')]
  45.     private ?Worker $worker null;
  46.     #[ORM\OneToOne(mappedBy'admin'cascade: ['persist''remove'])]
  47.     private ?Implementer $implementer null;
  48.     #[ORM\OneToMany(mappedBy'admin'targetEntityOrderHistory::class)]
  49.     private Collection $orderHistories;
  50.     #[ORM\Column(length255nullabletrue)]
  51.     private ?string $color null;
  52.     #[ORM\ManyToMany(targetEntityNotification::class, mappedBy'admin')]
  53.     private Collection $notifications;
  54.     #[ORM\Column(length6nullabletrue)]
  55.     private ?string $adminCode;
  56.     #[ORM\OneToMany(mappedBy'admin'targetEntityOrderNote::class)]
  57.     private Collection $orderNotes;
  58.     #[ORM\OneToMany(mappedBy'admin'targetEntityImplementerOrderHistory::class)]
  59.     private Collection $implementerOrderHistories;
  60.     #[ORM\OneToMany(mappedBy'lastEditedBy'targetEntityOrderNote::class)]
  61.     private Collection $orderEditedNotes;
  62.     #[ORM\OneToMany(mappedBy'admin'targetEntityOrder::class)]
  63.     private Collection $orders;
  64.     #[ORM\OneToMany(mappedBy'addedBy'targetEntityCommercialOffer::class)]
  65.     private Collection $commercialOffers;
  66.     #[ORM\OneToMany(mappedBy'admin'targetEntityWorkHistory::class)]
  67.     private Collection $workHistories;
  68.     #[ORM\OneToMany(mappedBy'createdByAdmin'targetEntityCommercialOfferIndividual::class)]
  69.     private Collection $commercialOfferIndividuals;
  70.     #[ORM\OneToMany(mappedBy'addedByAdmin'targetEntityCommercialOfferSendings::class)]
  71.     private Collection $commercialOfferSendings;
  72.     //    #[ORM\OneToMany(mappedBy: 'acceptedBy', targetEntity: CommercialOfferSendings::class)]
  73. //    private Collection $commercialOfferSendingsAccepts;
  74. //
  75. //    #[ORM\OneToMany(mappedBy: 'acceptedBy', targetEntity: CommercialOfferIndividual::class)]
  76. //    private Collection $commercialOfferIndividualsAccepted;
  77.     #[ORM\OneToMany(mappedBy'addedByAdmin'targetEntityReservations::class)]
  78.     private Collection $reservations;
  79.     #[ORM\OneToMany(mappedBy'lastEditedBy'targetEntityReservations::class)]
  80.     private Collection $reservationsEdit;
  81.     #[ORM\OneToMany(mappedBy'senderAdmin'targetEntityDirectMessage::class)]
  82.     private Collection $directMessagesSent;
  83.     #[ORM\OneToMany(mappedBy'receiverAdmin'targetEntityDirectMessage::class)]
  84.     private Collection $directMessagesReceived;
  85.     #[ORM\Column]
  86.     private ?bool $remoteAccess null;
  87.     #[ORM\OneToMany(mappedBy'admin'targetEntityAdminNotificationSettings::class)]
  88.     private Collection $adminNotificationSettings;
  89.     #[ORM\OneToMany(mappedBy'admin'targetEntityDebtNote::class)]
  90.     private Collection $debtNotes;
  91.     #[ORM\OneToMany(mappedBy'admin'targetEntityCustomerHistory::class)]
  92.     private Collection $customerHistories;
  93.     #[ORM\Column(length255nullabletrue)]
  94.     private ?string $photo null;
  95.     #[ORM\Column]
  96.     private bool $sendMail true;
  97.     #[ORM\ManyToMany(targetEntityProduct::class, mappedBy'adminToInfo')]
  98.     private Collection $products;
  99.     #[ORM\OneToMany(mappedBy'sendByAdmin'targetEntitySmsHistory::class)]
  100.     private Collection $smsHistories;
  101.     #[ORM\ManyToMany(targetEntityNotificationToSendSetting::class, mappedBy'admin')]
  102.     private Collection $notificationToSendSettings;
  103.     #[ORM\OneToOne(mappedBy'admin'cascade: ['persist''remove'])]
  104.     private ?Mailbox $mailbox null;
  105.     #[ORM\OneToMany(mappedBy'acceptedBy'targetEntityLeaveRequest::class)]
  106.     private Collection $acceptedLeaveRequests;
  107.     #[ORM\OneToMany(mappedBy'rejectedBy'targetEntityLeaveRequest::class)]
  108.     private Collection $rejectedLeaveRequests;
  109.     #[ORM\OneToMany(mappedBy'acceptedBy'targetEntityTask::class)]
  110.     private Collection $acceptedTasks;
  111.     #[ORM\ManyToOne(inversedBy'admins')]
  112.     private ?Position $position null;
  113.     #[ORM\ManyToMany(targetEntityAgreement::class, mappedBy'agreementToSendAfterSigned')]
  114.     private Collection $agreementsToSendAfterSigned;
  115.     #[ORM\OneToOne(mappedBy'admin'cascade: ['persist''remove'])]
  116.     private ?NominalWorkTime $nominalWorkTime null;
  117.     #[ORM\Column]
  118.     private bool $toRcp true;
  119.     #[ORM\OneToMany(mappedBy'acceptedBy'targetEntityWorkTime::class)]
  120.     private Collection $acceptedWorkTimes;
  121.     #[ORM\OneToMany(mappedBy'admin'targetEntityAccountingOfficeSendingNote::class)]
  122.     private Collection $accountingOfficeSendingNotes;
  123.     #[ORM\OneToMany(mappedBy'admin'targetEntityWorkTime::class)]
  124.     private Collection $workTimes;
  125.     #[ORM\OneToMany(mappedBy'admin'targetEntityLeaveRequest::class)]
  126.     private Collection $leaveRequests;
  127.     #[ORM\ManyToMany(targetEntityDepartment::class, mappedBy'management')]
  128.     private Collection $departments;
  129.     #[ORM\OneToMany(mappedBy'addedBy'targetEntityNumberBlocking::class)]
  130.     private Collection $numberBlockings;
  131.     #[ORM\OneToMany(mappedBy'blockedBy'targetEntityNumberBlocking::class)]
  132.     private Collection $numberBlockingsBlocked;
  133.     #[ORM\ManyToOne(inversedBy'admins')]
  134.     private ?AdminDepartment $adminDepartment null;
  135.     #[ORM\Column]
  136.     private ?bool $acceptedRegulations null;
  137.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  138.     private ?\DateTimeInterface $acceptedRegulationsDate null;
  139.     #[ORM\Column]
  140.     private ?bool $acceptedZfss null;
  141.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  142.     private ?\DateTimeInterface $acceptedZfssDate null;
  143.     #[ORM\ManyToOne(inversedBy'admins')]
  144.     private ?EmploymentContractType $adminContractType null;
  145.     #[ORM\OneToMany(mappedBy'admin'targetEntityLeaveRequestBalance::class)]
  146.     private Collection $leaveRequestBalances;
  147.     #[ORM\OneToMany(mappedBy'createdBy'targetEntityAudioAsset::class)]
  148.     private Collection $audioAssets;
  149.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  150.     private ?string $mailFooter null;
  151.     #[ORM\Column]
  152.     private bool $disability false;
  153.     public function __construct()
  154.     {
  155.         $this->branches = new ArrayCollection();
  156.         $this->orderHistories = new ArrayCollection();
  157.         $this->notifications = new ArrayCollection();
  158.         $this->adminCode rand(000000999999);
  159.         $this->orderNotes = new ArrayCollection();
  160.         $this->implementerOrderHistories = new ArrayCollection();
  161.         $this->orderEditedNotes = new ArrayCollection();
  162.         $this->orders = new ArrayCollection();
  163.         $this->commercialOffers = new ArrayCollection();
  164.         $this->workHistories = new ArrayCollection();
  165.         $this->commercialOfferIndividuals = new ArrayCollection();
  166.         $this->commercialOfferSendings = new ArrayCollection();
  167.         $this->commercialOfferSendingsAccepts = new ArrayCollection();
  168.         $this->commercialOfferIndividualsAccepted = new ArrayCollection();
  169.         $this->reservations = new ArrayCollection();
  170.         $this->reservationsEdit = new ArrayCollection();
  171.         $this->directMessagesSent = new ArrayCollection();
  172.         $this->directMessagesReceived = new ArrayCollection();
  173.         $this->adminNotificationSettings = new ArrayCollection();
  174.         $this->debtNotes = new ArrayCollection();
  175.         $this->customerHistories = new ArrayCollection();
  176.         $this->products = new ArrayCollection();
  177.         $this->smsHistories = new ArrayCollection();
  178.         $this->notificationToSendSettings = new ArrayCollection();
  179.         $this->acceptedLeaveRequests = new ArrayCollection();
  180.         $this->rejectedLeaveRequests = new ArrayCollection();
  181.         $this->acceptedTasks = new ArrayCollection();
  182.         $this->position null;
  183.         $this->agreementsToSendAfterSigned = new ArrayCollection();
  184.         $this->acceptedWorkTimes = new ArrayCollection();
  185.         $this->accountingOfficeSendingNotes = new ArrayCollection();
  186.         $this->workTimes = new ArrayCollection();
  187.         $this->leaveRequests = new ArrayCollection();
  188.         $this->departments = new ArrayCollection();
  189.         $this->numberBlockings = new ArrayCollection();
  190.         $this->numberBlockingsBlocked = new ArrayCollection();
  191.         $this->acceptedZfss false;
  192.         $this->acceptedZfssDate null;
  193.         $this->leaveRequestBalances = new ArrayCollection();
  194.         $this->audioAssets = new ArrayCollection();
  195.     }
  196.     public function __toString()
  197.     {
  198.         return $this->firstName ' ' $this->lastName;
  199.     }
  200.     public function getFullName(): ?string
  201.     {
  202.         return $this->lastName ' ' $this->firstName;
  203.     }
  204.     public function getId(): ?int
  205.     {
  206.         return $this->id;
  207.     }
  208.     public function getEmail(): ?string
  209.     {
  210.         return $this->email;
  211.     }
  212.     public function setEmail(string $email): self
  213.     {
  214.         $this->email $email;
  215.         return $this;
  216.     }
  217.     /**
  218.      * A visual identifier that represents this admin.
  219.      *
  220.      * @see UserInterface
  221.      */
  222.     public function getUserIdentifier(): string
  223.     {
  224.         return (string) $this->email;
  225.     }
  226.     /**
  227.      * @see UserInterface
  228.      */
  229.     public function getRoles(): array
  230.     {
  231.         $roles $this->roles;
  232.         // guarantee every user at least has ROLE_USER
  233.         $roles[] = 'ROLE_USER';
  234.         return array_unique($roles);
  235.     }
  236.     public function setRoles(array $roles): self
  237.     {
  238.         $this->roles $roles;
  239.         return $this;
  240.     }
  241.     /**
  242.      * @see PasswordAuthenticatedUserInterface
  243.      */
  244.     public function getPassword(): string
  245.     {
  246.         return $this->password;
  247.     }
  248.     public function setPassword(string $password): self
  249.     {
  250.         $this->password $password;
  251.         return $this;
  252.     }
  253.     /**
  254.      * @return string
  255.      */
  256.     public function getFirstName(): string
  257.     {
  258.         return $this->firstName;
  259.     }
  260.     /**
  261.      * @param string $firstName
  262.      */
  263.     public function setFirstName(string $firstName): void
  264.     {
  265.         $this->firstName $firstName;
  266.     }
  267.     /**
  268.      * @return string
  269.      */
  270.     public function getLastName(): string
  271.     {
  272.         return $this->lastName;
  273.     }
  274.     /**
  275.      * @param string $lastName
  276.      */
  277.     public function setLastName(string $lastName): void
  278.     {
  279.         $this->lastName $lastName;
  280.     }
  281.     public function getPhone(): ?string
  282.     {
  283.         return $this->phone;
  284.     }
  285.     public function setPhone(?string $phone): self
  286.     {
  287.         $this->phone $phone;
  288.         return $this;
  289.     }
  290.     public function getLineNumber(): ?string
  291.     {
  292.         return $this->lineNumber;
  293.     }
  294.     public function setLineNumber(?string $lineNumber): self
  295.     {
  296.         $this->lineNumber $lineNumber;
  297.         return $this;
  298.     }
  299.     /**
  300.      * @return bool
  301.      */
  302.     public function isActive(): bool
  303.     {
  304.         return $this->isActive;
  305.     }
  306.     /**
  307.      * @param bool $isActive
  308.      */
  309.     public function setIsActive(bool $isActive): void
  310.     {
  311.         $this->isActive $isActive;
  312.     }
  313.     /**
  314.      * @see UserInterface
  315.      */
  316.     public function eraseCredentials()
  317.     {
  318.         // If you store any temporary, sensitive data on the user, clear it here
  319.         // $this->plainPassword = null;
  320.     }
  321.     /**
  322.      * @return Collection
  323.      */
  324.     public function getBranches(): Collection
  325.     {
  326.         return $this->branches;
  327.     }
  328.     public function addBranch(Branch $branches): self
  329.     {
  330.         if (!$this->branches->contains($branches)) {
  331.             $this->branches[] = $branches;
  332.         }
  333.         return $this;
  334.     }
  335.     public function removeBranch(Branch $branches): self
  336.     {
  337.         $this->branches->removeElement($branches);
  338.         return $this;
  339.     }
  340.     public function getWorker(): ?Worker
  341.     {
  342.         return $this->worker;
  343.     }
  344.     public function setWorker(?Worker $worker): self
  345.     {
  346.         // unset the owning side of the relation if necessary
  347.         if ($worker === null && $this->worker !== null) {
  348.             $this->worker->setAdmin(null);
  349.         }
  350.         // set the owning side of the relation if necessary
  351.         if ($worker !== null && $worker->getAdmin() !== $this) {
  352.             $worker->setAdmin($this);
  353.         }
  354.         $this->worker $worker;
  355.         return $this;
  356.     }
  357.     public function getImplementer(): ?Implementer
  358.     {
  359.         return $this->implementer;
  360.     }
  361.     public function setImplementer(Implementer $implementer): self
  362.     {
  363.         // set the owning side of the relation if necessary
  364.         if ($implementer->getAdmin() !== $this) {
  365.             $implementer->setAdmin($this);
  366.         }
  367.         $this->implementer $implementer;
  368.         return $this;
  369.     }
  370.     /**
  371.      * @return Collection<int, OrderHistory>
  372.      */
  373.     public function getOrderHistories(): Collection
  374.     {
  375.         return $this->orderHistories;
  376.     }
  377.     public function addOrderHistory(OrderHistory $orderHistory): self
  378.     {
  379.         if (!$this->orderHistories->contains($orderHistory)) {
  380.             $this->orderHistories->add($orderHistory);
  381.             $orderHistory->setAdmin($this);
  382.         }
  383.         return $this;
  384.     }
  385.     public function removeOrderHistory(OrderHistory $orderHistory): self
  386.     {
  387.         if ($this->orderHistories->removeElement($orderHistory)) {
  388.             // set the owning side to null (unless already changed)
  389.             if ($orderHistory->getAdmin() === $this) {
  390.                 $orderHistory->setAdmin(null);
  391.             }
  392.         }
  393.         return $this;
  394.     }
  395.     // logs out the user when isActive status has been changed
  396.     public function isEqualTo(Admin|UserInterface $user): bool
  397.     {
  398.         if (!$user->isActive()) {
  399.             return false;
  400.         }
  401.         return true;
  402.     }
  403.     /**
  404.      * @return string|null
  405.      */
  406.     public function getColor(): ?string
  407.     {
  408.         return $this->color;
  409.     }
  410.     /**
  411.      * @param string|null $color
  412.      */
  413.     public function setColor(?string $color): void
  414.     {
  415.         $this->color $color;
  416.     }
  417.     /**
  418.      * @return Collection<int, Notification>
  419.      */
  420.     public function getNotifications(): Collection
  421.     {
  422.         return $this->notifications;
  423.     }
  424.     public function addNotification(Notification $notification): static
  425.     {
  426.         if (!$this->notifications->contains($notification)) {
  427.             $this->notifications->add($notification);
  428.             $notification->addAdmin($this);
  429.         }
  430.         return $this;
  431.     }
  432.     public function removeNotification(Notification $notification): static
  433.     {
  434.         if ($this->notifications->removeElement($notification)) {
  435.             $notification->removeAdmin($this);
  436.         }
  437.         return $this;
  438.     }
  439.     public function getAdminCode(): ?string
  440.     {
  441.         return $this->adminCode;
  442.     }
  443.     public function setAdminCode(): static
  444.     {
  445.         $characters '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';
  446.         $code '';
  447.         for ($i 0$i 6$i++) {
  448.             $code .= $characters[random_int(0strlen($characters) - 1)];
  449.         }
  450.         $this->adminCode $code;
  451.         return $this;
  452.     }
  453.     /**
  454.      * @return Collection<int, OrderNote>
  455.      */
  456.     public function getOrderNotes(): Collection
  457.     {
  458.         return $this->orderNotes;
  459.     }
  460.     public function addOrderNote(OrderNote $orderNote): static
  461.     {
  462.         if (!$this->orderNotes->contains($orderNote)) {
  463.             $this->orderNotes->add($orderNote);
  464.             $orderNote->setAdmin($this);
  465.         }
  466.         return $this;
  467.     }
  468.     public function removeOrderNote(OrderNote $orderNote): static
  469.     {
  470.         if ($this->orderNotes->removeElement($orderNote)) {
  471.             // set the owning side to null (unless already changed)
  472.             if ($orderNote->getAdmin() === $this) {
  473.                 $orderNote->setAdmin(null);
  474.             }
  475.         }
  476.         return $this;
  477.     }
  478.     /**
  479.      * @return Collection<int, ImplementerOrderHistory>
  480.      */
  481.     public
  482.         function getImplementerOrderHistories(
  483.     ): Collection {
  484.         return $this->implementerOrderHistories;
  485.     }
  486.     public
  487.         function addImplementerOrderHistory(
  488.         ImplementerOrderHistory $implementerOrderHistory
  489.     ): static {
  490.         if (!$this->implementerOrderHistories->contains($implementerOrderHistory)) {
  491.             $this->implementerOrderHistories->add($implementerOrderHistory);
  492.             $implementerOrderHistory->setAdmin($this);
  493.         }
  494.         return $this;
  495.     }
  496.     public function removeImplementerOrderHistory(ImplementerOrderHistory $implementerOrderHistory): static
  497.     {
  498.         if ($this->implementerOrderHistories->removeElement($implementerOrderHistory)) {
  499.             // set the owning side to null (unless already changed)
  500.             if ($implementerOrderHistory->getAdmin() === $this) {
  501.                 $implementerOrderHistory->setAdmin(null);
  502.             }
  503.         }
  504.         return $this;
  505.     }
  506.     /**
  507.      * @return Collection<int, OrderNote>
  508.      */
  509.     public function getOrderEditedNotes(): Collection
  510.     {
  511.         return $this->orderEditedNotes;
  512.     }
  513.     public function addOrderEditedNote(OrderNote $orderEditedNote): static
  514.     {
  515.         if (!$this->orderEditedNotes->contains($orderEditedNote)) {
  516.             $this->orderEditedNotes->add($orderEditedNote);
  517.             $orderEditedNote->setLastEditedBy($this);
  518.         }
  519.         return $this;
  520.     }
  521.     public function removeOrderEditedNote(OrderNote $orderEditedNote): static
  522.     {
  523.         if ($this->orderEditedNotes->removeElement($orderEditedNote)) {
  524.             // set the owning side to null (unless already changed)
  525.             if ($orderEditedNote->getLastEditedBy() === $this) {
  526.                 $orderEditedNote->setLastEditedBy(null);
  527.             }
  528.         }
  529.         return $this;
  530.     }
  531.     /**
  532.      * @return Collection<int, Order>
  533.      */
  534.     public function getOrders(): Collection
  535.     {
  536.         return $this->orders;
  537.     }
  538.     public function addOrder(Order $order): static
  539.     {
  540.         if (!$this->orders->contains($order)) {
  541.             $this->orders->add($order);
  542.             $order->setAdmin($this);
  543.         }
  544.         return $this;
  545.     }
  546.     public function removeOrder(Order $order): static
  547.     {
  548.         if ($this->orders->removeElement($order)) {
  549.             // set the owning side to null (unless already changed)
  550.             if ($order->getAdmin() === $this) {
  551.                 $order->setAdmin(null);
  552.             }
  553.         }
  554.         return $this;
  555.     }
  556.     /**
  557.      * @return Collection<int, CommercialOffer>
  558.      */
  559.     public function getCommercialOffers(): Collection
  560.     {
  561.         return $this->commercialOffers;
  562.     }
  563.     public function addCommercialOffer(CommercialOffer $commercialOffer): static
  564.     {
  565.         if (!$this->commercialOffers->contains($commercialOffer)) {
  566.             $this->commercialOffers->add($commercialOffer);
  567.             $commercialOffer->setAddedBy($this);
  568.         }
  569.         return $this;
  570.     }
  571.     public function removeCommercialOffer(CommercialOffer $commercialOffer): static
  572.     {
  573.         if ($this->commercialOffers->removeElement($commercialOffer)) {
  574.             // set the owning side to null (unless already changed)
  575.             if ($commercialOffer->getAddedBy() === $this) {
  576.                 $commercialOffer->setAddedBy(null);
  577.             }
  578.         }
  579.         return $this;
  580.     }
  581.     /**
  582.      * @return Collection<int, WorkHistory>
  583.      */
  584.     public function getWorkHistories(): Collection
  585.     {
  586.         return $this->workHistories;
  587.     }
  588.     public function addWorkHistory(WorkHistory $workHistory): static
  589.     {
  590.         if (!$this->workHistories->contains($workHistory)) {
  591.             $this->workHistories->add($workHistory);
  592.             $workHistory->setAdmin($this);
  593.         }
  594.         return $this;
  595.     }
  596.     public function removeWorkHistory(WorkHistory $workHistory): static
  597.     {
  598.         if ($this->workHistories->removeElement($workHistory)) {
  599.             // set the owning side to null (unless already changed)
  600.             if ($workHistory->getAdmin() === $this) {
  601.                 $workHistory->setAdmin(null);
  602.             }
  603.         }
  604.         return $this;
  605.     }
  606.     /**
  607.      * @return Collection<int, CommercialOfferIndividual>
  608.      */
  609.     public function getCommercialOfferIndividuals(): Collection
  610.     {
  611.         return $this->commercialOfferIndividuals;
  612.     }
  613.     public function addCommercialOfferIndividual(CommercialOfferIndividual $commercialOfferIndividual): static
  614.     {
  615.         if (!$this->commercialOfferIndividuals->contains($commercialOfferIndividual)) {
  616.             $this->commercialOfferIndividuals->add($commercialOfferIndividual);
  617.             $commercialOfferIndividual->setCreatedByAdmin($this);
  618.         }
  619.         return $this;
  620.     }
  621.     public function removeCommercialOfferIndividual(CommercialOfferIndividual $commercialOfferIndividual): static
  622.     {
  623.         if ($this->commercialOfferIndividuals->removeElement($commercialOfferIndividual)) {
  624.             // set the owning side to null (unless already changed)
  625.             if ($commercialOfferIndividual->getCreatedByAdmin() === $this) {
  626.                 $commercialOfferIndividual->setCreatedByAdmin(null);
  627.             }
  628.         }
  629.         return $this;
  630.     }
  631.     /**
  632.      * @return Collection<int, AudioAsset>
  633.      */
  634.     public function getAudioAssets(): Collection
  635.     {
  636.         return $this->audioAssets;
  637.     }
  638.     public function addAudioAsset(AudioAsset $audioAsset): static
  639.     {
  640.         if (!$this->audioAssets->contains($audioAsset)) {
  641.             $this->audioAssets->add($audioAsset);
  642.             $audioAsset->setCreatedBy($this);
  643.         }
  644.         return $this;
  645.     }
  646.     public function removeAudioAsset(AudioAsset $audioAsset): static
  647.     {
  648.         if ($this->audioAssets->removeElement($audioAsset)) {
  649.             // set the owning side to null (unless already changed)
  650.             if ($audioAsset->getCreatedBy() === $this) {
  651.                 $audioAsset->setCreatedBy(null);
  652.             }
  653.         }
  654.         return $this;
  655.     }
  656.     /**
  657.      * @return Collection<int, CommercialOfferSendings>
  658.      */
  659.     public function getCommercialOfferSendings(): Collection
  660.     {
  661.         return $this->commercialOfferSendings;
  662.     }
  663.     public function addCommercialOfferSending(CommercialOfferSendings $commercialOfferSending): static
  664.     {
  665.         if (!$this->commercialOfferSendings->contains($commercialOfferSending)) {
  666.             $this->commercialOfferSendings->add($commercialOfferSending);
  667.             $commercialOfferSending->setAddedByAdmin($this);
  668.         }
  669.         return $this;
  670.     }
  671.     public function removeCommercialOfferSending(CommercialOfferSendings $commercialOfferSending): static
  672.     {
  673.         if ($this->commercialOfferSendings->removeElement($commercialOfferSending)) {
  674.             // set the owning side to null (unless already changed)
  675.             if ($commercialOfferSending->getAddedByAdmin() === $this) {
  676.                 $commercialOfferSending->setAddedByAdmin(null);
  677.             }
  678.         }
  679.         return $this;
  680.     }
  681.     /**
  682.      * @return Collection<int, CommercialOfferSendings>
  683.      */
  684.     public function getCommercialOfferSendingsAccepts(): Collection
  685.     {
  686.         return $this->commercialOfferSendingsAccepts;
  687.     }
  688.     /**
  689.      * @return Collection<int, CommercialOfferIndividual>
  690.      */
  691.     public function getCommercialOfferIndividualsAccepted(): Collection
  692.     {
  693.         return $this->commercialOfferIndividualsAccepted;
  694.     }
  695.     /**
  696.      * @return Collection<int, Reservations>
  697.      */
  698.     public function getReservations(): Collection
  699.     {
  700.         return $this->reservations;
  701.     }
  702.     public function addReservation(Reservations $reservation): static
  703.     {
  704.         if (!$this->reservations->contains($reservation)) {
  705.             $this->reservations->add($reservation);
  706.             $reservation->setAddedByAdmin($this);
  707.         }
  708.         return $this;
  709.     }
  710.     public function removeReservation(Reservations $reservation): static
  711.     {
  712.         if ($this->reservations->removeElement($reservation)) {
  713.             // set the owning side to null (unless already changed)
  714.             if ($reservation->getAddedByAdmin() === $this) {
  715.                 $reservation->setAddedByAdmin(null);
  716.             }
  717.         }
  718.         return $this;
  719.     }
  720.     /**
  721.      * @return Collection<int, Reservations>
  722.      */
  723.     public function getReservationsEdit(): Collection
  724.     {
  725.         return $this->reservationsEdit;
  726.     }
  727.     public function addReservationsEdit(Reservations $reservationsEdit): static
  728.     {
  729.         if (!$this->reservationsEdit->contains($reservationsEdit)) {
  730.             $this->reservationsEdit->add($reservationsEdit);
  731.             $reservationsEdit->setLastEditedBy($this);
  732.         }
  733.         return $this;
  734.     }
  735.     public function removeReservationsEdit(Reservations $reservationsEdit): static
  736.     {
  737.         if ($this->reservationsEdit->removeElement($reservationsEdit)) {
  738.             // set the owning side to null (unless already changed)
  739.             if ($reservationsEdit->getLastEditedBy() === $this) {
  740.                 $reservationsEdit->setLastEditedBy(null);
  741.             }
  742.         }
  743.         return $this;
  744.     }
  745.     /**
  746.      * @return Collection<int, DirectMessage>
  747.      */
  748.     public function getDirectMessagesSent(): Collection
  749.     {
  750.         return $this->directMessagesSent;
  751.     }
  752.     public function addDirectMessagesSent(DirectMessage $directMessagesSent): static
  753.     {
  754.         if (!$this->directMessagesSent->contains($directMessagesSent)) {
  755.             $this->directMessagesSent->add($directMessagesSent);
  756.             $directMessagesSent->setSenderAdmin($this);
  757.         }
  758.         return $this;
  759.     }
  760.     public function removeDirectMessagesSent(DirectMessage $directMessagesSent): static
  761.     {
  762.         if ($this->directMessagesSent->removeElement($directMessagesSent)) {
  763.             // set the owning side to null (unless already changed)
  764.             if ($directMessagesSent->getSenderAdmin() === $this) {
  765.                 $directMessagesSent->setSenderAdmin(null);
  766.             }
  767.         }
  768.         return $this;
  769.     }
  770.     /**
  771.      * @return Collection<int, DirectMessage>
  772.      */
  773.     public function getDirectMessagesReceived(): Collection
  774.     {
  775.         return $this->directMessagesReceived;
  776.     }
  777.     public function addDirectMessagesReceived(DirectMessage $directMessagesReceived): static
  778.     {
  779.         if (!$this->directMessagesReceived->contains($directMessagesReceived)) {
  780.             $this->directMessagesReceived->add($directMessagesReceived);
  781.             $directMessagesReceived->setReceiverAdmin($this);
  782.         }
  783.         return $this;
  784.     }
  785.     public function removeDirectMessagesReceived(DirectMessage $directMessagesReceived): static
  786.     {
  787.         if ($this->directMessagesReceived->removeElement($directMessagesReceived)) {
  788.             // set the owning side to null (unless already changed)
  789.             if ($directMessagesReceived->getReceiverAdmin() === $this) {
  790.                 $directMessagesReceived->setReceiverAdmin(null);
  791.             }
  792.         }
  793.         return $this;
  794.     }
  795.     public function isRemoteAccess(): ?bool
  796.     {
  797.         return $this->remoteAccess;
  798.     }
  799.     public function setRemoteAccess(bool $remoteAccess): static
  800.     {
  801.         $this->remoteAccess $remoteAccess;
  802.         return $this;
  803.     }
  804.     /**
  805.      * @return Collection<int, AdminNotificationSettings>
  806.      */
  807.     public function getAdminNotificationSettings(): Collection
  808.     {
  809.         return $this->adminNotificationSettings;
  810.     }
  811.     public function addAdminNotificationSetting(AdminNotificationSettings $adminNotificationSetting): static
  812.     {
  813.         if (!$this->adminNotificationSettings->contains($adminNotificationSetting)) {
  814.             $this->adminNotificationSettings->add($adminNotificationSetting);
  815.             $adminNotificationSetting->setAdmin($this);
  816.         }
  817.         return $this;
  818.     }
  819.     public function removeAdminNotificationSetting(AdminNotificationSettings $adminNotificationSetting): static
  820.     {
  821.         if ($this->adminNotificationSettings->removeElement($adminNotificationSetting)) {
  822.             // set the owning side to null (unless already changed)
  823.             if ($adminNotificationSetting->getAdmin() === $this) {
  824.                 $adminNotificationSetting->setAdmin(null);
  825.             }
  826.         }
  827.         return $this;
  828.     }
  829.     /**
  830.      * @return Collection<int, DebtNote>
  831.      */
  832.     public function getDebtNotes(): Collection
  833.     {
  834.         return $this->debtNotes;
  835.     }
  836.     public function addDebtNote(DebtNote $debtNote): static
  837.     {
  838.         if (!$this->debtNotes->contains($debtNote)) {
  839.             $this->debtNotes->add($debtNote);
  840.             $debtNote->setAdmin($this);
  841.         }
  842.         return $this;
  843.     }
  844.     public function removeDebtNote(DebtNote $debtNote): static
  845.     {
  846.         if ($this->debtNotes->removeElement($debtNote)) {
  847.             // set the owning side to null (unless already changed)
  848.             if ($debtNote->getAdmin() === $this) {
  849.                 $debtNote->setAdmin(null);
  850.             }
  851.         }
  852.         return $this;
  853.     }
  854.     /**
  855.      * @return Collection<int, CustomerHistory>
  856.      */
  857.     public function getCustomerHistories(): Collection
  858.     {
  859.         return $this->customerHistories;
  860.     }
  861.     public function addCustomerHistory(CustomerHistory $customerHistory): static
  862.     {
  863.         if (!$this->customerHistories->contains($customerHistory)) {
  864.             $this->customerHistories->add($customerHistory);
  865.             $customerHistory->setAdmin($this);
  866.         }
  867.         return $this;
  868.     }
  869.     public function removeCustomerHistory(CustomerHistory $customerHistory): static
  870.     {
  871.         if ($this->customerHistories->removeElement($customerHistory)) {
  872.             // set the owning side to null (unless already changed)
  873.             if ($customerHistory->getAdmin() === $this) {
  874.                 $customerHistory->setAdmin(null);
  875.             }
  876.         }
  877.         return $this;
  878.     }
  879.     public function getPhoto(): ?string
  880.     {
  881.         return $this->photo;
  882.     }
  883.     public function setPhoto(?string $photo): static
  884.     {
  885.         $this->photo $photo;
  886.         return $this;
  887.     }
  888.     public function isSendMail(): bool
  889.     {
  890.         return $this->sendMail;
  891.     }
  892.     public function setSendMail(bool $sendMail): static
  893.     {
  894.         $this->sendMail $sendMail;
  895.         return $this;
  896.     }
  897.     /**
  898.      * @return Collection<int, Product>
  899.      */
  900.     public function getProducts(): Collection
  901.     {
  902.         return $this->products;
  903.     }
  904.     public function addProduct(Product $product): static
  905.     {
  906.         if (!$this->products->contains($product)) {
  907.             $this->products->add($product);
  908.             $product->addAdminToInfo($this);
  909.         }
  910.         return $this;
  911.     }
  912.     public function removeProduct(Product $product): static
  913.     {
  914.         if ($this->products->removeElement($product)) {
  915.             $product->removeAdminToInfo($this);
  916.         }
  917.         return $this;
  918.     }
  919.     /**
  920.      * @return Collection<int, SmsHistory>
  921.      */
  922.     public function getSmsHistories(): Collection
  923.     {
  924.         return $this->smsHistories;
  925.     }
  926.     public function addSmsHistory(SmsHistory $smsHistory): static
  927.     {
  928.         if (!$this->smsHistories->contains($smsHistory)) {
  929.             $this->smsHistories->add($smsHistory);
  930.             $smsHistory->setSendByAdmin($this);
  931.         }
  932.         return $this;
  933.     }
  934.     public function removeSmsHistory(SmsHistory $smsHistory): static
  935.     {
  936.         if ($this->smsHistories->removeElement($smsHistory)) {
  937.             // set the owning side to null (unless already changed)
  938.             if ($smsHistory->getSendByAdmin() === $this) {
  939.                 $smsHistory->setSendByAdmin(null);
  940.             }
  941.         }
  942.         return $this;
  943.     }
  944.     /**
  945.      * @return Collection<int, NotificationToSendSetting>
  946.      */
  947.     public function getNotificationToSendSettings(): Collection
  948.     {
  949.         return $this->notificationToSendSettings;
  950.     }
  951.     public function addNotificationToSendSetting(NotificationToSendSetting $notificationToSendSetting): static
  952.     {
  953.         if (!$this->notificationToSendSettings->contains($notificationToSendSetting)) {
  954.             $this->notificationToSendSettings->add($notificationToSendSetting);
  955.             $notificationToSendSetting->addAdmin($this);
  956.         }
  957.         return $this;
  958.     }
  959.     public function removeNotificationToSendSetting(NotificationToSendSetting $notificationToSendSetting): static
  960.     {
  961.         if ($this->notificationToSendSettings->removeElement($notificationToSendSetting)) {
  962.             $notificationToSendSetting->removeAdmin($this);
  963.         }
  964.         return $this;
  965.     }
  966.     public function getMailbox(): ?Mailbox
  967.     {
  968.         return $this->mailbox;
  969.     }
  970.     public function setMailbox(?Mailbox $mailbox): static
  971.     {
  972.         // unset the owning side of the relation if necessary
  973.         if ($mailbox === null && $this->mailbox !== null) {
  974.             $this->mailbox->setAdmin(null);
  975.         }
  976.         // set the owning side of the relation if necessary
  977.         if ($mailbox !== null && $mailbox->getAdmin() !== $this) {
  978.             $mailbox->setAdmin($this);
  979.         }
  980.         $this->mailbox $mailbox;
  981.         return $this;
  982.     }
  983.     /**
  984.      * @return Collection<int, LeaveRequest>
  985.      */
  986.     public function getAcceptedLeaveRequests(): Collection
  987.     {
  988.         return $this->acceptedLeaveRequests;
  989.     }
  990.     public function addAcceptedLeaveRequest(LeaveRequest $acceptedLeaveRequest): static
  991.     {
  992.         if (!$this->acceptedLeaveRequests->contains($acceptedLeaveRequest)) {
  993.             $this->acceptedLeaveRequests->add($acceptedLeaveRequest);
  994.             $acceptedLeaveRequest->setAcceptedBy($this);
  995.         }
  996.         return $this;
  997.     }
  998.     public function removeAcceptedLeaveRequest(LeaveRequest $acceptedLeaveRequest): static
  999.     {
  1000.         if ($this->acceptedLeaveRequests->removeElement($acceptedLeaveRequest)) {
  1001.             // set the owning side to null (unless already changed)
  1002.             if ($acceptedLeaveRequest->getAcceptedBy() === $this) {
  1003.                 $acceptedLeaveRequest->setAcceptedBy(null);
  1004.             }
  1005.         }
  1006.         return $this;
  1007.     }
  1008.     /**
  1009.      * @return Collection<int, LeaveRequest>
  1010.      */
  1011.     public function getRejectedLeaveRequests(): Collection
  1012.     {
  1013.         return $this->rejectedLeaveRequests;
  1014.     }
  1015.     public function addRejectedLeaveRequest(LeaveRequest $rejectedLeaveRequest): static
  1016.     {
  1017.         if (!$this->rejectedLeaveRequests->contains($rejectedLeaveRequest)) {
  1018.             $this->rejectedLeaveRequests->add($rejectedLeaveRequest);
  1019.             $rejectedLeaveRequest->setRejectedBy($this);
  1020.         }
  1021.         return $this;
  1022.     }
  1023.     public function removeRejectedLeaveRequest(LeaveRequest $rejectedLeaveRequest): static
  1024.     {
  1025.         if ($this->rejectedLeaveRequests->removeElement($rejectedLeaveRequest)) {
  1026.             // set the owning side to null (unless already changed)
  1027.             if ($rejectedLeaveRequest->getRejectedBy() === $this) {
  1028.                 $rejectedLeaveRequest->setRejectedBy(null);
  1029.             }
  1030.         }
  1031.         return $this;
  1032.     }
  1033.     /**
  1034.      * @return Collection<int, Task>
  1035.      */
  1036.     public function getAcceptedTasks(): Collection
  1037.     {
  1038.         return $this->acceptedTasks;
  1039.     }
  1040.     public function addAcceptedTask(Task $acceptedTask): static
  1041.     {
  1042.         if (!$this->acceptedTasks->contains($acceptedTask)) {
  1043.             $this->acceptedTasks->add($acceptedTask);
  1044.             $acceptedTask->setAcceptedBy($this);
  1045.         }
  1046.         return $this;
  1047.     }
  1048.     public function removeAcceptedTask(Task $acceptedTask): static
  1049.     {
  1050.         if ($this->acceptedTasks->removeElement($acceptedTask)) {
  1051.             // set the owning side to null (unless already changed)
  1052.             if ($acceptedTask->getAcceptedBy() === $this) {
  1053.                 $acceptedTask->setAcceptedBy(null);
  1054.             }
  1055.         }
  1056.         return $this;
  1057.     }
  1058.     public function getPosition(): ?Position
  1059.     {
  1060.         return $this->position;
  1061.     }
  1062.     public function setPosition(?Position $position): static
  1063.     {
  1064.         $this->position $position;
  1065.         return $this;
  1066.     }
  1067.     /**
  1068.      * @return Collection<int, Agreement>
  1069.      */
  1070.     public function getAgreementsToSendAfterSigned(): Collection
  1071.     {
  1072.         return $this->agreementsToSendAfterSigned;
  1073.     }
  1074.     public function addAgreementsToSendAfterSigned(Agreement $agreementsToSendAfterSigned): static
  1075.     {
  1076.         if (!$this->agreementsToSendAfterSigned->contains($agreementsToSendAfterSigned)) {
  1077.             $this->agreementsToSendAfterSigned->add($agreementsToSendAfterSigned);
  1078.             $agreementsToSendAfterSigned->addAgreementToSendAfterSigned($this);
  1079.         }
  1080.         return $this;
  1081.     }
  1082.     public function removeAgreementsToSendAfterSigned(Agreement $agreementsToSendAfterSigned): static
  1083.     {
  1084.         if ($this->agreementsToSendAfterSigned->removeElement($agreementsToSendAfterSigned)) {
  1085.             $agreementsToSendAfterSigned->removeAgreementToSendAfterSigned($this);
  1086.         }
  1087.         return $this;
  1088.     }
  1089.     /**
  1090.      * @return Collection<int, WorkTime>
  1091.      */
  1092.     public function getWorkTimes(): Collection
  1093.     {
  1094.         return $this->workTimes;
  1095.     }
  1096.     public function addWorkTime(WorkTime $workTime): static
  1097.     {
  1098.         if (!$this->workTimes->contains($workTime)) {
  1099.             $this->workTimes->add($workTime);
  1100.             $workTime->setAdminInstance($this);
  1101.         }
  1102.         return $this;
  1103.     }
  1104.     public function removeWorkTime(WorkTime $workTime): static
  1105.     {
  1106.         if ($this->workTimes->removeElement($workTime)) {
  1107.             // set the owning side to null (unless already changed)
  1108.             if ($workTime->getAdmin() === $this) {
  1109.                 $workTime->setAdmin(null);
  1110.             }
  1111.         }
  1112.         return $this;
  1113.     }
  1114.     public function getNominalWorkTime(): ?NominalWorkTime
  1115.     {
  1116.         return $this->nominalWorkTime;
  1117.     }
  1118.     public function setNominalWorkTime(?NominalWorkTime $nominalWorkTime): static
  1119.     {
  1120.         $this->nominalWorkTime $nominalWorkTime;
  1121.         return $this;
  1122.     }
  1123.     /**
  1124.      * @return Collection<int, LeaveRequest>
  1125.      */
  1126.     public function getLeaveRequests(): Collection
  1127.     {
  1128.         return $this->leaveRequests;
  1129.     }
  1130.     public function getLeaveRequestsFrom2026(): Collection
  1131.     {
  1132.         return $this->leaveRequests->filter(function (LeaveRequest $lr) {
  1133.             return $lr->getStartTime() >= new DateTimeImmutable('2026-01-01 00:00:00');
  1134.         });
  1135.     }
  1136.     public function addLeaveRequest(LeaveRequest $leaveRequest): static
  1137.     {
  1138.         if (!$this->leaveRequests->contains($leaveRequest)) {
  1139.             $this->leaveRequests->add($leaveRequest);
  1140.             $leaveRequest->setAdmin($this);
  1141.         }
  1142.         return $this;
  1143.     }
  1144.     public function removeLeaveRequest(LeaveRequest $leaveRequest): static
  1145.     {
  1146.         if ($this->leaveRequests->removeElement($leaveRequest)) {
  1147.             // set the owning side to null (unless already changed)
  1148.             if ($leaveRequest->getAdmin() === $this) {
  1149.                 $leaveRequest->setAdmin(null);
  1150.             }
  1151.         }
  1152.         return $this;
  1153.     }
  1154.     /**
  1155.      * @return Collection<int, AccountingOfficeSendingNote>
  1156.      */
  1157.     public function getAccountingOfficeSendingNotes(): Collection
  1158.     {
  1159.         return $this->accountingOfficeSendingNotes;
  1160.     }
  1161.     public function addAccountingOfficeSendingNote(AccountingOfficeSendingNote $accountingOfficeSendingNote): static
  1162.     {
  1163.         if (!$this->accountingOfficeSendingNotes->contains($accountingOfficeSendingNote)) {
  1164.             $this->accountingOfficeSendingNotes->add($accountingOfficeSendingNote);
  1165.             $accountingOfficeSendingNote->setAdmin($this);
  1166.         }
  1167.         return $this;
  1168.     }
  1169.     public function removeAccountingOfficeSendingNote(AccountingOfficeSendingNote $accountingOfficeSendingNote): static
  1170.     {
  1171.         if ($this->accountingOfficeSendingNotes->removeElement($accountingOfficeSendingNote)) {
  1172.             // set the owning side to null (unless already changed)
  1173.             if ($accountingOfficeSendingNote->getAdmin() === $this) {
  1174.                 $accountingOfficeSendingNote->setAdmin(null);
  1175.             }
  1176.         }
  1177.         return $this;
  1178.     }
  1179.     public function isToRcp(): bool
  1180.     {
  1181.         return $this->toRcp;
  1182.     }
  1183.     public function setToRcp(bool $toRcp): void
  1184.     {
  1185.         $this->toRcp $toRcp;
  1186.     }
  1187.     /**
  1188.      * @return Collection<int, WorkTime>
  1189.      */
  1190.     public function getAcceptedWorkTimes(): Collection
  1191.     {
  1192.         return $this->acceptedWorkTimes;
  1193.     }
  1194.     public function addAcceptedWorkTime(WorkTime $acceptedWorkTime): static
  1195.     {
  1196.         if (!$this->acceptedWorkTimes->contains($acceptedWorkTime)) {
  1197.             $this->acceptedWorkTimes->add($acceptedWorkTime);
  1198.             $acceptedWorkTime->setAcceptedBy($this);
  1199.         }
  1200.         return $this;
  1201.     }
  1202.     public function removeAcceptedWorkTime(WorkTime $acceptedWorkTime): static
  1203.     {
  1204.         if ($this->acceptedWorkTimes->removeElement($acceptedWorkTime)) {
  1205.             // set the owning side to null (unless already changed)
  1206.             if ($acceptedWorkTime->getAcceptedBy() === $this) {
  1207.                 $acceptedWorkTime->setAcceptedBy(null);
  1208.             }
  1209.         }
  1210.         return $this;
  1211.     }
  1212.     /**
  1213.      * @return Collection<int, Department>
  1214.      */
  1215.     public function getDepartments(): Collection
  1216.     {
  1217.         return $this->departments;
  1218.     }
  1219.     public function addDepartment(Department $department): static
  1220.     {
  1221.         if (!$this->departments->contains($department)) {
  1222.             $this->departments->add($department);
  1223.             $department->addManagement($this);
  1224.         }
  1225.         return $this;
  1226.     }
  1227.     public function removeDepartment(Department $department): static
  1228.     {
  1229.         if ($this->departments->removeElement($department)) {
  1230.             $department->removeManagement($this);
  1231.         }
  1232.         return $this;
  1233.     }
  1234.     /** @return Collection<int, NumberBlocking> */
  1235.     public function getNumberBlockings(): Collection
  1236.     {
  1237.         return $this->numberBlockings;
  1238.     }
  1239.     public function addNumberBlocking(NumberBlocking $nb): self
  1240.     {
  1241.         if (!$this->numberBlockings->contains($nb)) {
  1242.             $this->numberBlockings->add($nb);
  1243.             $nb->setAddedBy($this);
  1244.         }
  1245.         return $this;
  1246.     }
  1247.     public function removeNumberBlocking(NumberBlocking $nb): self
  1248.     {
  1249.         if ($this->numberBlockings->removeElement($nb)) {
  1250.             if ($nb->getAddedBy() === $this) {
  1251.                 $nb->setAddedBy(null);
  1252.             }
  1253.         }
  1254.         return $this;
  1255.     }
  1256.     /** @return Collection<int, NumberBlocking> */
  1257.     public function getNumberBlockingsBlocked(): Collection
  1258.     {
  1259.         return $this->numberBlockingsBlocked;
  1260.     }
  1261.     public function addNumberBlockingBlocked(NumberBlocking $nb): self
  1262.     {
  1263.         if (!$this->numberBlockingsBlocked->contains($nb)) {
  1264.             $this->numberBlockingsBlocked->add($nb);
  1265.             $nb->setBlockedBy($this);
  1266.         }
  1267.         return $this;
  1268.     }
  1269.     public function removeNumberBlockingBlocked(NumberBlocking $nb): self
  1270.     {
  1271.         if ($this->numberBlockingsBlocked->removeElement($nb)) {
  1272.             if ($nb->getBlockedBy() === $this) {
  1273.                 $nb->setBlockedBy(null);
  1274.             }
  1275.         }
  1276.         return $this;
  1277.     }
  1278.     public function getAdminDepartment(): ?AdminDepartment
  1279.     {
  1280.         return $this->adminDepartment;
  1281.     }
  1282.     public function setAdminDepartment(?AdminDepartment $adminDepartment): static
  1283.     {
  1284.         $this->adminDepartment $adminDepartment;
  1285.         return $this;
  1286.     }
  1287.     public function isAcceptedRegulations(): ?bool
  1288.     {
  1289.         return $this->acceptedRegulations;
  1290.     }
  1291.     public function setAcceptedRegulations(bool $acceptedRegulations): static
  1292.     {
  1293.         $this->acceptedRegulations $acceptedRegulations;
  1294.         return $this;
  1295.     }
  1296.     public function getAcceptedRegulationsDate(): ?\DateTimeInterface
  1297.     {
  1298.         return $this->acceptedRegulationsDate;
  1299.     }
  1300.     public function setAcceptedRegulationsDate(?\DateTimeInterface $acceptedRegulationsDate): static
  1301.     {
  1302.         $this->acceptedRegulationsDate $acceptedRegulationsDate;
  1303.         return $this;
  1304.     }
  1305.     public function isAcceptedZfss(): ?bool
  1306.     {
  1307.         return $this->acceptedZfss;
  1308.     }
  1309.     public function setAcceptedZfss(bool $acceptedZfss): static
  1310.     {
  1311.         $this->acceptedZfss $acceptedZfss;
  1312.         return $this;
  1313.     }
  1314.     public function getAcceptedZfssDate(): ?\DateTimeInterface
  1315.     {
  1316.         return $this->acceptedZfssDate;
  1317.     }
  1318.     public function setAcceptedZfssDate(?\DateTimeInterface $acceptedZfssDate): static
  1319.     {
  1320.         $this->acceptedZfssDate $acceptedZfssDate;
  1321.         return $this;
  1322.     }
  1323.     public function getAdminContractType(): ?EmploymentContractType
  1324.     {
  1325.         return $this->adminContractType;
  1326.     }
  1327.     public function setAdminContractType(?EmploymentContractType $adminContractType): static
  1328.     {
  1329.         $this->adminContractType $adminContractType;
  1330.         return $this;
  1331.     }
  1332.     /**
  1333.      * @return Collection<int, LeaveRequestBalance>
  1334.      */
  1335.     public function getLeaveRequestBalances(): Collection
  1336.     {
  1337.         return $this->leaveRequestBalances;
  1338.     }
  1339.     public function addLeaveRequestBalance(LeaveRequestBalance $leaveRequestBalance): static
  1340.     {
  1341.         if (!$this->leaveRequestBalances->contains($leaveRequestBalance)) {
  1342.             $this->leaveRequestBalances->add($leaveRequestBalance);
  1343.             $leaveRequestBalance->setAdmin($this);
  1344.         }
  1345.         return $this;
  1346.     }
  1347.     public function removeLeaveRequestBalance(LeaveRequestBalance $leaveRequestBalance): static
  1348.     {
  1349.         if ($this->leaveRequestBalances->removeElement($leaveRequestBalance)) {
  1350.             // set the owning side to null (unless already changed)
  1351.             if ($leaveRequestBalance->getAdmin() === $this) {
  1352.                 $leaveRequestBalance->setAdmin(null);
  1353.             }
  1354.         }
  1355.         return $this;
  1356.     }
  1357.     public function getMailFooter(): ?string
  1358.     {
  1359.         return $this->mailFooter;
  1360.     }
  1361.     public function setMailFooter(?string $mailFooter): static
  1362.     {
  1363.         $this->mailFooter $mailFooter;
  1364.         return $this;
  1365.     }
  1366.     public function getTodayWorkTimeFromLoadedCollection(): ?WorkTime
  1367.     {
  1368.         $today = (new DateTimeImmutable('today'))->format('Y-m-d');
  1369.         foreach ($this->getWorkTimes() as $workTime) {
  1370.             if ($workTime->getWorkDate()?->format('Y-m-d') === $today) {
  1371.                 return $workTime;
  1372.             }
  1373.         }
  1374.         return null;
  1375.     }
  1376.     public function isDisability(): bool
  1377.     {
  1378.         return $this->disability;
  1379.     }
  1380.     public function setDisability(bool $disability): void
  1381.     {
  1382.         $this->disability $disability;
  1383.     }
  1384. }