src/Entity/User.php line 65

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