src/Entity/User.php line 74

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use ApiPlatform\Metadata\ApiFilter;
  6. use ApiPlatform\Metadata\ApiProperty;
  7. use ApiPlatform\Metadata\ApiResource;
  8. use ApiPlatform\Metadata\Delete;
  9. use ApiPlatform\Metadata\Get;
  10. use ApiPlatform\Metadata\GetCollection;
  11. use ApiPlatform\Metadata\Patch;
  12. use ApiPlatform\Metadata\Post;
  13. use ApiPlatform\Metadata\Put;
  14. use Doctrine\DBAL\Types\Types;
  15. use Doctrine\ORM\Mapping as ORM;
  16. use App\Repository\UserRepository;
  17. use App\State\UserPasswordHasher;
  18. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  19. use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
  20. use Symfony\Component\Security\Core\User\UserInterface;
  21. use Symfony\Component\Serializer\Annotation\Groups;
  22. use Symfony\Component\Validator\Constraints as Assert;
  23. use ApiPlatform\Doctrine\Orm\Filter\SearchFilter;
  24. use App\Controller\UserController;
  25. use App\Filter\CustomOrFilter// Змініть імпорт на правильний
  26. #[ORM\Table(name'users')]
  27. #[ApiResource(
  28.     operations: [
  29.         new GetCollection(),
  30.         new Post(processorUserPasswordHasher::class, validationContext: ['groups' => ['Default''user:create']]),
  31.         new Get(),
  32.         new Delete(
  33.             security"object == user",
  34.             securityMessage"Ви можете видалити лише власний обліковий запис."
  35.         ),
  36.         new Put(processorUserPasswordHasher::class),
  37.         new Patch(processorUserPasswordHasher::class),
  38.         new Post(
  39.             name'me'
  40.             uriTemplate'/users/me'
  41.             controllerUserController::class
  42.         ),
  43.         new Get(
  44.             name'user_search'
  45.             uriTemplate'/user/search'
  46.             controllerUserController::class
  47.         )
  48.     ],
  49.     normalizationContext: ['groups' => ['user:read']],
  50.     denormalizationContext: ['groups' => ['user:create''user:update']],
  51. )]
  52. #[ORM\Entity(repositoryClassUserRepository::class)]
  53. #[UniqueEntity(fields: ['username'], message'There is already an account with this username')]
  54. #[ApiFilter(CustomOrFilter::class,properties: [
  55.     'username' => 'ipartial'
  56.     'firstName' => 'ipartial'
  57.     'lastName' => 'ipartial',
  58.     'codeUser' => 'exact',
  59.     'codeManager' => 'exact',
  60. ])]
  61. #[ApiFilter(SearchFilter::class, properties: [
  62.     'accounts.manager.id' => 'exact',
  63.     'userType' => 'exact',
  64.     'appPersonalAccounts.number' => 'exact',
  65. ])]
  66. class User implements UserInterfacePasswordAuthenticatedUserInterface
  67. {
  68.     #[ORM\Id]
  69.     #[ORM\GeneratedValue]
  70.     #[ORM\Column]
  71.     #[Groups(['user:read''read''account:read''order:read''order_product:read''pre_order_product:read''pre_order:read''load_invoice:read''load_invocie:read''product_storage_balance:read''personalAcc:read''Notification:read''MassiveNotification:read'])]
  72.     private ?int $id null;
  73.     #[ORM\Column(length180uniquetrue)]
  74.     #[Groups(['user:read''user:create''user:update''read''account:read''Notification:read''MassiveNotification:read'])]
  75.     private ?string $username null;
  76.     #[Groups(['user:read''user:update'])]
  77.     #[ORM\Column]
  78.     private array $roles = [];
  79.     /**
  80.      * @var string The hashed password
  81.      */
  82.     #[ORM\Column]
  83.     private ?string $password null;
  84.     #[Assert\NotBlank(groups: ['user:create'])]
  85.     #[Groups(['user:create''user:update'])]
  86.     private ?string $plainPassword null;
  87.     #[ORM\ManyToOne(targetEntityself::class, inversedBy'firstName')]
  88.     private ?self $manager null;
  89.     #[Groups(['user:read''user:create''user:update''read''account:read''account:write''order:read''order_product:read''pre_order_product:read''pre_order:read''load_invoice:read''load_invocie:read''product_storage_balance:read''personalAcc:read''Notification:read''MassiveNotification:read'])]
  90.     #[ORM\Column(length255nullabletrue)]
  91.     private ?string $firstName  null;
  92.     #[Groups(['user:read''user:create''user:update''read''account:read''account:write''order:read''order_product:read''pre_order_product:read''pre_order:read''load_invoice:read''load_invocie:read''product_storage_balance:read''personalAcc:read''Notification:read''MassiveNotification:read'])]
  93.     #[ORM\Column(length255nullabletrue)]
  94.     private ?string $lastName null;
  95.     #[Groups(['user:read''user:create''user:update''account:read''personalAcc:read'])]
  96.     #[ORM\Column(length100nullabletrue)]
  97.     private ?string $phone null;
  98.     #[Groups(['user:read''user:create''user:update'])]
  99.     #[ORM\Column(length255nullabletrue)]
  100.     private ?string $address null
  101.     #[Groups(['user:read''user:create''user:update'])]
  102.     #[ORM\Column(length50nullabletrue)]
  103.     private ?string $status null;
  104.     #[Groups(['user:read''user:create''user:update''read''account:read''personalAcc:read'])]
  105.     #[ORM\Column(length255nullabletrue)]
  106.     private ?string $email null;
  107.     #[Groups(['user:read''user:create''user:update''read''account:read'])]
  108.     #[ORM\Column(length255nullabletrue)]
  109.     private ?string $workSchedule null;
  110.     #[Groups(['user:read''user:create''user:update''read''account:read'])]
  111.     #[ORM\Column(length255nullabletrue)]
  112.     private ?string $telegram null;
  113.     #[Groups(['user:read''user:create''user:update''read''account:read'])]
  114.     #[ORM\Column(length255nullabletrue)]
  115.     private ?string $viber null;
  116.     #[Groups(['user:read''user:create''user:update''read''account:read'])]
  117.     #[ORM\OneToMany(mappedBy'users'targetEntityMediaObject::class, cascade:['persist''remove'])]
  118.     private Collection $mediaObjects;
  119.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  120.     private ?\DateTimeInterface $hashDate null;
  121.     #[ORM\Column(length255nullabletrue)]
  122.     private ?string $device_id null;
  123.     #[ORM\Column(length10nullabletrue)]
  124.     private ?string $activeCode null;
  125.     #[ORM\Column(nullabletrue)]
  126.     private ?bool $deleted null;
  127.     #[ORM\OneToMany(mappedBy'users'targetEntityUserToken::class, cascade:['persist''remove'])]
  128.     private Collection $userTokens;
  129.     #[ORM\OneToMany(mappedBy'owner'targetEntityAppPersonalAccount::class, orphanRemovaltruecascade:['persist''remove'])]
  130.     private Collection $appPersonalAccounts;
  131.     #[ORM\Column(nullabletrue)]
  132.     private ?int $debug null;
  133.     #[ORM\OneToMany(mappedBy'users'targetEntityNotification::class, cascade:['persist''remove'])]
  134.     private Collection $notifications;
  135.     #[ORM\Column(nullabletrue)]
  136.     private ?bool $dev null;
  137.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  138.     private ?\DateTimeInterface $dateEntered null;
  139.     #[ORM\OneToMany(mappedBy'userCreated'targetEntityMassiveNotification::class, cascade:['persist''remove'])]
  140.     private Collection $massiveNotifications;
  141.     #[Groups(['user:read''user:create''user:update''read''account:read''personalAcc:read'])]
  142.     #[ORM\Column(length50nullabletrueoptions: ['default' => 'active'])]
  143.     private ?string $notificationStatus null;
  144.     /**
  145.      * @var Collection<int, UserRole>
  146.      */
  147.     #[Groups(['user:read''user:create''user:update'])]
  148.     #[ORM\OneToMany(mappedBy'users'targetEntityUserRole::class, cascade:['persist''remove'])]
  149.     private Collection $userRoles;
  150.     #[Groups(['user:read''user:create''user:update''read''account:read''personalAcc:read'])]
  151.     #[ORM\Column(length100nullabletrue)]
  152.     private ?string $emailStatus null;
  153.     #[ORM\Column(length100nullabletrue)]
  154.     private ?string $osType null;
  155.     public function __construct()
  156.     {
  157.         $this->mediaObjects = new ArrayCollection();
  158.         $this->userTokens = new ArrayCollection();
  159.         $this->appPersonalAccounts = new ArrayCollection();
  160.         $this->notifications = new ArrayCollection();
  161.         $this->massiveNotifications = new ArrayCollection();
  162.         $this->userRoles = new ArrayCollection();
  163.     }
  164.     public function getId(): ?int
  165.     {
  166.         return $this->id;
  167.     }
  168.     /**
  169.      * @deprecated since Symfony 5.3, use getUserIdentifier instead
  170.      */
  171.     public function getUsername(): string
  172.     {
  173.         return (string) $this->username;
  174.     }
  175.     public function setUsername(string $username): self
  176.     {
  177.         $this->username $username;
  178.         return $this;
  179.     }
  180.     /**
  181.      * A visual identifier that represents this user.
  182.      *
  183.      * @see UserInterface
  184.      */
  185.     public function getUserIdentifier(): string
  186.     {
  187.         return (string) $this->username;
  188.     }
  189.     /**
  190.      * @see UserInterface
  191.      */
  192.     public function getRoles(): array
  193.     {
  194.         $roles = [];
  195.         foreach ($this->userRoles as $userRole) {
  196.             $roles[] = $userRole->getRole()->getName();
  197.         }
  198.         return array_unique($roles);
  199.     }
  200.     public function setRoles(array $roles): self
  201.     {
  202.         $this->roles $roles;
  203.         return $this;
  204.     }
  205.     /**
  206.      * @see PasswordAuthenticatedUserInterface
  207.      */
  208.     public function getPassword(): string
  209.     {
  210.         return $this->password;
  211.     }
  212.     public function setPassword(string $password): self
  213.     {
  214.         $this->password $password;
  215.         return $this;
  216.     }
  217.     public function getPlainPassword(): ?string
  218.     {
  219.         return $this->plainPassword;
  220.     }
  221.     public function setPlainPassword(?string $plainPassword): self
  222.     {
  223.         $this->plainPassword $plainPassword;
  224.         return $this;
  225.     }
  226.     /**
  227.      * Returning a salt is only needed, if you are not using a modern
  228.      * hashing algorithm (e.g. bcrypt or sodium) in your security.yaml.
  229.      *
  230.      * @see UserInterface
  231.      */
  232.     public function getSalt(): ?string
  233.     {
  234.         return null;
  235.     }
  236.     /**
  237.      * @see UserInterface
  238.      */
  239.     public function eraseCredentials()
  240.     {
  241.         // If you store any temporary, sensitive data on the user, clear it here
  242.         $this->plainPassword null;
  243.     }
  244.     public function getManagerId(): ?self
  245.     {
  246.         return $this->manager;
  247.     }
  248.     public function setManagerId(?self $manager): self
  249.     {
  250.         $this->manager $manager;
  251.         return $this;
  252.     }
  253.     
  254.     public function getFirstName(): ?string
  255.     {
  256.         return $this->firstName;
  257.     }
  258.     public function setFirstName(string $firstName): self
  259.     {
  260.         $this->firstName $firstName;
  261.         return $this;
  262.     }
  263.     public function getLastName(): ?string
  264.     {
  265.         return $this->lastName;
  266.     }
  267.     public function setLastName(string $lastName): self
  268.     {
  269.         $this->lastName $lastName;
  270.         return $this;
  271.     }
  272.     public function getPhone(): ?string
  273.     {
  274.         return $this->phone;
  275.     }
  276.     public function setPhone(?string $phone): self
  277.     {
  278.         $this->phone $phone;
  279.         return $this;
  280.     }
  281.     public function getAddress(): ?string
  282.     {
  283.         return $this->address;
  284.     }
  285.     public function setAddress(?string $address): self
  286.     {
  287.         $this->address $address;
  288.         return $this;
  289.     }
  290.     public function getStatus(): ?string
  291.     {
  292.         return $this->status;
  293.     }
  294.     public function setStatus(?string $status): self
  295.     {
  296.         $this->status $status;
  297.         return $this;
  298.     }
  299.     // /**
  300.     //  * @return Collection<int, UserLikeList>
  301.     //  */
  302.     // public function getUserLikeLists(): Collection
  303.     // {
  304.     //     return $this->userLikeLists;
  305.     // }
  306.     // public function addUserLikeList(UserLikeList $userLikeList): self
  307.     // {
  308.     //     if (!$this->userLikeLists->contains($userLikeList)) {
  309.     //         $this->userLikeLists->add($userLikeList);
  310.     //         $userLikeList->setUserId($this);
  311.     //     }
  312.     //     return $this;
  313.     // }
  314.     // public function removeUserLikeList(UserLikeList $userLikeList): self
  315.     // {
  316.     //     if ($this->userLikeLists->removeElement($userLikeList)) {
  317.     //         // set the owning side to null (unless already changed)
  318.     //         if ($userLikeList->getUserId() === $this) {
  319.     //             $userLikeList->setUserId(null);
  320.     //         }
  321.     //     }
  322.     //     return $this;
  323.     // }
  324.     // /**
  325.     //  * @return Collection<int, Products>
  326.     //  */
  327.     // public function getProducts(): Collection
  328.     // {
  329.     //     return $this->products;
  330.     // }
  331.     // public function addProduct(Products $product): self
  332.     // {
  333.     //     if (!$this->products->contains($product)) {
  334.     //         $this->products->add($product);
  335.     //         $product->setModifiedUserId($this);
  336.     //     }
  337.     //     return $this;
  338.     // }
  339.     // public function removeProduct(Products $product): self
  340.     // {
  341.     //     if ($this->products->removeElement($product)) {
  342.     //         // set the owning side to null (unless already changed)
  343.     //         if ($product->getModifiedUserId() === $this) {
  344.     //             $product->setModifiedUserId(null);
  345.     //         }
  346.     //     }
  347.     //     return $this;
  348.     // }
  349.     // /**
  350.     //  * @return Collection<int, Products>
  351.     //  */
  352.     // public function getCreateProducts(): Collection
  353.     // {
  354.     //     return $this->create_products;
  355.     // }
  356.     // public function addCreateProduct(Products $createProduct): self
  357.     // {
  358.     //     if (!$this->create_products->contains($createProduct)) {
  359.     //         $this->create_products->add($createProduct);
  360.     //         $createProduct->setCreatedBy($this);
  361.     //     }
  362.     //     return $this;
  363.     // }
  364.     // public function removeCreateProduct(Products $createProduct): self
  365.     // {
  366.     //     if ($this->create_products->removeElement($createProduct)) {
  367.     //         // set the owning side to null (unless already changed)
  368.     //         if ($createProduct->getCreatedBy() === $this) {
  369.     //             $createProduct->setCreatedBy(null);
  370.     //         }
  371.     //     }
  372.     //     return $this;
  373.     // }
  374.     // /**
  375.     //  * @return Collection<int, Orders>
  376.     //  */
  377.     // public function getOrders(): Collection
  378.     // {
  379.     //     return $this->orders;
  380.     // }
  381.     // public function addOrder(Orders $order): self
  382.     // {
  383.     //     if (!$this->orders->contains($order)) {
  384.     //         $this->orders->add($order);
  385.     //         $order->setUserId($this);
  386.     //     }
  387.     //     return $this;
  388.     // }
  389.     // public function removeOrder(Orders $order): self
  390.     // {
  391.     //     if ($this->orders->removeElement($order)) {
  392.     //         // set the owning side to null (unless already changed)
  393.     //         if ($order->getUserId() === $this) {
  394.     //             $order->setUserId(null);
  395.     //         }
  396.     //     }
  397.     //     return $this;
  398.     // }
  399.     // /**
  400.     //  * @return Collection<int, Orders>
  401.     //  */
  402.     // public function getManagerOrders(): Collection
  403.     // {
  404.     //     return $this->managerOrders;
  405.     // }
  406.     // public function addManagerOrder(Orders $managerOrder): self
  407.     // {
  408.     //     if (!$this->managerOrders->contains($managerOrder)) {
  409.     //         $this->managerOrders->add($managerOrder);
  410.     //         $managerOrder->setManagerId($this);
  411.     //     }
  412.     //     return $this;
  413.     // }
  414.     // public function removeManagerOrder(Orders $managerOrder): self
  415.     // {
  416.     //     if ($this->managerOrders->removeElement($managerOrder)) {
  417.     //         // set the owning side to null (unless already changed)
  418.     //         if ($managerOrder->getManagerId() === $this) {
  419.     //             $managerOrder->setManagerId(null);
  420.     //         }
  421.     //     }
  422.     //     return $this;
  423.     // }
  424.     public function getEmail(): ?string
  425.     {
  426.         return $this->email;
  427.     }
  428.     public function setEmail(?string $email): self
  429.     {
  430.         $this->email $email;
  431.         return $this;
  432.     }
  433.     // /**
  434.     //  * @return Collection<int, Accounts>
  435.     //  */
  436.     // public function getAccounts(): Collection
  437.     // {
  438.     //     return $this->accounts;
  439.     // }
  440.     // public function addAccount(Accounts $account): self
  441.     // {
  442.     //     if (!$this->accounts->contains($account)) {
  443.     //         $this->accounts->add($account);
  444.     //         $account->setUserId($this);
  445.     //     }
  446.     //     return $this;
  447.     // }
  448.     // public function removeAccount(Accounts $account): self
  449.     // {
  450.     //     if ($this->accounts->removeElement($account)) {
  451.     //         // set the owning side to null (unless already changed)
  452.     //         if ($account->getUserId() === $this) {
  453.     //             $account->setUserId(null);
  454.     //         }
  455.     //     }
  456.     //     return $this;
  457.     // }
  458.     // /**
  459.     //  * @return Collection<int, LoadInvoice>
  460.     //  */
  461.     // public function getLoadInvoices(): Collection
  462.     // {
  463.     //     return $this->loadInvoices;
  464.     // }
  465.     // public function addLoadInvoice(LoadInvoice $loadInvoice): self
  466.     // {
  467.     //     if (!$this->loadInvoices->contains($loadInvoice)) {
  468.     //         $this->loadInvoices->add($loadInvoice);
  469.     //         $loadInvoice->setClient($this);
  470.     //     }
  471.     //     return $this;
  472.     // }
  473.     // public function removeLoadInvoice(LoadInvoice $loadInvoice): self
  474.     // {
  475.     //     if ($this->loadInvoices->removeElement($loadInvoice)) {
  476.     //         // set the owning side to null (unless already changed)
  477.     //         if ($loadInvoice->getClient() === $this) {
  478.     //             $loadInvoice->setClient(null);
  479.     //         }
  480.     //     }
  481.     //     return $this;
  482.     // }
  483.     // /**
  484.     //  * @return Collection<int, Accepted>
  485.     //  */
  486.     // public function getAccepteds(): Collection
  487.     // {
  488.     //     return $this->accepteds;
  489.     // }
  490.     // public function addAccepted(Accepted $accepted): self
  491.     // {
  492.     //     if (!$this->accepteds->contains($accepted)) {
  493.     //         $this->accepteds->add($accepted);
  494.     //         $accepted->setManager($this);
  495.     //     }
  496.     //     return $this;
  497.     // }
  498.     // public function removeAccepted(Accepted $accepted): self
  499.     // {
  500.     //     if ($this->accepteds->removeElement($accepted)) {
  501.     //         // set the owning side to null (unless already changed)
  502.     //         if ($accepted->getManager() === $this) {
  503.     //             $accepted->setManager(null);
  504.     //         }
  505.     //     }
  506.     //     return $this;
  507.     // }
  508.     // /**
  509.     //  * @return Collection<int, AcceptedProduct>
  510.     //  */
  511.     // public function getN(): Collection
  512.     // {
  513.     //     return $this->n;
  514.     // }
  515.     // public function addN(AcceptedProduct $n): self
  516.     // {
  517.     //     if (!$this->n->contains($n)) {
  518.     //         $this->n->add($n);
  519.     //         $n->setModifiedUser($this);
  520.     //     }
  521.     //     return $this;
  522.     // }
  523.     // public function removeN(AcceptedProduct $n): self
  524.     // {
  525.     //     if ($this->n->removeElement($n)) {
  526.     //         // set the owning side to null (unless already changed)
  527.     //         if ($n->getModifiedUser() === $this) {
  528.     //             $n->setModifiedUser(null);
  529.     //         }
  530.     //     }
  531.     //     return $this;
  532.     // }
  533.     // public function getCodeUser(): ?string
  534.     // {
  535.     //     return $this->codeUser;
  536.     // }
  537.     // public function setCodeUser(string $codeUser): self
  538.     // {
  539.     //     $this->codeUser = $codeUser;
  540.     //     return $this;
  541.     // }
  542.     // public function getCodeManager(): ?string
  543.     // {
  544.     //     return $this->codeManager;
  545.     // }
  546.     // public function setCodeManager(string $codeManager): self
  547.     // {
  548.     //     $this->codeManager = $codeManager;
  549.     //     return $this;
  550.     // }
  551.     // /**
  552.     //  * @return Collection<int, Accounts>
  553.     //  */
  554.     // public function getManagerAccounts(): Collection
  555.     // {
  556.     //     return $this->managerAccounts;
  557.     // }
  558.     // public function addManagerAccount(Accounts $managerAccount): self
  559.     // {
  560.     //     if (!$this->managerAccounts->contains($managerAccount)) {
  561.     //         $this->managerAccounts->add($managerAccount);
  562.     //         $managerAccount->setManager($this);
  563.     //     }
  564.     //     return $this;
  565.     // }
  566.     // public function removeManagerAccount(Accounts $managerAccount): self
  567.     // {
  568.     //     if ($this->managerAccounts->removeElement($managerAccount)) {
  569.     //         // set the owning side to null (unless already changed)
  570.     //         if ($managerAccount->getManager() === $this) {
  571.     //             $managerAccount->setManager(null);
  572.     //         }
  573.     //     }
  574.     //     return $this;
  575.     // }
  576.     // /**
  577.     //  * @return Collection<int, PreOrder>
  578.     //  */
  579.     // public function getPreOrders(): Collection
  580.     // {
  581.     //     return $this->preOrders;
  582.     // }
  583.     // public function addPreOrder(PreOrder $preOrder): self
  584.     // {
  585.     //     if (!$this->preOrders->contains($preOrder)) {
  586.     //         $this->preOrders->add($preOrder);
  587.     //         $preOrder->setClient($this);
  588.     //     }
  589.     //     return $this;
  590.     // }
  591.     // public function removePreOrder(PreOrder $preOrder): self
  592.     // {
  593.     //     if ($this->preOrders->removeElement($preOrder)) {
  594.     //         // set the owning side to null (unless already changed)
  595.     //         if ($preOrder->getClient() === $this) {
  596.     //             $preOrder->setClient(null);
  597.     //         }
  598.     //     }
  599.     //     return $this;
  600.     // }
  601.     // /**
  602.     //  * @return Collection<int, PreOrder>
  603.     //  */
  604.     // public function getManagerPreOrders(): Collection
  605.     // {
  606.     //     return $this->ManagerPreOrders;
  607.     // }
  608.     // public function addManagerPreOrder(PreOrder $managerPreOrder): self
  609.     // {
  610.     //     if (!$this->ManagerPreOrders->contains($managerPreOrder)) {
  611.     //         $this->ManagerPreOrders->add($managerPreOrder);
  612.     //         $managerPreOrder->setManager($this);
  613.     //     }
  614.     //     return $this;
  615.     // }
  616.     // public function removeManagerPreOrder(PreOrder $managerPreOrder): self
  617.     // {
  618.     //     if ($this->ManagerPreOrders->removeElement($managerPreOrder)) {
  619.     //         // set the owning side to null (unless already changed)
  620.     //         if ($managerPreOrder->getManager() === $this) {
  621.     //             $managerPreOrder->setManager(null);
  622.     //         }
  623.     //     }
  624.     //     return $this;
  625.     // }
  626.     // public function getWorkSchedule(): ?string
  627.     // {
  628.     //     return $this->workSchedule;
  629.     // }
  630.     // public function setWorkSchedule(?string $workSchedule): self
  631.     // {
  632.     //     $this->workSchedule = $workSchedule;
  633.     //     return $this;
  634.     // }
  635.     // public function getTelegram(): ?string
  636.     // {
  637.     //     return $this->telegram;
  638.     // }
  639.     // public function setTelegram(?string $telegram): self
  640.     // {
  641.     //     $this->telegram = $telegram;
  642.     //     return $this;
  643.     // }
  644.     // public function getViber(): ?string
  645.     // {
  646.     //     return $this->viber;
  647.     // }
  648.     // public function setViber(?string $viber): self
  649.     // {
  650.     //     $this->viber = $viber;
  651.     //     return $this;
  652.     // }
  653.     /**
  654.      * @return Collection<int, MediaObject>
  655.      */
  656.     public function getMediaObjects(): Collection
  657.     {
  658.         return $this->mediaObjects;
  659.     }
  660.     public function addMediaObject(MediaObject $mediaObject): self
  661.     {
  662.         if (!$this->mediaObjects->contains($mediaObject)) {
  663.             $this->mediaObjects->add($mediaObject);
  664.             $mediaObject->setUsers($this);
  665.         }
  666.         return $this;
  667.     }
  668.     public function removeMediaObject(MediaObject $mediaObject): self
  669.     {
  670.         if ($this->mediaObjects->removeElement($mediaObject)) {
  671.             // set the owning side to null (unless already changed)
  672.             if ($mediaObject->getUsers() === $this) {
  673.                 $mediaObject->setUsers(null);
  674.             }
  675.         }
  676.         return $this;
  677.     }
  678.     // /**
  679.     //  * @return Collection<int, Coupons>
  680.     //  */
  681.     // public function getCoupons(): Collection
  682.     // {
  683.     //     return $this->coupons;
  684.     // }
  685.     // public function addCoupon(Coupons $coupon): self
  686.     // {
  687.     //     if (!$this->coupons->contains($coupon)) {
  688.     //         $this->coupons->add($coupon);
  689.     //         $coupon->addUser($this);
  690.     //     }
  691.     //     return $this;
  692.     // }
  693.     // public function removeCoupon(Coupons $coupon): self
  694.     // {
  695.     //     if ($this->coupons->removeElement($coupon)) {
  696.     //         $coupon->removeUser($this);
  697.     //     }
  698.     //     return $this;
  699.     // }
  700.     // /**
  701.     //  * @return Collection<int, ProductBalanceInStorage>
  702.     //  */
  703.     // public function getProductBalanceInStorages(): Collection
  704.     // {
  705.     //     return $this->productBalanceInStorages;
  706.     // }
  707.     // public function addProductBalanceInStorage(ProductBalanceInStorage $productBalanceInStorage): self
  708.     // {
  709.     //     if (!$this->productBalanceInStorages->contains($productBalanceInStorage)) {
  710.     //         $this->productBalanceInStorages->add($productBalanceInStorage);
  711.     //         $productBalanceInStorage->setManager($this);
  712.     //     }
  713.     //     return $this;
  714.     // }
  715.     // public function removeProductBalanceInStorage(ProductBalanceInStorage $productBalanceInStorage): self
  716.     // {
  717.     //     if ($this->productBalanceInStorages->removeElement($productBalanceInStorage)) {
  718.     //         // set the owning side to null (unless already changed)
  719.     //         if ($productBalanceInStorage->getManager() === $this) {
  720.     //             $productBalanceInStorage->setManager(null);
  721.     //         }
  722.     //     }
  723.     //     return $this;
  724.     // }
  725.     // public function getEmployed(): ?string
  726.     // {
  727.     //     return $this->employed;
  728.     // }
  729.     // public function setEmployed(?string $employed): static
  730.     // {
  731.     //     $this->employed = $employed;
  732.     //     return $this;
  733.     // }
  734.     // public function getAge(): ?string
  735.     // {
  736.     //     return $this->age;
  737.     // }
  738.     // public function setAge(?string $age): static
  739.     // {
  740.     //     $this->age = $age;
  741.     //     return $this;
  742.     // }
  743.     // public function getExDirector(): ?string
  744.     // {
  745.     //     return $this->exDirector;
  746.     // }
  747.     // public function setExDirector(?string $exDirector): static
  748.     // {
  749.     //     $this->exDirector = $exDirector;
  750.     //     return $this;
  751.     // }
  752.     // public function getCurrentDirector(): ?string
  753.     // {
  754.     //     return $this->currentDirector;
  755.     // }
  756.     // public function setCurrentDirector(?string $currentDirector): static
  757.     // {
  758.     //     $this->currentDirector = $currentDirector;
  759.     //     return $this;
  760.     // }
  761.     // public function getGender(): ?string
  762.     // {
  763.     //     return $this->gender;
  764.     // }
  765.     // public function setGender(?string $gender): static
  766.     // {
  767.     //     $this->gender = $gender;
  768.     //     return $this;
  769.     // }
  770.     // public function getSupportType(): array
  771.     // {
  772.     //     return $this->supportType;
  773.     // }
  774.     // public function setSupportType(?array $supportType): static
  775.     // {
  776.     //     $this->supportType = $supportType;
  777.     //     return $this;
  778.     // }
  779.     // public function getaddressFrom(): ?string
  780.     // {
  781.     //     return $this->addressFrom;
  782.     // }
  783.     // public function setaddressFrom(?string $addressFrom): static
  784.     // {
  785.     //     $this->addressFrom = $addressFrom;
  786.     //     return $this;
  787.     // }
  788.     // public function getAnotherProgram(): ?string
  789.     // {
  790.     //     return $this->anotherProgram;
  791.     // }
  792.     // public function setAnotherProgram(?string $anotherProgram): static
  793.     // {
  794.     //     $this->anotherProgram = $anotherProgram;
  795.     //     return $this;
  796.     // }
  797.     // public function getRegionFrom(): ?string
  798.     // {
  799.     //     return $this->regionFrom;
  800.     // }
  801.     // public function setRegionFrom(?string $regionFrom): static
  802.     // {
  803.     //     $this->regionFrom = $regionFrom;
  804.     //     return $this;
  805.     // }
  806.     // public function getNumberFOP(): ?string
  807.     // {
  808.     //     return $this->numberFOP;
  809.     // }
  810.     // public function setNumberFOP(?string $numberFOP): static
  811.     // {
  812.     //     $this->numberFOP = $numberFOP;
  813.     //     return $this;
  814.     // }
  815.     // public function getCodeEDRPOU(): ?string
  816.     // {
  817.     //     return $this->codeEDRPOU;
  818.     // }
  819.     // public function setCodeEDRPOU(?string $codeEDRPOU): static
  820.     // {
  821.     //     $this->codeEDRPOU = $codeEDRPOU;
  822.     //     return $this;
  823.     // }
  824.     // public function getGrantSupport(): ?string
  825.     // {
  826.     //     return $this->grantSupport;
  827.     // }
  828.     // public function setGrantSupport(?string $grantSupport): static
  829.     // {
  830.     //     $this->grantSupport = $grantSupport;
  831.     //     return $this;
  832.     // }
  833.     // public function getCompanyName(): ?string
  834.     // {
  835.     //     return $this->companyName;
  836.     // }
  837.     // public function setCompanyName(?string $companyName): static
  838.     // {
  839.     //     $this->companyName = $companyName;
  840.     //     return $this;
  841.     // }
  842.     // public function getUserType(): ?string
  843.     // {
  844.     //     return $this->userType;
  845.     // }
  846.     // public function setUserType(string $userType): static
  847.     // {
  848.     //     $this->userType = $userType;
  849.     //     return $this;
  850.     // }
  851.     // public function isIsSentForPYSupport(): ?bool
  852.     // {
  853.     //     return $this->isSentForPYSupport;
  854.     // }
  855.     // public function setIsSentForPYSupport(?bool $isSentForPYSupport): static
  856.     // {
  857.     //     $this->isSentForPYSupport = $isSentForPYSupport;
  858.     //     return $this;
  859.     // }
  860.     // public function getHash(): ?string
  861.     // {
  862.     //     return $this->hash;
  863.     // }
  864.     // public function setHash(?string $hash): static
  865.     // {
  866.     //     $this->hash = $hash;
  867.     //     return $this;
  868.     // }
  869.     // public function isEmailVerified(): ?bool
  870.     // {
  871.     //     return $this->emailVerified;
  872.     // }
  873.     // public function setEmailVerified(?bool $emailVerified): static
  874.     // {
  875.     //     $this->emailVerified = $emailVerified;
  876.     //     return $this;
  877.     // }
  878.     public function getHashDate(): ?\DateTimeInterface
  879.     {
  880.         return $this->hashDate;
  881.     }
  882.     public function setHashDate(?\DateTimeInterface $hashDate): static
  883.     {
  884.         $this->hashDate $hashDate;
  885.         return $this;
  886.     }
  887.     public function getDeviceId(): ?string
  888.     {
  889.         return $this->device_id;
  890.     }
  891.     public function setDeviceId(?string $device_id): static
  892.     {
  893.         $this->device_id $device_id;
  894.         return $this;
  895.     }
  896.     public function getActiveCode(): ?string
  897.     {
  898.         return $this->activeCode;
  899.     }
  900.     public function setActiveCode(?string $activeCode): static
  901.     {
  902.         $this->activeCode $activeCode;
  903.         return $this;
  904.     }
  905.     public function isDeleted(): ?bool
  906.     {
  907.         return $this->deleted;
  908.     }
  909.     public function setDeleted(?bool $deleted): static
  910.     {
  911.         $this->deleted $deleted;
  912.         return $this;
  913.     }
  914.     /**
  915.      * @return Collection<int, UserToken>
  916.      */
  917.     public function getUserTokens(): Collection
  918.     {
  919.         return $this->userTokens;
  920.     }
  921.     public function addUserToken(UserToken $userToken): static
  922.     {
  923.         if (!$this->userTokens->contains($userToken)) {
  924.             $this->userTokens->add($userToken);
  925.             $userToken->setUsers($this);
  926.         }
  927.         return $this;
  928.     }
  929.     public function removeUserToken(UserToken $userToken): static
  930.     {
  931.         if ($this->userTokens->removeElement($userToken)) {
  932.             // set the owning side to null (unless already changed)
  933.             if ($userToken->getUsers() === $this) {
  934.                 $userToken->setUsers(null);
  935.             }
  936.         }
  937.         return $this;
  938.     }
  939.     /**
  940.      * @return Collection<int, AppPersonalAccount>
  941.      */
  942.     public function getAppPersonalAccounts(): Collection
  943.     {
  944.         return $this->appPersonalAccounts;
  945.     }
  946.     public function addAppPersonalAccount(AppPersonalAccount $appPersonalAccount): static
  947.     {
  948.         if (!$this->appPersonalAccounts->contains($appPersonalAccount)) {
  949.             $this->appPersonalAccounts->add($appPersonalAccount);
  950.             $appPersonalAccount->setOwner($this);
  951.         }
  952.         return $this;
  953.     }
  954.     public function removeAppPersonalAccount(AppPersonalAccount $appPersonalAccount): static
  955.     {
  956.         if ($this->appPersonalAccounts->removeElement($appPersonalAccount)) {
  957.             // set the owning side to null (unless already changed)
  958.             if ($appPersonalAccount->getOwner() === $this) {
  959.                 $appPersonalAccount->setOwner(null);
  960.             }
  961.         }
  962.         return $this;
  963.     }
  964.     public function getDebug(): ?int
  965.     {
  966.         return $this->debug;
  967.     }
  968.     public function setDebug(?int $debug): static
  969.     {
  970.         $this->debug $debug;
  971.         return $this;
  972.     }
  973.     /**
  974.      * @return Collection<int, Notification>
  975.      */
  976.     public function getNotifications(): Collection
  977.     {
  978.         return $this->notifications;
  979.     }
  980.     public function addNotification(Notification $notification): static
  981.     {
  982.         if (!$this->notifications->contains($notification)) {
  983.             $this->notifications->add($notification);
  984.             $notification->setUsers($this);
  985.         }
  986.         return $this;
  987.     }
  988.     public function removeNotification(Notification $notification): static
  989.     {
  990.         if ($this->notifications->removeElement($notification)) {
  991.             // set the owning side to null (unless already changed)
  992.             if ($notification->getUsers() === $this) {
  993.                 $notification->setUsers(null);
  994.             }
  995.         }
  996.         return $this;
  997.     }
  998.     public function isDev(): ?bool
  999.     {
  1000.         return $this->dev;
  1001.     }
  1002.     public function setDev(?bool $dev): static
  1003.     {
  1004.         $this->dev $dev;
  1005.         return $this;
  1006.     }
  1007.     public function getDateEntered(): ?\DateTimeInterface
  1008.     {
  1009.         return $this->dateEntered;
  1010.     }
  1011.     public function setDateEntered(?\DateTimeInterface $dateEntered): static
  1012.     {
  1013.         $this->dateEntered $dateEntered;
  1014.         return $this;
  1015.     }
  1016.     /**
  1017.      * @return Collection<int, MassiveNotification>
  1018.      */
  1019.     public function getMassiveNotifications(): Collection
  1020.     {
  1021.         return $this->massiveNotifications;
  1022.     }
  1023.     public function addMassiveNotification(MassiveNotification $massiveNotification): static
  1024.     {
  1025.         if (!$this->massiveNotifications->contains($massiveNotification)) {
  1026.             $this->massiveNotifications->add($massiveNotification);
  1027.             $massiveNotification->setUserCreated($this);
  1028.         }
  1029.         return $this;
  1030.     }
  1031.     public function removeMassiveNotification(MassiveNotification $massiveNotification): static
  1032.     {
  1033.         if ($this->massiveNotifications->removeElement($massiveNotification)) {
  1034.             // set the owning side to null (unless already changed)
  1035.             if ($massiveNotification->getUserCreated() === $this) {
  1036.                 $massiveNotification->setUserCreated(null);
  1037.             }
  1038.         }
  1039.         return $this;
  1040.     }
  1041.     public function getNotificationStatus(): ?string
  1042.     {
  1043.         return $this->notificationStatus;
  1044.     }
  1045.     public function setNotificationStatus(?string $notificationStatus): static
  1046.     {
  1047.         $this->notificationStatus $notificationStatus;
  1048.         return $this;
  1049.     }
  1050.     /**
  1051.      * @return Collection<int, UserRole>
  1052.      */
  1053.     public function getUserRoles(): Collection
  1054.     {
  1055.         return $this->userRoles;
  1056.     }
  1057.     public function addUserRole(UserRole $userRole): static
  1058.     {
  1059.         if (!$this->userRoles->contains($userRole)) {
  1060.             $this->userRoles->add($userRole);
  1061.             $userRole->setUsers($this);
  1062.         }
  1063.         
  1064.         return $this;
  1065.     }
  1066.     public function getEmailStatus(): ?string
  1067.     {
  1068.         return $this->emailStatus;
  1069.     }
  1070.     public function setEmailStatus(?string $emailStatus): static
  1071.     {
  1072.         $this->emailStatus $emailStatus;
  1073.         return $this;
  1074.     }
  1075.     public function getOsType(): ?string
  1076.     {
  1077.         return $this->osType;
  1078.     }
  1079.     public function setOsType(?string $osType): static
  1080.     {
  1081.         $this->osType $osType;
  1082.         return $this;
  1083.     }
  1084. }