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