src/Entity/User.php line 70

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