src/Entity/CRM/Admin.php line 30
<?phpnamespace App\Entity\CRM;use App\Entity\CRM\Notification;use App\Entity\CRM\NotificationToSendSetting;use App\Entity\CRM\Order;use App\Entity\CRM\OrderHistory;use App\Entity\CRM\OrderNote;use App\Entity\CRM\Position;use App\Entity\CRM\Product;use App\Entity\CRM\Reservations;use App\Entity\CRM\SmsHistory;use App\Entity\CRM\Task;use App\Entity\CRM\Worker;use App\Entity\CRM\WorkHistory;use App\Repository\AdminRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;use Symfony\Component\Security\Core\User\EquatableInterface;use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;use Symfony\Component\Security\Core\User\UserInterface;#[ORM\Entity(repositoryClass: AdminRepository::class)]#[ORM\Table(name: '`admin`')]#[UniqueEntity(fields: ['email'], message: 'Konto o takim adresie email już istnieje')]class Admin implements UserInterface, PasswordAuthenticatedUserInterface, EquatableInterface{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 180, unique: true)]private ?string $email = null;#[ORM\Column(type: "string", nullable: false)]private string $firstName;#[ORM\Column(type: "string", nullable: false)]private string $lastName;#[ORM\Column(type: "boolean", nullable: false)]private bool $isActive = true;#[ORM\Column]private array $roles = [];/*** @var string The hashed password*/#[ORM\Column]private string $password;#[ORM\ManyToMany(targetEntity: Branch::class, inversedBy: 'admins')]#[ORM\JoinColumn(nullable: false)]private Collection $branches;#[ORM\OneToOne(mappedBy: 'admin')]private ?Worker $worker = null;#[ORM\OneToOne(mappedBy: 'admin', cascade: ['persist', 'remove'])]private ?Implementer $implementer = null;#[ORM\OneToMany(mappedBy: 'admin', targetEntity: OrderHistory::class)]private Collection $orderHistories;#[ORM\Column(length: 255, nullable: true)]private ?string $color = null;#[ORM\ManyToMany(targetEntity: Notification::class, mappedBy: 'admin')]private Collection $notifications;#[ORM\Column(length: 6, nullable: true)]private ?string $adminCode;#[ORM\OneToMany(mappedBy: 'admin', targetEntity: OrderNote::class)]private Collection $orderNotes;#[ORM\OneToMany(mappedBy: 'admin', targetEntity: ImplementerOrderHistory::class)]private Collection $implementerOrderHistories;#[ORM\OneToMany(mappedBy: 'lastEditedBy', targetEntity: OrderNote::class)]private Collection $orderEditedNotes;#[ORM\OneToMany(mappedBy: 'admin', targetEntity: Order::class)]private Collection $orders;#[ORM\OneToMany(mappedBy: 'addedBy', targetEntity: CommercialOffer::class)]private Collection $commercialOffers;#[ORM\OneToMany(mappedBy: 'admin', targetEntity: WorkHistory::class)]private Collection $workHistories;#[ORM\OneToMany(mappedBy: 'createdByAdmin', targetEntity: CommercialOfferIndividual::class)]private Collection $commercialOfferIndividuals;#[ORM\OneToMany(mappedBy: 'addedByAdmin', targetEntity: CommercialOfferSendings::class)]private Collection $commercialOfferSendings;// #[ORM\OneToMany(mappedBy: 'acceptedBy', targetEntity: CommercialOfferSendings::class)]// private Collection $commercialOfferSendingsAccepts;//// #[ORM\OneToMany(mappedBy: 'acceptedBy', targetEntity: CommercialOfferIndividual::class)]// private Collection $commercialOfferIndividualsAccepted;#[ORM\OneToMany(mappedBy: 'addedByAdmin', targetEntity: Reservations::class)]private Collection $reservations;#[ORM\OneToMany(mappedBy: 'lastEditedBy', targetEntity: Reservations::class)]private Collection $reservationsEdit;#[ORM\OneToMany(mappedBy: 'senderAdmin', targetEntity: DirectMessage::class)]private Collection $directMessagesSent;#[ORM\OneToMany(mappedBy: 'receiverAdmin', targetEntity: DirectMessage::class)]private Collection $directMessagesReceived;#[ORM\Column]private ?bool $remoteAccess = null;#[ORM\OneToMany(mappedBy: 'admin', targetEntity: AdminNotificationSettings::class)]private Collection $adminNotificationSettings;#[ORM\OneToMany(mappedBy: 'admin', targetEntity: DebtNote::class)]private Collection $debtNotes;#[ORM\OneToMany(mappedBy: 'admin', targetEntity: CustomerHistory::class)]private Collection $customerHistories;#[ORM\Column(length: 255, nullable: true)]private ?string $photo = null;#[ORM\Column]private bool $sendMail = true;#[ORM\ManyToMany(targetEntity: Product::class, mappedBy: 'adminToInfo')]private Collection $products;#[ORM\OneToMany(mappedBy: 'sendByAdmin', targetEntity: SmsHistory::class)]private Collection $smsHistories;#[ORM\ManyToMany(targetEntity: NotificationToSendSetting::class, mappedBy: 'admin')]private Collection $notificationToSendSettings;#[ORM\OneToOne(mappedBy: 'admin', cascade: ['persist', 'remove'])]private ?Mailbox $mailbox = null;#[ORM\OneToMany(mappedBy: 'acceptedBy', targetEntity: LeaveRequest::class)]private Collection $acceptedLeaveRequests;#[ORM\OneToMany(mappedBy: 'rejectedBy', targetEntity: LeaveRequest::class)]private Collection $rejectedLeaveRequests;#[ORM\OneToMany(mappedBy: 'acceptedBy', targetEntity: Task::class)]private Collection $acceptedTasks;#[ORM\ManyToOne(inversedBy: 'admins')]private ?Position $position = null;#[ORM\ManyToMany(targetEntity: Agreement::class, mappedBy: 'agreementToSendAfterSigned')]private Collection $agreementsToSendAfterSigned;#[ORM\OneToOne(mappedBy: 'admin', cascade: ['persist', 'remove'])]private ?NominalWorkTime $nominalWorkTime = null;#[ORM\Column]private bool $toRcp = true;#[ORM\OneToMany(mappedBy: 'acceptedBy', targetEntity: WorkTime::class)]private Collection $acceptedWorkTimes;#[ORM\OneToMany(mappedBy: 'admin', targetEntity: AccountingOfficeSendingNote::class)]private Collection $accountingOfficeSendingNotes;#[ORM\OneToMany(mappedBy: 'admin', targetEntity: WorkTime::class)]private Collection $workTimes;#[ORM\OneToMany(mappedBy: 'admin', targetEntity: LeaveRequest::class)]private Collection $leaveRequests;#[ORM\ManyToMany(targetEntity: Department::class, mappedBy: 'management')]private Collection $departments;#[ORM\OneToMany(mappedBy: 'addedBy', targetEntity: NumberBlocking::class)]private Collection $numberBlockings;#[ORM\OneToMany(mappedBy: 'blockedBy', targetEntity: NumberBlocking::class)]private Collection $numberBlockingsBlocked;#[ORM\ManyToOne(inversedBy: 'admins')]private ?AdminDepartment $adminDepartment = null;#[ORM\Column]private ?bool $acceptedRegulations = null;#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]private ?\DateTimeInterface $acceptedRegulationsDate = null;#[ORM\Column]private ?bool $acceptedZfss = null;#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]private ?\DateTimeInterface $acceptedZfssDate = null;#[ORM\ManyToOne(inversedBy: 'admins')]private ?EmploymentContractType $adminContractType = null;#[ORM\OneToMany(mappedBy: 'admin', targetEntity: LeaveRequestBalance::class)]private Collection $leaveRequestBalances;#[ORM\Column(type: Types::TEXT, nullable: true)]private ?string $mailFooter = null;public function __construct(){$this->branches = new ArrayCollection();$this->orderHistories = new ArrayCollection();$this->notifications = new ArrayCollection();$this->adminCode = rand(000000, 999999);$this->orderNotes = new ArrayCollection();$this->implementerOrderHistories = new ArrayCollection();$this->orderEditedNotes = new ArrayCollection();$this->orders = new ArrayCollection();$this->commercialOffers = new ArrayCollection();$this->workHistories = new ArrayCollection();$this->commercialOfferIndividuals = new ArrayCollection();$this->commercialOfferSendings = new ArrayCollection();$this->commercialOfferSendingsAccepts = new ArrayCollection();$this->commercialOfferIndividualsAccepted = new ArrayCollection();$this->reservations = new ArrayCollection();$this->reservationsEdit = new ArrayCollection();$this->directMessagesSent = new ArrayCollection();$this->directMessagesReceived = new ArrayCollection();$this->adminNotificationSettings = new ArrayCollection();$this->debtNotes = new ArrayCollection();$this->customerHistories = new ArrayCollection();$this->products = new ArrayCollection();$this->smsHistories = new ArrayCollection();$this->notificationToSendSettings = new ArrayCollection();$this->acceptedLeaveRequests = new ArrayCollection();$this->rejectedLeaveRequests = new ArrayCollection();$this->acceptedTasks = new ArrayCollection();$this->position = null;$this->agreementsToSendAfterSigned = new ArrayCollection();$this->acceptedWorkTimes = new ArrayCollection();$this->accountingOfficeSendingNotes = new ArrayCollection();$this->workTimes = new ArrayCollection();$this->leaveRequests = new ArrayCollection();$this->departments = new ArrayCollection();$this->numberBlockings = new ArrayCollection();$this->numberBlockingsBlocked = new ArrayCollection();$this->acceptedZfss = false;$this->acceptedZfssDate = null;$this->leaveRequestBalances = new ArrayCollection();}public function __toString(){return $this->firstName . ' ' . $this->lastName;}public function getFullName(): ?string{return $this->lastName.' '.$this->firstName;}public function getId(): ?int{return $this->id;}public function getEmail(): ?string{return $this->email;}public function setEmail(string $email): self{$this->email = $email;return $this;}/*** A visual identifier that represents this admin.** @see UserInterface*/public function getUserIdentifier(): string{return (string)$this->email;}/*** @see UserInterface*/public function getRoles(): array{$roles = $this->roles;// guarantee every user at least has ROLE_USER$roles[] = 'ROLE_USER';return array_unique($roles);}public function setRoles(array $roles): self{$this->roles = $roles;return $this;}/*** @see PasswordAuthenticatedUserInterface*/public function getPassword(): string{return $this->password;}public function setPassword(string $password): self{$this->password = $password;return $this;}/*** @return string*/public function getFirstName(): string{return $this->firstName;}/*** @param string $firstName*/public function setFirstName(string $firstName): void{$this->firstName = $firstName;}/*** @return string*/public function getLastName(): string{return $this->lastName;}/*** @param string $lastName*/public function setLastName(string $lastName): void{$this->lastName = $lastName;}/*** @return bool*/public function isActive(): bool{return $this->isActive;}/*** @param bool $isActive*/public function setIsActive(bool $isActive): void{$this->isActive = $isActive;}/*** @see UserInterface*/public function eraseCredentials(){// If you store any temporary, sensitive data on the user, clear it here// $this->plainPassword = null;}/*** @return Collection*/public function getBranches(): Collection{return $this->branches;}public function addBranch(Branch $branches): self{if (!$this->branches->contains($branches)) {$this->branches[] = $branches;}return $this;}public function removeBranch(Branch $branches): self{$this->branches->removeElement($branches);return $this;}public function getWorker(): ?Worker{return $this->worker;}public function setWorker(?Worker $worker): self{// unset the owning side of the relation if necessaryif ($worker === null && $this->worker !== null) {$this->worker->setAdmin(null);}// set the owning side of the relation if necessaryif ($worker !== null && $worker->getAdmin() !== $this) {$worker->setAdmin($this);}$this->worker = $worker;return $this;}public function getImplementer(): ?Implementer{return $this->implementer;}public function setImplementer(Implementer $implementer): self{// set the owning side of the relation if necessaryif ($implementer->getAdmin() !== $this) {$implementer->setAdmin($this);}$this->implementer = $implementer;return $this;}/*** @return Collection<int, OrderHistory>*/public function getOrderHistories(): Collection{return $this->orderHistories;}public function addOrderHistory(OrderHistory $orderHistory): self{if (!$this->orderHistories->contains($orderHistory)) {$this->orderHistories->add($orderHistory);$orderHistory->setAdmin($this);}return $this;}public function removeOrderHistory(OrderHistory $orderHistory): self{if ($this->orderHistories->removeElement($orderHistory)) {// set the owning side to null (unless already changed)if ($orderHistory->getAdmin() === $this) {$orderHistory->setAdmin(null);}}return $this;}// logs out the user when isActive status has been changedpublic function isEqualTo(Admin|UserInterface $user): bool{if (!$user->isActive()) {return false;}return true;}/*** @return string|null*/public function getColor(): ?string{return $this->color;}/*** @param string|null $color*/public function setColor(?string $color): void{$this->color = $color;}/*** @return Collection<int, Notification>*/public function getNotifications(): Collection{return $this->notifications;}public function addNotification(Notification $notification): static{if (!$this->notifications->contains($notification)) {$this->notifications->add($notification);$notification->addAdmin($this);}return $this;}public function removeNotification(Notification $notification): static{if ($this->notifications->removeElement($notification)) {$notification->removeAdmin($this);}return $this;}public function getAdminCode(): ?string{return $this->adminCode;}public function setAdminCode(): static{$characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';$code = '';for ($i = 0; $i < 6; $i++) {$code .= $characters[random_int(0, strlen($characters) - 1)];}$this->adminCode = $code;return $this;}/*** @return Collection<int, OrderNote>*/public function getOrderNotes(): Collection{return $this->orderNotes;}public function addOrderNote(OrderNote $orderNote): static{if (!$this->orderNotes->contains($orderNote)) {$this->orderNotes->add($orderNote);$orderNote->setAdmin($this);}return $this;}public function removeOrderNote(OrderNote $orderNote): static{if ($this->orderNotes->removeElement($orderNote)) {// set the owning side to null (unless already changed)if ($orderNote->getAdmin() === $this) {$orderNote->setAdmin(null);}}return $this;}/*** @return Collection<int, ImplementerOrderHistory>*/publicfunction getImplementerOrderHistories(): Collection{return $this->implementerOrderHistories;}publicfunction addImplementerOrderHistory(ImplementerOrderHistory $implementerOrderHistory): static{if (!$this->implementerOrderHistories->contains($implementerOrderHistory)) {$this->implementerOrderHistories->add($implementerOrderHistory);$implementerOrderHistory->setAdmin($this);}return $this;}public function removeImplementerOrderHistory(ImplementerOrderHistory $implementerOrderHistory): static{if ($this->implementerOrderHistories->removeElement($implementerOrderHistory)) {// set the owning side to null (unless already changed)if ($implementerOrderHistory->getAdmin() === $this) {$implementerOrderHistory->setAdmin(null);}}return $this;}/*** @return Collection<int, OrderNote>*/public function getOrderEditedNotes(): Collection{return $this->orderEditedNotes;}public function addOrderEditedNote(OrderNote $orderEditedNote): static{if (!$this->orderEditedNotes->contains($orderEditedNote)) {$this->orderEditedNotes->add($orderEditedNote);$orderEditedNote->setLastEditedBy($this);}return $this;}public function removeOrderEditedNote(OrderNote $orderEditedNote): static{if ($this->orderEditedNotes->removeElement($orderEditedNote)) {// set the owning side to null (unless already changed)if ($orderEditedNote->getLastEditedBy() === $this) {$orderEditedNote->setLastEditedBy(null);}}return $this;}/*** @return Collection<int, Order>*/public function getOrders(): Collection{return $this->orders;}public function addOrder(Order $order): static{if (!$this->orders->contains($order)) {$this->orders->add($order);$order->setAdmin($this);}return $this;}public function removeOrder(Order $order): static{if ($this->orders->removeElement($order)) {// set the owning side to null (unless already changed)if ($order->getAdmin() === $this) {$order->setAdmin(null);}}return $this;}/*** @return Collection<int, CommercialOffer>*/public function getCommercialOffers(): Collection{return $this->commercialOffers;}public function addCommercialOffer(CommercialOffer $commercialOffer): static{if (!$this->commercialOffers->contains($commercialOffer)) {$this->commercialOffers->add($commercialOffer);$commercialOffer->setAddedBy($this);}return $this;}public function removeCommercialOffer(CommercialOffer $commercialOffer): static{if ($this->commercialOffers->removeElement($commercialOffer)) {// set the owning side to null (unless already changed)if ($commercialOffer->getAddedBy() === $this) {$commercialOffer->setAddedBy(null);}}return $this;}/*** @return Collection<int, WorkHistory>*/public function getWorkHistories(): Collection{return $this->workHistories;}public function addWorkHistory(WorkHistory $workHistory): static{if (!$this->workHistories->contains($workHistory)) {$this->workHistories->add($workHistory);$workHistory->setAdmin($this);}return $this;}public function removeWorkHistory(WorkHistory $workHistory): static{if ($this->workHistories->removeElement($workHistory)) {// set the owning side to null (unless already changed)if ($workHistory->getAdmin() === $this) {$workHistory->setAdmin(null);}}return $this;}/*** @return Collection<int, CommercialOfferIndividual>*/public function getCommercialOfferIndividuals(): Collection{return $this->commercialOfferIndividuals;}public function addCommercialOfferIndividual(CommercialOfferIndividual $commercialOfferIndividual): static{if (!$this->commercialOfferIndividuals->contains($commercialOfferIndividual)) {$this->commercialOfferIndividuals->add($commercialOfferIndividual);$commercialOfferIndividual->setCreatedByAdmin($this);}return $this;}public function removeCommercialOfferIndividual(CommercialOfferIndividual $commercialOfferIndividual): static{if ($this->commercialOfferIndividuals->removeElement($commercialOfferIndividual)) {// set the owning side to null (unless already changed)if ($commercialOfferIndividual->getCreatedByAdmin() === $this) {$commercialOfferIndividual->setCreatedByAdmin(null);}}return $this;}/*** @return Collection<int, CommercialOfferSendings>*/public function getCommercialOfferSendings(): Collection{return $this->commercialOfferSendings;}public function addCommercialOfferSending(CommercialOfferSendings $commercialOfferSending): static{if (!$this->commercialOfferSendings->contains($commercialOfferSending)) {$this->commercialOfferSendings->add($commercialOfferSending);$commercialOfferSending->setAddedByAdmin($this);}return $this;}public function removeCommercialOfferSending(CommercialOfferSendings $commercialOfferSending): static{if ($this->commercialOfferSendings->removeElement($commercialOfferSending)) {// set the owning side to null (unless already changed)if ($commercialOfferSending->getAddedByAdmin() === $this) {$commercialOfferSending->setAddedByAdmin(null);}}return $this;}/*** @return Collection<int, CommercialOfferSendings>*/public function getCommercialOfferSendingsAccepts(): Collection{return $this->commercialOfferSendingsAccepts;}/*** @return Collection<int, CommercialOfferIndividual>*/public function getCommercialOfferIndividualsAccepted(): Collection{return $this->commercialOfferIndividualsAccepted;}/*** @return Collection<int, Reservations>*/public function getReservations(): Collection{return $this->reservations;}public function addReservation(Reservations $reservation): static{if (!$this->reservations->contains($reservation)) {$this->reservations->add($reservation);$reservation->setAddedByAdmin($this);}return $this;}public function removeReservation(Reservations $reservation): static{if ($this->reservations->removeElement($reservation)) {// set the owning side to null (unless already changed)if ($reservation->getAddedByAdmin() === $this) {$reservation->setAddedByAdmin(null);}}return $this;}/*** @return Collection<int, Reservations>*/public function getReservationsEdit(): Collection{return $this->reservationsEdit;}public function addReservationsEdit(Reservations $reservationsEdit): static{if (!$this->reservationsEdit->contains($reservationsEdit)) {$this->reservationsEdit->add($reservationsEdit);$reservationsEdit->setLastEditedBy($this);}return $this;}public function removeReservationsEdit(Reservations $reservationsEdit): static{if ($this->reservationsEdit->removeElement($reservationsEdit)) {// set the owning side to null (unless already changed)if ($reservationsEdit->getLastEditedBy() === $this) {$reservationsEdit->setLastEditedBy(null);}}return $this;}/*** @return Collection<int, DirectMessage>*/public function getDirectMessagesSent(): Collection{return $this->directMessagesSent;}public function addDirectMessagesSent(DirectMessage $directMessagesSent): static{if (!$this->directMessagesSent->contains($directMessagesSent)) {$this->directMessagesSent->add($directMessagesSent);$directMessagesSent->setSenderAdmin($this);}return $this;}public function removeDirectMessagesSent(DirectMessage $directMessagesSent): static{if ($this->directMessagesSent->removeElement($directMessagesSent)) {// set the owning side to null (unless already changed)if ($directMessagesSent->getSenderAdmin() === $this) {$directMessagesSent->setSenderAdmin(null);}}return $this;}/*** @return Collection<int, DirectMessage>*/public function getDirectMessagesReceived(): Collection{return $this->directMessagesReceived;}public function addDirectMessagesReceived(DirectMessage $directMessagesReceived): static{if (!$this->directMessagesReceived->contains($directMessagesReceived)) {$this->directMessagesReceived->add($directMessagesReceived);$directMessagesReceived->setReceiverAdmin($this);}return $this;}public function removeDirectMessagesReceived(DirectMessage $directMessagesReceived): static{if ($this->directMessagesReceived->removeElement($directMessagesReceived)) {// set the owning side to null (unless already changed)if ($directMessagesReceived->getReceiverAdmin() === $this) {$directMessagesReceived->setReceiverAdmin(null);}}return $this;}public function isRemoteAccess(): ?bool{return $this->remoteAccess;}public function setRemoteAccess(bool $remoteAccess): static{$this->remoteAccess = $remoteAccess;return $this;}/*** @return Collection<int, AdminNotificationSettings>*/public function getAdminNotificationSettings(): Collection{return $this->adminNotificationSettings;}public function addAdminNotificationSetting(AdminNotificationSettings $adminNotificationSetting): static{if (!$this->adminNotificationSettings->contains($adminNotificationSetting)) {$this->adminNotificationSettings->add($adminNotificationSetting);$adminNotificationSetting->setAdmin($this);}return $this;}public function removeAdminNotificationSetting(AdminNotificationSettings $adminNotificationSetting): static{if ($this->adminNotificationSettings->removeElement($adminNotificationSetting)) {// set the owning side to null (unless already changed)if ($adminNotificationSetting->getAdmin() === $this) {$adminNotificationSetting->setAdmin(null);}}return $this;}/*** @return Collection<int, DebtNote>*/public function getDebtNotes(): Collection{return $this->debtNotes;}public function addDebtNote(DebtNote $debtNote): static{if (!$this->debtNotes->contains($debtNote)) {$this->debtNotes->add($debtNote);$debtNote->setAdmin($this);}return $this;}public function removeDebtNote(DebtNote $debtNote): static{if ($this->debtNotes->removeElement($debtNote)) {// set the owning side to null (unless already changed)if ($debtNote->getAdmin() === $this) {$debtNote->setAdmin(null);}}return $this;}/*** @return Collection<int, CustomerHistory>*/public function getCustomerHistories(): Collection{return $this->customerHistories;}public function addCustomerHistory(CustomerHistory $customerHistory): static{if (!$this->customerHistories->contains($customerHistory)) {$this->customerHistories->add($customerHistory);$customerHistory->setAdmin($this);}return $this;}public function removeCustomerHistory(CustomerHistory $customerHistory): static{if ($this->customerHistories->removeElement($customerHistory)) {// set the owning side to null (unless already changed)if ($customerHistory->getAdmin() === $this) {$customerHistory->setAdmin(null);}}return $this;}public function getPhoto(): ?string{return $this->photo;}public function setPhoto(?string $photo): static{$this->photo = $photo;return $this;}public function isSendMail(): bool{return $this->sendMail;}public function setSendMail(bool $sendMail): static{$this->sendMail = $sendMail;return $this;}/*** @return Collection<int, Product>*/public function getProducts(): Collection{return $this->products;}public function addProduct(Product $product): static{if (!$this->products->contains($product)) {$this->products->add($product);$product->addAdminToInfo($this);}return $this;}public function removeProduct(Product $product): static{if ($this->products->removeElement($product)) {$product->removeAdminToInfo($this);}return $this;}/*** @return Collection<int, SmsHistory>*/public function getSmsHistories(): Collection{return $this->smsHistories;}public function addSmsHistory(SmsHistory $smsHistory): static{if (!$this->smsHistories->contains($smsHistory)) {$this->smsHistories->add($smsHistory);$smsHistory->setSendByAdmin($this);}return $this;}public function removeSmsHistory(SmsHistory $smsHistory): static{if ($this->smsHistories->removeElement($smsHistory)) {// set the owning side to null (unless already changed)if ($smsHistory->getSendByAdmin() === $this) {$smsHistory->setSendByAdmin(null);}}return $this;}/*** @return Collection<int, NotificationToSendSetting>*/public function getNotificationToSendSettings(): Collection{return $this->notificationToSendSettings;}public function addNotificationToSendSetting(NotificationToSendSetting $notificationToSendSetting): static{if (!$this->notificationToSendSettings->contains($notificationToSendSetting)) {$this->notificationToSendSettings->add($notificationToSendSetting);$notificationToSendSetting->addAdmin($this);}return $this;}public function removeNotificationToSendSetting(NotificationToSendSetting $notificationToSendSetting): static{if ($this->notificationToSendSettings->removeElement($notificationToSendSetting)) {$notificationToSendSetting->removeAdmin($this);}return $this;}public function getMailbox(): ?Mailbox{return $this->mailbox;}public function setMailbox(?Mailbox $mailbox): static{// unset the owning side of the relation if necessaryif ($mailbox === null && $this->mailbox !== null) {$this->mailbox->setAdmin(null);}// set the owning side of the relation if necessaryif ($mailbox !== null && $mailbox->getAdmin() !== $this) {$mailbox->setAdmin($this);}$this->mailbox = $mailbox;return $this;}/*** @return Collection<int, LeaveRequest>*/public function getAcceptedLeaveRequests(): Collection{return $this->acceptedLeaveRequests;}public function addAcceptedLeaveRequest(LeaveRequest $acceptedLeaveRequest): static{if (!$this->acceptedLeaveRequests->contains($acceptedLeaveRequest)) {$this->acceptedLeaveRequests->add($acceptedLeaveRequest);$acceptedLeaveRequest->setAcceptedBy($this);}return $this;}public function removeAcceptedLeaveRequest(LeaveRequest $acceptedLeaveRequest): static{if ($this->acceptedLeaveRequests->removeElement($acceptedLeaveRequest)) {// set the owning side to null (unless already changed)if ($acceptedLeaveRequest->getAcceptedBy() === $this) {$acceptedLeaveRequest->setAcceptedBy(null);}}return $this;}/*** @return Collection<int, LeaveRequest>*/public function getRejectedLeaveRequests(): Collection{return $this->rejectedLeaveRequests;}public function addRejectedLeaveRequest(LeaveRequest $rejectedLeaveRequest): static{if (!$this->rejectedLeaveRequests->contains($rejectedLeaveRequest)) {$this->rejectedLeaveRequests->add($rejectedLeaveRequest);$rejectedLeaveRequest->setRejectedBy($this);}return $this;}public function removeRejectedLeaveRequest(LeaveRequest $rejectedLeaveRequest): static{if ($this->rejectedLeaveRequests->removeElement($rejectedLeaveRequest)) {// set the owning side to null (unless already changed)if ($rejectedLeaveRequest->getRejectedBy() === $this) {$rejectedLeaveRequest->setRejectedBy(null);}}return $this;}/*** @return Collection<int, Task>*/public function getAcceptedTasks(): Collection{return $this->acceptedTasks;}public function addAcceptedTask(Task $acceptedTask): static{if (!$this->acceptedTasks->contains($acceptedTask)) {$this->acceptedTasks->add($acceptedTask);$acceptedTask->setAcceptedBy($this);}return $this;}public function removeAcceptedTask(Task $acceptedTask): static{if ($this->acceptedTasks->removeElement($acceptedTask)) {// set the owning side to null (unless already changed)if ($acceptedTask->getAcceptedBy() === $this) {$acceptedTask->setAcceptedBy(null);}}return $this;}public function getPosition(): ?Position{return $this->position;}public function setPosition(?Position $position): static{$this->position = $position;return $this;}/*** @return Collection<int, Agreement>*/public function getAgreementsToSendAfterSigned(): Collection{return $this->agreementsToSendAfterSigned;}public function addAgreementsToSendAfterSigned(Agreement $agreementsToSendAfterSigned): static{if (!$this->agreementsToSendAfterSigned->contains($agreementsToSendAfterSigned)) {$this->agreementsToSendAfterSigned->add($agreementsToSendAfterSigned);$agreementsToSendAfterSigned->addAgreementToSendAfterSigned($this);}return $this;}public function removeAgreementsToSendAfterSigned(Agreement $agreementsToSendAfterSigned): static{if ($this->agreementsToSendAfterSigned->removeElement($agreementsToSendAfterSigned)) {$agreementsToSendAfterSigned->removeAgreementToSendAfterSigned($this);}return $this;}/*** @return Collection<int, WorkTime>*/public function getWorkTimes(): Collection{return $this->workTimes;}public function addWorkTime(WorkTime $workTime): static{if (!$this->workTimes->contains($workTime)) {$this->workTimes->add($workTime);$workTime->setAdminInstance($this);}return $this;}public function removeWorkTime(WorkTime $workTime): static{if ($this->workTimes->removeElement($workTime)) {// set the owning side to null (unless already changed)if ($workTime->getAdmin() === $this) {$workTime->setAdmin(null);}}return $this;}public function getNominalWorkTime(): ?NominalWorkTime{return $this->nominalWorkTime;}public function setNominalWorkTime(?NominalWorkTime $nominalWorkTime): static{$this->nominalWorkTime = $nominalWorkTime;return $this;}/*** @return Collection<int, LeaveRequest>*/public function getLeaveRequests(): Collection{return $this->leaveRequests;}public function addLeaveRequest(LeaveRequest $leaveRequest): static{if (!$this->leaveRequests->contains($leaveRequest)) {$this->leaveRequests->add($leaveRequest);$leaveRequest->setAdmin($this);}return $this;}public function removeLeaveRequest(LeaveRequest $leaveRequest): static{if ($this->leaveRequests->removeElement($leaveRequest)) {// set the owning side to null (unless already changed)if ($leaveRequest->getAdmin() === $this) {$leaveRequest->setAdmin(null);}}return $this;}/*** @return Collection<int, AccountingOfficeSendingNote>*/public function getAccountingOfficeSendingNotes(): Collection{return $this->accountingOfficeSendingNotes;}public function addAccountingOfficeSendingNote(AccountingOfficeSendingNote $accountingOfficeSendingNote): static{if (!$this->accountingOfficeSendingNotes->contains($accountingOfficeSendingNote)) {$this->accountingOfficeSendingNotes->add($accountingOfficeSendingNote);$accountingOfficeSendingNote->setAdmin($this);}return $this;}public function removeAccountingOfficeSendingNote(AccountingOfficeSendingNote $accountingOfficeSendingNote): static{if ($this->accountingOfficeSendingNotes->removeElement($accountingOfficeSendingNote)) {// set the owning side to null (unless already changed)if ($accountingOfficeSendingNote->getAdmin() === $this) {$accountingOfficeSendingNote->setAdmin(null);}}return $this;}public function isToRcp(): bool{return $this->toRcp;}public function setToRcp(bool $toRcp): void{$this->toRcp = $toRcp;}/*** @return Collection<int, WorkTime>*/public function getAcceptedWorkTimes(): Collection{return $this->acceptedWorkTimes;}public function addAcceptedWorkTime(WorkTime $acceptedWorkTime): static{if (!$this->acceptedWorkTimes->contains($acceptedWorkTime)) {$this->acceptedWorkTimes->add($acceptedWorkTime);$acceptedWorkTime->setAcceptedBy($this);}return $this;}public function removeAcceptedWorkTime(WorkTime $acceptedWorkTime): static{if ($this->acceptedWorkTimes->removeElement($acceptedWorkTime)) {// set the owning side to null (unless already changed)if ($acceptedWorkTime->getAcceptedBy() === $this) {$acceptedWorkTime->setAcceptedBy(null);}}return $this;}/*** @return Collection<int, Department>*/public function getDepartments(): Collection{return $this->departments;}public function addDepartment(Department $department): static{if (!$this->departments->contains($department)) {$this->departments->add($department);$department->addManagement($this);}return $this;}public function removeDepartment(Department $department): static{if ($this->departments->removeElement($department)) {$department->removeManagement($this);}return $this;}/** @return Collection<int, NumberBlocking> */public function getNumberBlockings(): Collection{return $this->numberBlockings;}public function addNumberBlocking(NumberBlocking $nb): self{if (!$this->numberBlockings->contains($nb)) {$this->numberBlockings->add($nb);$nb->setAddedBy($this);}return $this;}public function removeNumberBlocking(NumberBlocking $nb): self{if ($this->numberBlockings->removeElement($nb)) {if ($nb->getAddedBy() === $this) {$nb->setAddedBy(null);}}return $this;}/** @return Collection<int, NumberBlocking> */public function getNumberBlockingsBlocked(): Collection{return $this->numberBlockingsBlocked;}public function addNumberBlockingBlocked(NumberBlocking $nb): self{if (!$this->numberBlockingsBlocked->contains($nb)) {$this->numberBlockingsBlocked->add($nb);$nb->setBlockedBy($this);}return $this;}public function removeNumberBlockingBlocked(NumberBlocking $nb): self{if ($this->numberBlockingsBlocked->removeElement($nb)) {if ($nb->getBlockedBy() === $this) {$nb->setBlockedBy(null);}}return $this;}public function getAdminDepartment(): ?AdminDepartment{return $this->adminDepartment;}public function setAdminDepartment(?AdminDepartment $adminDepartment): static{$this->adminDepartment = $adminDepartment;return $this;}public function isAcceptedRegulations(): ?bool{return $this->acceptedRegulations;}public function setAcceptedRegulations(bool $acceptedRegulations): static{$this->acceptedRegulations = $acceptedRegulations;return $this;}public function getAcceptedRegulationsDate(): ?\DateTimeInterface{return $this->acceptedRegulationsDate;}public function setAcceptedRegulationsDate(?\DateTimeInterface $acceptedRegulationsDate): static{$this->acceptedRegulationsDate = $acceptedRegulationsDate;return $this;}public function isAcceptedZfss(): ?bool{return $this->acceptedZfss;}public function setAcceptedZfss(bool $acceptedZfss): static{$this->acceptedZfss = $acceptedZfss;return $this;}public function getAcceptedZfssDate(): ?\DateTimeInterface{return $this->acceptedZfssDate;}public function setAcceptedZfssDate(?\DateTimeInterface $acceptedZfssDate): static{$this->acceptedZfssDate = $acceptedZfssDate;return $this;}public function getAdminContractType(): ?EmploymentContractType{return $this->adminContractType;}public function setAdminContractType(?EmploymentContractType $adminContractType): static{$this->adminContractType = $adminContractType;return $this;}/*** @return Collection<int, LeaveRequestBalance>*/public function getLeaveRequestBalances(): Collection{return $this->leaveRequestBalances;}public function addLeaveRequestBalance(LeaveRequestBalance $leaveRequestBalance): static{if (!$this->leaveRequestBalances->contains($leaveRequestBalance)) {$this->leaveRequestBalances->add($leaveRequestBalance);$leaveRequestBalance->setAdmin($this);}return $this;}public function removeLeaveRequestBalance(LeaveRequestBalance $leaveRequestBalance): static{if ($this->leaveRequestBalances->removeElement($leaveRequestBalance)) {// set the owning side to null (unless already changed)if ($leaveRequestBalance->getAdmin() === $this) {$leaveRequestBalance->setAdmin(null);}}return $this;}public function getMailFooter(): ?string{return $this->mailFooter;}public function setMailFooter(?string $mailFooter): static{$this->mailFooter = $mailFooter;return $this;}}