src/Entity/User.php line 67

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 Delete()
  41.     ],
  42.     normalizationContext: ['groups' => ['user:read']],
  43.     denormalizationContext: ['groups' => ['user:create''user:update']],
  44. )]
  45. #[ORM\Entity(repositoryClassUserRepository::class)]
  46. #[UniqueEntity(fields: ['username'], message'There is already an account with this username')]
  47. #[ApiFilter(CustomOrFilter::class,properties: [
  48.     'username' => 'ipartial'
  49.     'firstName' => 'ipartial'
  50.     'lastName' => 'ipartial',
  51.     'codeUser' => 'exact',
  52.     'codeManager' => 'exact',
  53. ])]
  54. #[ApiFilter(SearchFilter::class, properties: [
  55.     'accounts.manager.id' => 'exact',
  56.     'phone' => 'exact',
  57. ])]
  58. class User implements UserInterfacePasswordAuthenticatedUserInterface
  59. {
  60.     #[ORM\Id]
  61.     #[ORM\GeneratedValue]
  62.     #[ORM\Column]
  63.     #[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',  'user_docs:read''product:read''comment:read'])]
  64.     private ?int $id null;
  65.     #[ORM\Column(length180uniquetrue)]
  66.     #[Groups(['user:read''user:create''user:update''read''account:read''user_docs:read'])]
  67.     private ?string $username null;
  68.     #[Groups(['user:read''user:update'])]
  69.     #[ORM\Column]
  70.     private array $roles = [];
  71.     /**
  72.      * @var string The hashed password
  73.      */
  74.     #[ORM\Column]
  75.     private ?string $password null;
  76.     #[Assert\NotBlank(groups: ['user:create'])]
  77.     #[Groups(['user:create''user:update'])]
  78.     private ?string $plainPassword null;
  79.     #[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''product:read''comment:read'])]
  80.     #[ORM\Column(length255nullabletrue)]
  81.     private ?string $firstName  null;
  82.     #[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''product:read''comment:read'])]
  83.     #[ORM\Column(length255nullabletrue)]
  84.     private ?string $lastName null;
  85.     #[Groups(['user:read''user:create''user:update''account:read'])]
  86.     #[ORM\Column(length100nullabletrue)]
  87.     private ?string $phone null;
  88.     #[Groups(['user:read''user:create''user:update'])]
  89.     #[ORM\Column(length255nullabletrue)]
  90.     private ?string $address null
  91.     #[Groups(['user:read''user:create''user:update'])]
  92.     #[ORM\Column(length50nullabletrue)]
  93.     private ?string $status null;
  94.     #[ORM\OneToMany(mappedBy'user'targetEntityUserLikeList::class)]
  95.     private Collection $userLikeLists;
  96.     #[ORM\OneToMany(mappedBy'modified_user'targetEntityProducts::class)]
  97.     private Collection $products;
  98.     #[ORM\OneToMany(mappedBy'created_by'targetEntityProducts::class)]
  99.     private Collection $create_products;
  100.     #[ORM\OneToMany(mappedBy'client'targetEntityOrders::class)]
  101.     private Collection $orders;
  102.     #[ORM\OneToMany(mappedBy'manager'targetEntityOrders::class)]
  103.     private Collection $managerOrders;
  104.     #[Groups(['user:read''user:create''user:update''read''account:read'])]
  105.     #[ORM\Column(length255nullabletrue)]
  106.     private ?string $email null;
  107.     #[Groups(['user:read''user:create''user:update''read'])]
  108.     #[ORM\OneToMany(mappedBy'user'targetEntityAccounts::class)]
  109.     private Collection $accounts;
  110.     #[ORM\OneToMany(mappedBy'client'targetEntityLoadInvoice::class)]
  111.     private Collection $loadInvoices;
  112.     #[ORM\OneToMany(mappedBy'manager'targetEntityAccepted::class)]
  113.     private Collection $acceptedsManager;
  114.  
  115.     #[ORM\OneToMany(mappedBy'client'targetEntityAccepted::class)]
  116.     private Collection $acceptedsClients;
  117.     #[ORM\OneToMany(mappedBy'modified_user'targetEntityAcceptedProduct::class)]
  118.     private Collection $n;
  119.     #[ORM\Column(length20nullabletrue)]
  120.     #[Groups(['user:read''account:read''user:create''user:update''order:read''order_product:read'])]
  121.     private ?string $codeUser null;
  122.     #[ORM\Column(length20nullabletrue)]
  123.     #[Groups(['user:read''account:read''user:create''user:update''order:read''order_product:read'])]
  124.     private ?string $codeManager null;
  125.     #[ORM\OneToMany(mappedBy'manager'targetEntityAccounts::class)]
  126.     private Collection $managerAccounts;
  127.     #[ORM\OneToMany(mappedBy'client'targetEntityPreOrder::class)]
  128.     private Collection $preOrders;
  129.     #[ORM\OneToMany(mappedBy'manager'targetEntityPreOrder::class)]
  130.     private Collection $ManagerPreOrders;
  131.     #[Groups(['user:read''user:create''user:update''read''account:read'])]
  132.     #[ORM\Column(length255nullabletrue)]
  133.     private ?string $workSchedule null;
  134.     #[Groups(['user:read''user:create''user:update''read''account:read'])]
  135.     #[ORM\Column(length255nullabletrue)]
  136.     private ?string $telegram null;
  137.     #[Groups(['user:read''user:create''user:update''read''account:read'])]
  138.     #[ORM\Column(length255nullabletrue)]
  139.     private ?string $viber null;
  140.     #[Groups(['user:read''user:create''user:update''read''account:read'])]
  141.     #[ORM\OneToMany(mappedBy'users'targetEntityMediaObject::class)]
  142.     private Collection $mediaObjects;
  143.     #[ORM\ManyToMany(targetEntityCoupons::class, mappedBy'users')]
  144.     private Collection $coupons;
  145.     #[ORM\OneToMany(mappedBy'users'targetEntityUsersDocs::class)]
  146.     private Collection $usersDocs;
  147.     
  148.     #[ORM\OneToMany(mappedBy'manager'targetEntityProductBalanceInStorage::class)]
  149.     private Collection $productBalanceInStorages;
  150.     #[Groups(['user:read''user:create''user:update'])]
  151.     #[ORM\ManyToOne(inversedBy'users')]
  152.     private ?Location $location null;
  153.     #[ORM\OneToMany(mappedBy'users'targetEntityComments::class)]
  154.     private Collection $comments;
  155.     #[ORM\OneToMany(mappedBy'created_by'targetEntityFaq::class)]
  156.     private Collection $faqs;
  157.     #[ORM\OneToMany(mappedBy'modifiedUser'targetEntityFaq::class)]
  158.     private Collection $modifiedFaq;
  159.     #[ORM\Column(length100nullabletrue)]
  160.     private ?string $actionToken null;
  161.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  162.     private ?\DateTimeInterface $actionTime null;
  163.     public function __construct()
  164.     {
  165.         $this->userLikeLists = new ArrayCollection();
  166.         $this->products = new ArrayCollection();
  167.         $this->create_products = new ArrayCollection();
  168.         $this->orders = new ArrayCollection();
  169.         $this->managerOrders = new ArrayCollection();
  170.         $this->accounts = new ArrayCollection();
  171.         $this->loadInvoices = new ArrayCollection();
  172.         $this->acceptedsManager = new ArrayCollection();
  173.         $this->acceptedsClients = new ArrayCollection();
  174.         $this->= new ArrayCollection();
  175.         $this->managerAccounts = new ArrayCollection();
  176.         $this->preOrders = new ArrayCollection();
  177.         $this->ManagerPreOrders = new ArrayCollection();
  178.         $this->mediaObjects = new ArrayCollection();
  179.         $this->coupons = new ArrayCollection();
  180.         $this->usersDocs = new ArrayCollection();
  181.         $this->productBalanceInStorages = new ArrayCollection();
  182.         $this->comments = new ArrayCollection();
  183.         $this->faqs = new ArrayCollection();
  184.         $this->modifiedFaq = new ArrayCollection();
  185.     }
  186.     public function getId(): ?int
  187.     {
  188.         return $this->id;
  189.     }
  190.     /**
  191.      * @deprecated since Symfony 5.3, use getUserIdentifier instead
  192.      */
  193.     public function getUsername(): string
  194.     {
  195.         return (string) $this->username;
  196.     }
  197.     public function setUsername(string $username): self
  198.     {
  199.         $this->username $username;
  200.         return $this;
  201.     }
  202.     /**
  203.      * A visual identifier that represents this user.
  204.      *
  205.      * @see UserInterface
  206.      */
  207.     public function getUserIdentifier(): string
  208.     {
  209.         return (string) $this->username;
  210.     }
  211.     /**
  212.      * @see UserInterface
  213.      */
  214.     public function getRoles(): array
  215.     {
  216.         $roles $this->roles;
  217.         // guarantee every user at least has ROLE_USER
  218.         $roles[] = 'ROLE_USER';
  219.         return array_unique($roles);
  220.     }
  221.     public function setRoles(array $roles): self
  222.     {
  223.         $this->roles $roles;
  224.         return $this;
  225.     }
  226.     /**
  227.      * @see PasswordAuthenticatedUserInterface
  228.      */
  229.     public function getPassword(): string
  230.     {
  231.         return $this->password;
  232.     }
  233.     public function setPassword(string $password): self
  234.     {
  235.         $this->password $password;
  236.         return $this;
  237.     }
  238.     public function getPlainPassword(): ?string
  239.     {
  240.         return $this->plainPassword;
  241.     }
  242.     public function setPlainPassword(?string $plainPassword): self
  243.     {
  244.         $this->plainPassword $plainPassword;
  245.         return $this;
  246.     }
  247.     /**
  248.      * Returning a salt is only needed, if you are not using a modern
  249.      * hashing algorithm (e.g. bcrypt or sodium) in your security.yaml.
  250.      *
  251.      * @see UserInterface
  252.      */
  253.     public function getSalt(): ?string
  254.     {
  255.         return null;
  256.     }
  257.     /**
  258.      * @see UserInterface
  259.      */
  260.     public function eraseCredentials()
  261.     {
  262.         // If you store any temporary, sensitive data on the user, clear it here
  263.         $this->plainPassword null;
  264.     }
  265.     public function getFirstName(): ?string
  266.     {
  267.         return $this->firstName;
  268.     }
  269.     public function setFirstName(string $firstName): self
  270.     {
  271.         $this->firstName $firstName;
  272.         return $this;
  273.     }
  274.     public function getLastName(): ?string
  275.     {
  276.         return $this->lastName;
  277.     }
  278.     public function setLastName(string $lastName): self
  279.     {
  280.         $this->lastName $lastName;
  281.         return $this;
  282.     }
  283.     public function getPhone(): ?string
  284.     {
  285.         return $this->phone;
  286.     }
  287.     public function setPhone(?string $phone): self
  288.     {
  289.         $this->phone $phone;
  290.         return $this;
  291.     }
  292.     public function getAddress(): ?string
  293.     {
  294.         return $this->address;
  295.     }
  296.     public function setAddress(?string $address): self
  297.     {
  298.         $this->address $address;
  299.         return $this;
  300.     }
  301.     public function getStatus(): ?string
  302.     {
  303.         return $this->status;
  304.     }
  305.     public function setStatus(?string $status): self
  306.     {
  307.         $this->status $status;
  308.         return $this;
  309.     }
  310.     /**
  311.      * @return Collection<int, UserLikeList>
  312.      */
  313.     public function getUserLikeLists(): Collection
  314.     {
  315.         return $this->userLikeLists;
  316.     }
  317.     public function addUserLikeList(UserLikeList $userLikeList): self
  318.     {
  319.         if (!$this->userLikeLists->contains($userLikeList)) {
  320.             $this->userLikeLists->add($userLikeList);
  321.             $userLikeList->setUserId($this);
  322.         }
  323.         return $this;
  324.     }
  325.     public function removeUserLikeList(UserLikeList $userLikeList): self
  326.     {
  327.         if ($this->userLikeLists->removeElement($userLikeList)) {
  328.             // set the owning side to null (unless already changed)
  329.             if ($userLikeList->getUserId() === $this) {
  330.                 $userLikeList->setUserId(null);
  331.             }
  332.         }
  333.         return $this;
  334.     }
  335.     /**
  336.      * @return Collection<int, Products>
  337.      */
  338.     public function getProducts(): Collection
  339.     {
  340.         return $this->products;
  341.     }
  342.     public function addProduct(Products $product): self
  343.     {
  344.         if (!$this->products->contains($product)) {
  345.             $this->products->add($product);
  346.             $product->setModifiedUserId($this);
  347.         }
  348.         return $this;
  349.     }
  350.     // public function removeProduct(Products $product): self
  351.     // {
  352.     //     if ($this->products->removeElement($product)) {
  353.     //         // set the owning side to null (unless already changed)
  354.     //         if ($product->getModifiedUserId() === $this) {
  355.     //             $product->setModifiedUserId(null);
  356.     //         }
  357.     //     }
  358.     //     return $this;
  359.     // }
  360.     /**
  361.      * @return Collection<int, Products>
  362.      */
  363.     public function getCreateProducts(): Collection
  364.     {
  365.         return $this->create_products;
  366.     }
  367.     public function addCreateProduct(Products $createProduct): self
  368.     {
  369.         if (!$this->create_products->contains($createProduct)) {
  370.             $this->create_products->add($createProduct);
  371.             $createProduct->setCreatedBy($this);
  372.         }
  373.         return $this;
  374.     }
  375.     // public function removeCreateProduct(Products $createProduct): self
  376.     // {
  377.     //     if ($this->create_products->removeElement($createProduct)) {
  378.     //         // set the owning side to null (unless already changed)
  379.     //         if ($createProduct->getCreatedBy() === $this) {
  380.     //             $createProduct->setCreatedBy(null);
  381.     //         }
  382.     //     }
  383.     //     return $this;
  384.     // }
  385.     /**
  386.      * @return Collection<int, Orders>
  387.      */
  388.     public function getOrders(): Collection
  389.     {
  390.         return $this->orders;
  391.     }
  392.     public function addOrder(Orders $order): self
  393.     {
  394.         if (!$this->orders->contains($order)) {
  395.             $this->orders->add($order);
  396.             $order->setUserId($this);
  397.         }
  398.         return $this;
  399.     }
  400.     // public function removeOrder(Orders $order): self
  401.     // {
  402.     //     if ($this->orders->removeElement($order)) {
  403.     //         // set the owning side to null (unless already changed)
  404.     //         if ($order->getUserId() === $this) {
  405.     //             $order->setUserId(null);
  406.     //         }
  407.     //     }
  408.     //     return $this;
  409.     // }
  410.     /**
  411.      * @return Collection<int, Orders>
  412.      */
  413.     public function getManagerOrders(): Collection
  414.     {
  415.         return $this->managerOrders;
  416.     }
  417.     public function addManagerOrder(Orders $managerOrder): self
  418.     {
  419.         if (!$this->managerOrders->contains($managerOrder)) {
  420.             $this->managerOrders->add($managerOrder);
  421.             $managerOrder->setManagerId($this);
  422.         }
  423.         return $this;
  424.     }
  425.     // public function removeManagerOrder(Orders $managerOrder): self
  426.     // {
  427.     //     if ($this->managerOrders->removeElement($managerOrder)) {
  428.     //         // set the owning side to null (unless already changed)
  429.     //         if ($managerOrder->getManagerId() === $this) {
  430.     //             $managerOrder->setManagerId(null);
  431.     //         }
  432.     //     }
  433.     //     return $this;
  434.     // }
  435.     public function getEmail(): ?string
  436.     {
  437.         return $this->email;
  438.     }
  439.     public function setEmail(?string $email): self
  440.     {
  441.         $this->email $email;
  442.         return $this;
  443.     }
  444.     /**
  445.      * @return Collection<int, Accounts>
  446.      */
  447.     public function getAccounts(): Collection
  448.     {
  449.         return $this->accounts;
  450.     }
  451.     public function addAccount(Accounts $account): self
  452.     {
  453.         if (!$this->accounts->contains($account)) {
  454.             $this->accounts->add($account);
  455.             $account->setUserId($this);
  456.         }
  457.         return $this;
  458.     }
  459.     public function removeAccount(Accounts $account): self
  460.     {
  461.         if ($this->accounts->removeElement($account)) {
  462.             // set the owning side to null (unless already changed)
  463.             if ($account->getUserId() === $this) {
  464.                 $account->setUserId(null);
  465.             }
  466.         }
  467.         return $this;
  468.     }
  469.     /**
  470.      * @return Collection<int, LoadInvoice>
  471.      */
  472.     public function getLoadInvoices(): Collection
  473.     {
  474.         return $this->loadInvoices;
  475.     }
  476.     public function addLoadInvoice(LoadInvoice $loadInvoice): self
  477.     {
  478.         if (!$this->loadInvoices->contains($loadInvoice)) {
  479.             $this->loadInvoices->add($loadInvoice);
  480.             $loadInvoice->setClient($this);
  481.         }
  482.         return $this;
  483.     }
  484.     public function removeLoadInvoice(LoadInvoice $loadInvoice): self
  485.     {
  486.         if ($this->loadInvoices->removeElement($loadInvoice)) {
  487.             // set the owning side to null (unless already changed)
  488.             if ($loadInvoice->getClient() === $this) {
  489.                 $loadInvoice->setClient(null);
  490.             }
  491.         }
  492.         return $this;
  493.     }
  494.     /**
  495.      * @return Collection<int, Accepted>
  496.      * acceptedsManager
  497.         *acceptedsClients
  498.      */
  499.     public function getAcceptedsManager(): Collection
  500.     {
  501.         return $this->acceptedsManager;
  502.     }
  503.     public function addAcceptedsManager(Accepted $acceptedsManager): self
  504.     {
  505.         if (!$this->acceptedsManager->contains($acceptedsManager)) {
  506.             $this->acceptedsManager->add($acceptedsManager);
  507.             $acceptedsManager->setManager($this);
  508.         }
  509.         return $this;
  510.     }
  511.     public function removeAcceptedsManager(Accepted $acceptedsManager): self
  512.     {
  513.         if ($this->acceptedsManager->removeElement($acceptedsManager)) {
  514.             // set the owning side to null (unless already changed)
  515.             if ($acceptedsManager->getManager() === $this) {
  516.                 $acceptedsManager->setManager(null);
  517.             }
  518.         }
  519.         return $this;
  520.     }
  521.     /**
  522.      * @return Collection<int, Accepted>
  523.      * acceptedsManager
  524.         *acceptedsClients
  525.      */
  526.     public function getAcceptedsClients(): Collection
  527.     {
  528.         return $this->acceptedsClients;
  529.     }
  530.     public function addAcceptedsClients(Accepted $acceptedsClients): self
  531.     {
  532.         if (!$this->acceptedsClients->contains($acceptedsClients)) {
  533.             $this->acceptedsClients->add($acceptedsClients);
  534.             $acceptedsClients->setManager($this);
  535.         }
  536.         return $this;
  537.     }
  538.     public function removeAcceptedsClients(Accepted $acceptedsClients): self
  539.     {
  540.         if ($this->acceptedsClients->removeElement($acceptedsClients)) {
  541.             // set the owning side to null (unless already changed)
  542.             if ($acceptedsClients->getManager() === $this) {
  543.                 $acceptedsClients->setManager(null);
  544.             }
  545.         }
  546.         return $this;
  547.     }
  548.     /**
  549.      * @return Collection<int, AcceptedProduct>
  550.      */
  551.     public function getN(): Collection
  552.     {
  553.         return $this->n;
  554.     }
  555.     public function addN(AcceptedProduct $n): self
  556.     {
  557.         if (!$this->n->contains($n)) {
  558.             $this->n->add($n);
  559.             $n->setModifiedUser($this);
  560.         }
  561.         return $this;
  562.     }
  563.     public function removeN(AcceptedProduct $n): self
  564.     {
  565.         if ($this->n->removeElement($n)) {
  566.             // set the owning side to null (unless already changed)
  567.             if ($n->getModifiedUser() === $this) {
  568.                 $n->setModifiedUser(null);
  569.             }
  570.         }
  571.         return $this;
  572.     }
  573.     public function getCodeUser(): ?string
  574.     {
  575.         return $this->codeUser;
  576.     }
  577.     public function setCodeUser(string $codeUser): self
  578.     {
  579.         $this->codeUser $codeUser;
  580.         return $this;
  581.     }
  582.     public function getCodeManager(): ?string
  583.     {
  584.         return $this->codeManager;
  585.     }
  586.     public function setCodeManager(string $codeManager): self
  587.     {
  588.         $this->codeManager $codeManager;
  589.         return $this;
  590.     }
  591.     /**
  592.      * @return Collection<int, Accounts>
  593.      */
  594.     public function getManagerAccounts(): Collection
  595.     {
  596.         return $this->managerAccounts;
  597.     }
  598.     public function addManagerAccount(Accounts $managerAccount): self
  599.     {
  600.         if (!$this->managerAccounts->contains($managerAccount)) {
  601.             $this->managerAccounts->add($managerAccount);
  602.             $managerAccount->setManager($this);
  603.         }
  604.         return $this;
  605.     }
  606.     public function removeManagerAccount(Accounts $managerAccount): self
  607.     {
  608.         if ($this->managerAccounts->removeElement($managerAccount)) {
  609.             // set the owning side to null (unless already changed)
  610.             if ($managerAccount->getManager() === $this) {
  611.                 $managerAccount->setManager(null);
  612.             }
  613.         }
  614.         return $this;
  615.     }
  616.     /**
  617.      * @return Collection<int, PreOrder>
  618.      */
  619.     public function getPreOrders(): Collection
  620.     {
  621.         return $this->preOrders;
  622.     }
  623.     public function addPreOrder(PreOrder $preOrder): self
  624.     {
  625.         if (!$this->preOrders->contains($preOrder)) {
  626.             $this->preOrders->add($preOrder);
  627.             $preOrder->setClient($this);
  628.         }
  629.         return $this;
  630.     }
  631.     public function removePreOrder(PreOrder $preOrder): self
  632.     {
  633.         if ($this->preOrders->removeElement($preOrder)) {
  634.             // set the owning side to null (unless already changed)
  635.             if ($preOrder->getClient() === $this) {
  636.                 $preOrder->setClient(null);
  637.             }
  638.         }
  639.         return $this;
  640.     }
  641.     /**
  642.      * @return Collection<int, PreOrder>
  643.      */
  644.     public function getManagerPreOrders(): Collection
  645.     {
  646.         return $this->ManagerPreOrders;
  647.     }
  648.     public function addManagerPreOrder(PreOrder $managerPreOrder): self
  649.     {
  650.         if (!$this->ManagerPreOrders->contains($managerPreOrder)) {
  651.             $this->ManagerPreOrders->add($managerPreOrder);
  652.             $managerPreOrder->setManager($this);
  653.         }
  654.         return $this;
  655.     }
  656.     public function removeManagerPreOrder(PreOrder $managerPreOrder): self
  657.     {
  658.         if ($this->ManagerPreOrders->removeElement($managerPreOrder)) {
  659.             // set the owning side to null (unless already changed)
  660.             if ($managerPreOrder->getManager() === $this) {
  661.                 $managerPreOrder->setManager(null);
  662.             }
  663.         }
  664.         return $this;
  665.     }
  666.     public function getWorkSchedule(): ?string
  667.     {
  668.         return $this->workSchedule;
  669.     }
  670.     public function setWorkSchedule(?string $workSchedule): self
  671.     {
  672.         $this->workSchedule $workSchedule;
  673.         return $this;
  674.     }
  675.     public function getTelegram(): ?string
  676.     {
  677.         return $this->telegram;
  678.     }
  679.     public function setTelegram(?string $telegram): self
  680.     {
  681.         $this->telegram $telegram;
  682.         return $this;
  683.     }
  684.     public function getViber(): ?string
  685.     {
  686.         return $this->viber;
  687.     }
  688.     public function setViber(?string $viber): self
  689.     {
  690.         $this->viber $viber;
  691.         return $this;
  692.     }
  693.     /**
  694.      * @return Collection<int, MediaObject>
  695.      */
  696.     public function getMediaObjects(): Collection
  697.     {
  698.         return $this->mediaObjects;
  699.     }
  700.     public function addMediaObject(MediaObject $mediaObject): self
  701.     {
  702.         if (!$this->mediaObjects->contains($mediaObject)) {
  703.             $this->mediaObjects->add($mediaObject);
  704.             $mediaObject->setUsers($this);
  705.         }
  706.         return $this;
  707.     }
  708.     public function removeMediaObject(MediaObject $mediaObject): self
  709.     {
  710.         if ($this->mediaObjects->removeElement($mediaObject)) {
  711.             // set the owning side to null (unless already changed)
  712.             if ($mediaObject->getUsers() === $this) {
  713.                 $mediaObject->setUsers(null);
  714.             }
  715.         }
  716.         return $this;
  717.     }
  718.     /**
  719.      * @return Collection<int, Coupons>
  720.      */
  721.     public function getCoupons(): Collection
  722.     {
  723.         return $this->coupons;
  724.     }
  725.     public function addCoupon(Coupons $coupon): self
  726.     {
  727.         if (!$this->coupons->contains($coupon)) {
  728.             $this->coupons->add($coupon);
  729.             $coupon->addUser($this);
  730.         }
  731.         return $this;
  732.     }
  733.     public function removeCoupon(Coupons $coupon): self
  734.     {
  735.         if ($this->coupons->removeElement($coupon)) {
  736.             $coupon->removeUser($this);
  737.         }
  738.         return $this;
  739.     }
  740.     /**
  741.      * @return Collection<int, UsersDocs>
  742.      */
  743.     public function getUsersDocs(): Collection
  744.     {
  745.         return $this->usersDocs;
  746.     }
  747.     public function addUsersDoc(UsersDocs $usersDoc): static
  748.     {
  749.         if (!$this->usersDocs->contains($usersDoc)) {
  750.             $this->usersDocs->add($usersDoc);
  751.             $usersDoc->setUsers($this);
  752.         }
  753.         return $this;
  754.     }
  755.     
  756.     /**
  757.      * @return Collection<int, ProductBalanceInStorage>
  758.      */
  759.     public function getProductBalanceInStorages(): Collection
  760.     {
  761.         return $this->productBalanceInStorages;
  762.     }
  763.     public function addProductBalanceInStorage(ProductBalanceInStorage $productBalanceInStorage): self
  764.     {
  765.         if (!$this->productBalanceInStorages->contains($productBalanceInStorage)) {
  766.             $this->productBalanceInStorages->add($productBalanceInStorage);
  767.             $productBalanceInStorage->setManager($this);
  768.         }
  769.         return $this;
  770.     }
  771.     public function removeUsersDoc(UsersDocs $usersDoc): static
  772.     {
  773.         if ($this->usersDocs->removeElement($usersDoc)) {
  774.             // set the owning side to null (unless already changed)
  775.             if ($usersDoc->getUsers() === $this) {
  776.                 $usersDoc->setUsers(null);
  777.             }
  778.         }
  779.         return $this;
  780.     }
  781.     public function removeProductBalanceInStorage(ProductBalanceInStorage $productBalanceInStorage): self
  782.     {
  783.         if ($this->productBalanceInStorages->removeElement($productBalanceInStorage)) {
  784.             // set the owning side to null (unless already changed)
  785.             if ($productBalanceInStorage->getManager() === $this) {
  786.                 $productBalanceInStorage->setManager(null);
  787.             }
  788.         }
  789.         return $this;
  790.     }
  791.     public function getLocation(): ?Location
  792.     {
  793.         return $this->location;
  794.     }
  795.     public function setLocation(?Location $location): self
  796.     {
  797.         $this->location $location;
  798.         return $this;
  799.     }
  800.     /**
  801.      * @return Collection<int, Comments>
  802.      */
  803.     public function getComments(): Collection
  804.     {
  805.         return $this->comments;
  806.     }
  807.     public function addComment(Comments $comment): static
  808.     {
  809.         if (!$this->comments->contains($comment)) {
  810.             $this->comments->add($comment);
  811.             $comment->setUsers($this);
  812.         }
  813.         return $this;
  814.     }
  815.     public function removeComment(Comments $comment): static
  816.     {
  817.         if ($this->comments->removeElement($comment)) {
  818.             // set the owning side to null (unless already changed)
  819.             if ($comment->getUsers() === $this) {
  820.                 $comment->setUsers(null);
  821.             }
  822.         }
  823.         return $this;
  824.     }
  825.     /**
  826.      * @return Collection<int, Faq>
  827.      */
  828.     public function getFaqs(): Collection
  829.     {
  830.         return $this->faqs;
  831.     }
  832.     public function addFaq(Faq $faq): static
  833.     {
  834.         if (!$this->faqs->contains($faq)) {
  835.             $this->faqs->add($faq);
  836.             $faq->setCreatedBy($this);
  837.         }
  838.         return $this;
  839.     }
  840.     public function removeFaq(Faq $faq): static
  841.     {
  842.         if ($this->faqs->removeElement($faq)) {
  843.             // set the owning side to null (unless already changed)
  844.             if ($faq->getCreatedBy() === $this) {
  845.                 $faq->setCreatedBy(null);
  846.             }
  847.         }
  848.         return $this;
  849.     }
  850.     /**
  851.      * @return Collection<int, Faq>
  852.      */
  853.     public function getModifiedFaq(): Collection
  854.     {
  855.         return $this->modifiedFaq;
  856.     }
  857.     public function addModifiedFaq(Faq $modifiedFaq): static
  858.     {
  859.         if (!$this->modifiedFaq->contains($modifiedFaq)) {
  860.             $this->modifiedFaq->add($modifiedFaq);
  861.             $modifiedFaq->setModifiedUser($this);
  862.         }
  863.         return $this;
  864.     }
  865.     public function removeModifiedFaq(Faq $modifiedFaq): static
  866.     {
  867.         if ($this->modifiedFaq->removeElement($modifiedFaq)) {
  868.             // set the owning side to null (unless already changed)
  869.             if ($modifiedFaq->getModifiedUser() === $this) {
  870.                 $modifiedFaq->setModifiedUser(null);
  871.             }
  872.         }
  873.         return $this;
  874.     }
  875.     public function getActionToken(): ?string
  876.     {
  877.         return $this->actionToken;
  878.     }
  879.     public function setActionToken(?string $actionToken): static
  880.     {
  881.         $this->actionToken $actionToken;
  882.         return $this;
  883.     }
  884.     public function getActionTime(): ?\DateTimeInterface
  885.     {
  886.         return $this->actionTime;
  887.     }
  888.     public function setActionTime(?\DateTimeInterface $actionTime): static
  889.     {
  890.         $this->actionTime $actionTime;
  891.         return $this;
  892.     }
  893. }