src/Entity/User.php line 71

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