src/Entity/User.php line 72

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