src/Entity/User.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\UserRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\Common\Collections\Criteria;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
  9. use Symfony\Component\Security\Core\User\UserInterface;
  10. use Symfony\Component\Serializer\Annotation\Groups;
  11. /**
  12.  * @ORM\Entity(repositoryClass=UserRepository::class)
  13.  */
  14. class User implements UserInterfacePasswordAuthenticatedUserInterface
  15. {
  16.     /**
  17.      * @ORM\Id
  18.      * @ORM\GeneratedValue
  19.      * @ORM\Column(type="integer")
  20.      * @Groups({
  21.      *     "user.core",
  22.      *     "user:core",
  23.      *     "user@core"
  24.      * })
  25.      */
  26.     private $id;
  27.     /**
  28.      * @ORM\Column(type="string", length=180, unique=true)
  29.      * @Groups({
  30.      *      "user.core",
  31.      *      "user:core",
  32.      *      "user@core"
  33.      *  })
  34.      */
  35.     private $email;
  36.     /**
  37.      * @ORM\Column(type="json")
  38.      * @Groups({
  39.      *      "user.core",
  40.      *      "user:core",
  41.      *      "user@core"
  42.      *  })
  43.      */
  44.     private $roles = [];
  45.     /**
  46.      * @var string The hashed password
  47.      * @ORM\Column(type="string")
  48.      */
  49.     private $password;
  50.     /**
  51.      * @var string The hashed password
  52.      * @ORM\Column(type="string", length=64, nullable=true )
  53.      * Groups({"user.core", "user:core", "user@core", "worker.manage.base.timesheet.payments"})
  54.      * @Groups({
  55.      *      "user.core",
  56.      *      "user:core",
  57.      *      "user@core",
  58.      *      "worker.manage.base.timesheet.payments"
  59.      *  })
  60.      */
  61.     private $name;
  62.     /**
  63.      * @var string The hashed password
  64.      * @ORM\Column(type="string", length=64, nullable=true )
  65.      * Groups({"user.core", "user:core", "user@core", "worker.manage.base.timesheet.payments"})
  66.      * @Groups({
  67.      *       "user.core",
  68.      *       "user:core",
  69.      *       "user@core",
  70.      *       "worker.manage.base.timesheet.payments"
  71.      *   })
  72.      */
  73.     private $surname;
  74.     /**
  75.      * Private Prop no column based
  76.      * @var string The hashed password
  77.      * @Groups({
  78.      *       "user.core",
  79.      *       "user:core",
  80.      *       "user@core"
  81.      *   })
  82.      */
  83.     private $full_name;
  84.     public function getFullName(): string
  85.     {
  86.         return "{$this->getName()} {$this->getSurname()}";
  87.     }
  88.     /**
  89.      * @ORM\OneToMany(targetEntity=ProjectAddendumCosts::class, mappedBy="added_by")
  90.      */
  91.     private $projectAddendumCosts;
  92.     
  93.     /**
  94.      * @deprecated use user_rights
  95.      * @ORM\ManyToMany(targetEntity=AccessRoles::class, inversedBy="users")
  96.      * @Groups({"user.manage", "user.accessed.roles"})
  97.      */
  98.     private $user_accessed_roles;
  99.     /**
  100.      * @ORM\OneToMany(targetEntity=WorkerTimesheetPayments::class, mappedBy="payer")
  101.      */
  102.     private $workerTimesheetPayments;
  103.     /**
  104.      * @ORM\OneToMany(targetEntity=ProjectOrderFeedback::class, mappedBy="user")
  105.      */
  106.     private $projectOrderFeedback;
  107.     /**
  108.      * @ORM\OneToMany(targetEntity=ProjectOrders::class, mappedBy="author")
  109.      */
  110.     private $projectOrders;
  111.     /**
  112.      * @ORM\Column(type="boolean", nullable=true)
  113.      * @Groups({"user.core", "user:core", "user@core"})
  114.      */
  115.     private $login_refused;
  116.     /**
  117.      * @ORM\Column(type="string", length=255, nullable=true)
  118.      * @Groups({"user.core", "user:core", "user@core"})
  119.      */
  120.     private $login_refused_message;
  121.     /**
  122.      * @ORM\Column(type="datetime", nullable=true)
  123.      */
  124.     private $invisible_since;
  125.     /**
  126.      * @ORM\OneToMany(targetEntity=UserRights::class, mappedBy="user", cascade={"persist", "remove"}, orphanRemoval=true)
  127.      * @Groups({"user.rights"})
  128.      */
  129.     private $user_rights;
  130.     /**
  131.      * @ORM\OneToMany(targetEntity=Inventory::class, mappedBy="involved_by")
  132.      */
  133.     private $inventories;
  134.     /**
  135.      * @ORM\OneToMany(targetEntity=SupplierOrders::class, mappedBy="order_by")
  136.      */
  137.     private $supplierOrders;
  138.     /**
  139.      * @ORM\OneToMany(targetEntity=UserScopedItem::class, mappedBy="user", cascade={"persist", "remove"}, orphanRemoval=true )
  140.      * @Groups({"user.scoped.items"})
  141.      */
  142.     private $user_scoped_items;
  143.     /**
  144.      * @deprecated use workerActivity instead
  145.      * @ORM\OneToOne(targetEntity=Worker::class, mappedBy="user", cascade={"persist", "remove"})
  146.      * @Groups({"user.worker"})
  147.      */
  148.     private $worker;
  149.     /**
  150.      * @ORM\OneToMany(targetEntity=UserCalculationPermission::class, mappedBy="user", cascade={"persist", "remove"}, orphanRemoval=true )
  151.      * @Groups({"user.calculate.permissions"})
  152.      */
  153.     private $user_calculation_permissions;
  154.     /**
  155.      * @ORM\Column(type="datetime_immutable", nullable=true)
  156.      * @Groups({"user.core", "user:core", "user@core"})
  157.      */
  158.     private $is_password_updated_at;
  159.     /**
  160.      * @ORM\ManyToOne(targetEntity=UserPositions::class, inversedBy="users")
  161.      * @Groups({"user.position"})
  162.      */
  163.     private $user_position;
  164.     /**
  165.      * @ORM\Column(type="integer", nullable=true)
  166.      * @Groups({"user.core", "user:core", "user@core"})
  167.      */
  168.     private $idle_timer_timeout;
  169.     /**
  170.      * @ORM\OneToMany(targetEntity=WorkerActivities::class, mappedBy="user")
  171.      * @Groups({
  172.      *          "user.worker.activities",
  173.      *          "user@worker_activities"
  174.      *     })"})
  175.      */
  176.     private $worker_activities;
  177.     /**
  178.      * NO COLUMN BASED
  179.      * @Groups({
  180.      *     "user.as.worker.latest.activity"
  181.      * })
  182.     }
  183.      */
  184.     private $user_as_worker_latest_activity;
  185.     /**
  186.      * @ORM\OneToMany(targetEntity=PurchaseRequest::class, mappedBy="requester")
  187.      */
  188.     private $purchase_requests_requester;
  189.     /**
  190.      * @ORM\OneToMany(targetEntity=PurchaseRequest::class, mappedBy="approver")
  191.      */
  192.     private $purchase_requests_approver;
  193.     /**
  194.      * @ORM\OneToMany(targetEntity=PurchaseRequestPositionHistoryRead::class, mappedBy="user")
  195.      */
  196.     private $purchase_request_position_history_reads;
  197.     /**
  198.      * @ORM\OneToMany(targetEntity=PurchaseRequestHistoryRead::class, mappedBy="user")
  199.      */
  200.     private $purchase_request_history_reads;
  201.     /**
  202.      * @ORM\OneToMany(targetEntity=PurchaseRequestHistories::class, mappedBy="owner")
  203.      */
  204.     private $purchaseRequestHistories;
  205.     /**
  206.      * @ORM\OneToMany(targetEntity=PurchaseRequestUserFavorites::class, mappedBy="user")
  207.      */
  208.     private $purchaseRequestUserFavorites;
  209.     /**
  210.      * @ORM\OneToMany(targetEntity=PurchaseRequestPositions::class, mappedBy="approver")
  211.      */
  212.     private $purchase_request_positions_approver;
  213.     /**
  214.      * @ORM\OneToMany(targetEntity=PurchaseRequestPositions::class, mappedBy="rejecter")
  215.      */
  216.     private $purchase_request_positions_rejecter;
  217.     /**
  218.      * @ORM\OneToMany(targetEntity=PurchaseRequest::class, mappedBy="rejecter")
  219.      */
  220.     private $purchase_request_rejecter;
  221.     /**
  222.      * @ORM\OneToMany(targetEntity=Warehouses::class, mappedBy="creator")
  223.      */
  224.     private $warehouses;
  225.     /**
  226.      * @ORM\OneToMany(targetEntity=StockIssue::class, mappedBy="issued_by")
  227.      */
  228.     private $stock_out_issues;
  229.     /**
  230.      * @ORM\OneToMany(targetEntity=StockIssuePositions::class, mappedBy="deliverer")
  231.      */
  232.     private $delivered_stock_issue_positions;
  233.     /**
  234.      * @return mixed
  235.      */
  236.     public function getUserAsWorkerLatestActivity()
  237.     {
  238.         $criteria Criteria::create();
  239.         // $criteria->where(Criteria::expr()->isNull('exit_at'));
  240.         $criteria->orderBy(['id' => Criteria::ASC]);// ->setMaxResults(1);
  241.         /**@var WorkerActivities $latestActivity*/
  242.         $latestActivity $this->getWorkerActivities()->matching($criteria)->last();
  243.         #dd($latestActivity);
  244.         $this->latest_activity $latestActivity ?? null;
  245.         return $this->latest_activity;
  246.     }
  247.     public function __construct()
  248.     {
  249.         $this->projectAddendumCosts = new ArrayCollection();
  250.         $this->user_accessed_roles = new ArrayCollection();
  251.         $this->workerTimesheetPayments = new ArrayCollection();
  252.         $this->projectOrderFeedback = new ArrayCollection();
  253.         $this->projectOrders = new ArrayCollection();
  254.         $this->user_rights = new ArrayCollection();
  255.         $this->inventories = new ArrayCollection();
  256.         $this->supplierOrders = new ArrayCollection();
  257.         $this->user_scoped_items = new ArrayCollection();
  258.         $this->user_calculation_permissions = new ArrayCollection();
  259.         $this->worker_activities = new ArrayCollection();
  260.         $this->purchase_requests_requester = new ArrayCollection();
  261.         $this->purchase_requests_approver = new ArrayCollection();
  262.         $this->purchase_request_position_history_reads = new ArrayCollection();
  263.         $this->purchase_request_history_reads = new ArrayCollection();
  264.         $this->purchaseRequestHistories = new ArrayCollection();
  265.         $this->purchaseRequestUserFavorites = new ArrayCollection();
  266.         $this->purchase_request_positions_approver = new ArrayCollection();
  267.         $this->purchase_request_positions_rejecter = new ArrayCollection();
  268.         $this->purchase_request_rejecter = new ArrayCollection();
  269.         $this->warehouses = new ArrayCollection();
  270.         $this->stock_out_issues = new ArrayCollection();
  271.         $this->delivered_stock_issue_positions = new ArrayCollection();
  272.     }
  273.     public function getId(): ?int
  274.     {
  275.         return $this->id;
  276.     }
  277.     public function getEmail(): ?string
  278.     {
  279.         return $this->email;
  280.     }
  281.     public function setEmail(string $email): self
  282.     {
  283.         $this->email $email;
  284.         return $this;
  285.     }
  286.     /**
  287.      * A visual identifier that represents this user.
  288.      *
  289.      * @see UserInterface
  290.      */
  291.     public function getUserIdentifier(): string
  292.     {
  293.         return (string) $this->email;
  294.     }
  295.     /**
  296.      * @deprecated since Symfony 5.3, use getUserIdentifier instead
  297.      */
  298.     public function getUsername(): string
  299.     {
  300.         return (string) $this->email;
  301.     }
  302.     /**
  303.      * @see UserInterface
  304.      */
  305.     public function getRoles(): array
  306.     {
  307.         $roles $this->roles;
  308.         // guarantee every user at least has ROLE_USER
  309.         $roles[] = 'ROLE_USER';
  310.         return array_unique($roles);
  311.     }
  312.     public function setRoles(array $roles): self
  313.     {
  314.         $this->roles $roles;
  315.         return $this;
  316.     }
  317.     /**
  318.      * @see PasswordAuthenticatedUserInterface
  319.      */
  320.     public function getPassword(): string
  321.     {
  322.         return $this->password;
  323.     }
  324.     public function setPassword(string $password): self
  325.     {
  326.         $this->password $password;
  327.         return $this;
  328.     }
  329.     public function getName(): ?string
  330.     {
  331.         return $this->name;
  332.     }
  333.     public function setNamestring $name): self
  334.     {
  335.         $this->name $name;
  336.         return $this;
  337.     }
  338.     public function getSurname(): ?string
  339.     {
  340.         return $this->surname;
  341.     }
  342.     public function setSurname(string $surname): self
  343.     {
  344.         $this->surname $surname;
  345.         return $this;
  346.     }
  347.     /**
  348.      * Returning a salt is only needed, if you are not using a modern
  349.      * hashing algorithm (e.g. bcrypt or sodium) in your security.yaml.
  350.      *
  351.      * @see UserInterface
  352.      */
  353.     public function getSalt(): ?string
  354.     {
  355.         return null;
  356.     }
  357.     /**
  358.      * @see UserInterface
  359.      */
  360.     public function eraseCredentials()
  361.     {
  362.         // If you store any temporary, sensitive data on the user, clear it here
  363.         // $this->plainPassword = null;
  364.     }
  365.     /**
  366.      * @return Collection<int, ProjectAddendumCosts>
  367.      */
  368.     public function getProjectAddendumCosts(): Collection
  369.     {
  370.         return $this->projectAddendumCosts;
  371.     }
  372.     public function addProjectAddendumCost(ProjectAddendumCosts $projectAddendumCost): self
  373.     {
  374.         if (!$this->projectAddendumCosts->contains($projectAddendumCost)) {
  375.             $this->projectAddendumCosts[] = $projectAddendumCost;
  376.             $projectAddendumCost->setAddedBy($this);
  377.         }
  378.         return $this;
  379.     }
  380.     public function removeProjectAddendumCost(ProjectAddendumCosts $projectAddendumCost): self
  381.     {
  382.         if ($this->projectAddendumCosts->removeElement($projectAddendumCost)) {
  383.             // set the owning side to null (unless already changed)
  384.             if ($projectAddendumCost->getAddedBy() === $this) {
  385.                 $projectAddendumCost->setAddedBy(null);
  386.             }
  387.         }
  388.         return $this;
  389.     }
  390.     /**
  391.      * @return Collection<int, AccessRoles>
  392.      *     @deprecated use user_rights
  393.      */
  394.     public function getUserAccessedRoles(): Collection
  395.     {
  396.         return $this->user_accessed_roles;
  397.     }
  398.     /**
  399.      * @deprecated use user_rights
  400.     */
  401.     public function addUserAccessedRole(AccessRoles $userAccessedRole): self
  402.     {
  403.         if (!$this->user_accessed_roles->contains($userAccessedRole)) {
  404.             $this->user_accessed_roles[] = $userAccessedRole;
  405.         }
  406.         return $this;
  407.     }
  408.     /**
  409.      * @deprecated use user_rights
  410.     */
  411.     public function removeUserAccessedRole(AccessRoles $userAccessedRole): self
  412.     {
  413.         $this->user_accessed_roles->removeElement($userAccessedRole);
  414.         return $this;
  415.     }
  416.     /**
  417.      * @return Collection<int, WorkerTimesheetPayments>
  418.      */
  419.     public function getWorkerTimesheetPayments(): Collection
  420.     {
  421.         return $this->workerTimesheetPayments;
  422.     }
  423.     public function addWorkerTimesheetPayment(WorkerTimesheetPayments $workerTimesheetPayment): self
  424.     {
  425.         if (!$this->workerTimesheetPayments->contains($workerTimesheetPayment)) {
  426.             $this->workerTimesheetPayments[] = $workerTimesheetPayment;
  427.             $workerTimesheetPayment->setPayer($this);
  428.         }
  429.         return $this;
  430.     }
  431.     public function removeWorkerTimesheetPayment(WorkerTimesheetPayments $workerTimesheetPayment): self
  432.     {
  433.         if ($this->workerTimesheetPayments->removeElement($workerTimesheetPayment)) {
  434.             // set the owning side to null (unless already changed)
  435.             if ($workerTimesheetPayment->getPayer() === $this) {
  436.                 $workerTimesheetPayment->setPayer(null);
  437.             }
  438.         }
  439.         return $this;
  440.     }
  441.     /**
  442.      * @return Collection<int, ProjectOrderFeedback>
  443.      */
  444.     public function getProjectOrderFeedback(): Collection
  445.     {
  446.         return $this->projectOrderFeedback;
  447.     }
  448.     public function addProjectOrderFeedback(ProjectOrderFeedback $projectOrderFeedback): self
  449.     {
  450.         if (!$this->projectOrderFeedback->contains($projectOrderFeedback)) {
  451.             $this->projectOrderFeedback[] = $projectOrderFeedback;
  452.             $projectOrderFeedback->setUser($this);
  453.         }
  454.         return $this;
  455.     }
  456.     public function removeProjectOrderFeedback(ProjectOrderFeedback $projectOrderFeedback): self
  457.     {
  458.         if ($this->projectOrderFeedback->removeElement($projectOrderFeedback)) {
  459.             // set the owning side to null (unless already changed)
  460.             if ($projectOrderFeedback->getUser() === $this) {
  461.                 $projectOrderFeedback->setUser(null);
  462.             }
  463.         }
  464.         return $this;
  465.     }
  466.     /**
  467.      * @return Collection<int, ProjectOrders>
  468.      */
  469.     public function getProjectOrders(): Collection
  470.     {
  471.         return $this->projectOrders;
  472.     }
  473.     public function addProjectOrder(ProjectOrders $projectOrder): self
  474.     {
  475.         if (!$this->projectOrders->contains($projectOrder)) {
  476.             $this->projectOrders[] = $projectOrder;
  477.             $projectOrder->setAuthor($this);
  478.         }
  479.         return $this;
  480.     }
  481.     public function removeProjectOrder(ProjectOrders $projectOrder): self
  482.     {
  483.         if ($this->projectOrders->removeElement($projectOrder)) {
  484.             // set the owning side to null (unless already changed)
  485.             if ($projectOrder->getAuthor() === $this) {
  486.                 $projectOrder->setAuthor(null);
  487.             }
  488.         }
  489.         return $this;
  490.     }
  491.     public function isLoginRefused(): ?bool
  492.     {
  493.         return $this->login_refused;
  494.     }
  495.     public function setRefusedLogin(?bool $login_refused): self
  496.     {
  497.         $this->login_refused $login_refused;
  498.         return $this;
  499.     }
  500.     public function getLoginRefusedMessage(): ?string
  501.     {
  502.         return $this->login_refused_message;
  503.     }
  504.     public function setLoginRefusedMessage(?string $login_refused_message): self
  505.     {
  506.         $this->login_refused_message $login_refused_message;
  507.         return $this;
  508.     }
  509.     public function getInvisibleSince(): ?\DateTimeInterface
  510.     {
  511.         return $this->invisible_since;
  512.     }
  513.     public function setInvisibleSince(?\DateTimeInterface $invisible_since): self
  514.     {
  515.         $this->invisible_since $invisible_since;
  516.         return $this;
  517.     }
  518.     /**
  519.      * @return Collection<int, UserRights>
  520.      */
  521.     public function getUserRights(): Collection
  522.     {
  523.         return $this->user_rights;
  524.     }
  525.     public function addUserRight(UserRights $userRight): self
  526.     {
  527.         if (!$this->user_rights->contains($userRight)) {
  528.             $this->user_rights[] = $userRight;
  529.             $userRight->setUser($this);
  530.         }
  531.         return $this;
  532.     }
  533.     public function removeUserRight(UserRights $userRight): self
  534.     {
  535.         if ($this->user_rights->removeElement($userRight)) {
  536.             // set the owning side to null (unless already changed)
  537.             if ($userRight->getUser() === $this) {
  538.                 $userRight->setUser(null);
  539.             }
  540.         }
  541.         return $this;
  542.     }
  543.     /**
  544.      * @return Collection<int, Inventory>
  545.      */
  546.     public function getInventories(): Collection
  547.     {
  548.         return $this->inventories;
  549.     }
  550.     public function addInventory(Inventory $inventory): self
  551.     {
  552.         if (!$this->inventories->contains($inventory)) {
  553.             $this->inventories[] = $inventory;
  554.             $inventory->setInvolvedBy($this);
  555.         }
  556.         return $this;
  557.     }
  558.     public function removeInventory(Inventory $inventory): self
  559.     {
  560.         if ($this->inventories->removeElement($inventory)) {
  561.             // set the owning side to null (unless already changed)
  562.             if ($inventory->getInvolvedBy() === $this) {
  563.                 $inventory->setInvolvedBy(null);
  564.             }
  565.         }
  566.         return $this;
  567.     }
  568.     /**
  569.      * @return Collection<int, SupplierOrders>
  570.      */
  571.     public function getSupplierOrders(): Collection
  572.     {
  573.         return $this->supplierOrders;
  574.     }
  575.     public function addSupplierOrder(SupplierOrders $supplierOrder): self
  576.     {
  577.         if (!$this->supplierOrders->contains($supplierOrder)) {
  578.             $this->supplierOrders[] = $supplierOrder;
  579.             $supplierOrder->setOrderBy($this);
  580.         }
  581.         return $this;
  582.     }
  583.     public function removeSupplierOrder(SupplierOrders $supplierOrder): self
  584.     {
  585.         if ($this->supplierOrders->removeElement($supplierOrder)) {
  586.             // set the owning side to null (unless already changed)
  587.             if ($supplierOrder->getOrderBy() === $this) {
  588.                 $supplierOrder->setOrderBy(null);
  589.             }
  590.         }
  591.         return $this;
  592.     }
  593.     /**
  594.      * @return Collection<int, UserScopedItem>
  595.      */
  596.     public function getUserScopedItems(): Collection
  597.     {
  598.         return $this->user_scoped_items;
  599.     }
  600.     public function addUserScopedItems(UserScopedItem $userScopedItem): self
  601.     {
  602.         if (!$this->user_scoped_items->contains($userScopedItem)) {
  603.             $this->user_scoped_items[] = $userScopedItem;
  604.             $userScopedItem->setUser($this);
  605.         }
  606.         return $this;
  607.     }
  608.     public function removeUserScopedItems(UserScopedItem $userScopedItem): self
  609.     {
  610.         if ($this->user_scoped_items->removeElement($userScopedItem)) {
  611.             // set the owning side to null (unless already changed)
  612.             if ($userScopedItem->getUser() === $this) {
  613.                 $userScopedItem->setUser(null);
  614.             }
  615.         }
  616.         return $this;
  617.     }
  618.     public function getWorker(): ?Worker
  619.     {
  620.         return $this->worker;
  621.     }
  622.     public function setWorker(?Worker $worker): self
  623.     {
  624.         // unset the owning side of the relation if necessary
  625.         if ($worker === null && $this->worker !== null) {
  626.             $this->worker->setUser(null);
  627.         }
  628.         // set the owning side of the relation if necessary
  629.         if ($worker !== null && $worker->getUser() !== $this) {
  630.             $worker->setUser($this);
  631.         }
  632.         $this->worker $worker;
  633.         return $this;
  634.     }
  635.     /**
  636.      * @return Collection<int, UserCalculationPermission>
  637.      */
  638.     public function getUserCalculationPermissions(): Collection
  639.     {
  640.         return $this->user_calculation_permissions;
  641.     }
  642.     public function addUserCalculationPermission(UserCalculationPermission $userCalculationPermission): self
  643.     {
  644.         if (!$this->user_calculation_permissions->contains($userCalculationPermission)) {
  645.             $this->user_calculation_permissions[] = $userCalculationPermission;
  646.             $userCalculationPermission->setUser($this);
  647.         }
  648.         return $this;
  649.     }
  650.     public function removeUserCalculationPermission(UserCalculationPermission $userCalculationPermission): self
  651.     {
  652.         if ($this->user_calculation_permissions->removeElement($userCalculationPermission)) {
  653.             // set the owning side to null (unless already changed)
  654.             if ($userCalculationPermission->getUser() === $this) {
  655.                 $userCalculationPermission->setUser(null);
  656.             }
  657.         }
  658.         return $this;
  659.     }
  660.     public function getIsPasswordUpdatedAt(): ?\DateTimeImmutable
  661.     {
  662.         return $this->is_password_updated_at;
  663.     }
  664.     public function setIsPasswordUpdatedAt(?\DateTimeImmutable $is_password_updated_at): self
  665.     {
  666.         $this->is_password_updated_at $is_password_updated_at;
  667.         return $this;
  668.     }
  669.     public function getUserPosition(): ?UserPositions
  670.     {
  671.         return $this->user_position;
  672.     }
  673.     public function setUserPosition(?UserPositions $user_position): self
  674.     {
  675.         $this->user_position $user_position;
  676.         return $this;
  677.     }
  678.     public function getIdleTimerTimeout(): ?int
  679.     {
  680.         return $this->idle_timer_timeout;
  681.     }
  682.     public function setIdleTimerTimeout(?int $idle_timer_timeout): self
  683.     {
  684.         $this->idle_timer_timeout $idle_timer_timeout;
  685.         return $this;
  686.     }
  687.     /**
  688.      * @return Collection<int, WorkerActivities>
  689.      */
  690.     public function getWorkerActivities(): Collection
  691.     {
  692.         return $this->worker_activities;
  693.     }
  694.     public function addWorkerActivity(WorkerActivities $workerActivity): self
  695.     {
  696.         if (!$this->worker_activities->contains($workerActivity)) {
  697.             $this->worker_activities[] = $workerActivity;
  698.             $workerActivity->setUser($this);
  699.         }
  700.         return $this;
  701.     }
  702.     public function removeWorkerActivity(WorkerActivities $workerActivity): self
  703.     {
  704.         if ($this->worker_activities->removeElement($workerActivity)) {
  705.             // set the owning side to null (unless already changed)
  706.             if ($workerActivity->getUser() === $this) {
  707.                 $workerActivity->setUser(null);
  708.             }
  709.         }
  710.         return $this;
  711.     }
  712.     /**
  713.      * @return Collection<int, PurchaseRequest>
  714.      */
  715.     public function getPurchaseRequestsRequester(): Collection
  716.     {
  717.         return $this->purchase_requests_requester;
  718.     }
  719.     public function addPurchaseRequestForRequester(PurchaseRequest $purchaseRequest): self
  720.     {
  721.         if (!$this->purchase_requests_requester->contains($purchaseRequest)) {
  722.             $this->purchase_requests_requester[] = $purchaseRequest;
  723.             $purchaseRequest->setRequester($this);
  724.         }
  725.         return $this;
  726.     }
  727.     public function removePurchaseRequestFromRequester(PurchaseRequest $purchaseRequest): self
  728.     {
  729.         if ($this->purchase_requests_requester->removeElement($purchaseRequest)) {
  730.             // set the owning side to null (unless already changed)
  731.             if ($purchaseRequest->getRequester() === $this) {
  732.                 $purchaseRequest->setRequester(null);
  733.             }
  734.         }
  735.         return $this;
  736.     }
  737.     /**
  738.      * @return Collection<int, PurchaseRequest>
  739.      */
  740.     public function getPurchaseRequestsApprover(): Collection
  741.     {
  742.         return $this->purchase_requests_approver;
  743.     }
  744.     public function addPurchaseRequestForApprover(PurchaseRequest $purchaseRequest): self
  745.     {
  746.         if (!$this->purchase_requests_approver->contains($purchaseRequest)) {
  747.             $this->purchase_requests_approver[] = $purchaseRequest;
  748.             $purchaseRequest->setApprover($this);
  749.         }
  750.         return $this;
  751.     }
  752.     public function removePurchaseRequestFromApprover(PurchaseRequest $purchaseRequest): self
  753.     {
  754.         if ($this->purchase_requests_approver->removeElement($purchaseRequest)) {
  755.             // set the owning side to null (unless already changed)
  756.             if ($purchaseRequest->getApprover() === $this) {
  757.                 $purchaseRequest->setApprover(null);
  758.             }
  759.         }
  760.         return $this;
  761.     }
  762.     /**
  763.      * @return Collection<int, PurchaseRequestPositionHistoryRead>
  764.      */
  765.     public function getPositionPurchaseRequestPositionHistoryReads(): Collection
  766.     {
  767.         return $this->purchase_request_position_history_reads;
  768.     }
  769.     public function addPurchaseRequestHistoryRead(PurchaseRequestPositionHistoryRead $purchaseRequestPositionHistoryRead): self
  770.     {
  771.         if (!$this->purchase_request_position_history_reads->contains($purchaseRequestPositionHistoryRead)) {
  772.             $this->purchase_request_position_history_reads[] = $purchaseRequestPositionHistoryRead;
  773.             $purchaseRequestPositionHistoryRead->setUser($this);
  774.         }
  775.         return $this;
  776.     }
  777.     public function removePurchaseRequestHistoryRead(PurchaseRequestPositionHistoryRead $purchaseRequestPositionHistoryRead): self
  778.     {
  779.         if ($this->purchase_request_position_history_reads->removeElement($purchaseRequestPositionHistoryRead)) {
  780.             // set the owning side to null (unless already changed)
  781.             if ($purchaseRequestPositionHistoryRead->getUser() === $this) {
  782.                 $purchaseRequestPositionHistoryRead->setUser(null);
  783.             }
  784.         }
  785.         return $this;
  786.     }
  787.     /**
  788.      * @return Collection<int, PurchaseRequestHistoryRead>
  789.      */
  790.     public function getPurchaseRequestHistoryReads(): Collection
  791.     {
  792.         return $this->purchase_request_history_reads;
  793.     }
  794.     /**
  795.      * @return Collection<int, PurchaseRequestHistories>
  796.      */
  797.     public function getPurchaseRequestHistories(): Collection
  798.     {
  799.         return $this->purchaseRequestHistories;
  800.     }
  801.     public function addPurchaseRequestHistory(PurchaseRequestHistories $purchaseRequestHistory): self
  802.     {
  803.         if (!$this->purchaseRequestHistories->contains($purchaseRequestHistory)) {
  804.             $this->purchaseRequestHistories[] = $purchaseRequestHistory;
  805.             $purchaseRequestHistory->setOwner($this);
  806.         }
  807.         return $this;
  808.     }
  809.     public function removePurchaseRequestHistory(PurchaseRequestHistories $purchaseRequestHistory): self
  810.     {
  811.         if ($this->purchaseRequestHistories->removeElement($purchaseRequestHistory)) {
  812.             // set the owning side to null (unless already changed)
  813.             if ($purchaseRequestHistory->getOwner() === $this) {
  814.                 $purchaseRequestHistory->setOwner(null);
  815.             }
  816.         }
  817.         return $this;
  818.     }
  819.     /**
  820.      * @return Collection<int, PurchaseRequestUserFavorites>
  821.      */
  822.     public function getPurchaseRequestUserFavorites(): Collection
  823.     {
  824.         return $this->purchaseRequestUserFavorites;
  825.     }
  826.     public function addPurchaseRequestUserFavorite(PurchaseRequestUserFavorites $purchaseRequestUserFavorite): self
  827.     {
  828.         if (!$this->purchaseRequestUserFavorites->contains($purchaseRequestUserFavorite)) {
  829.             $this->purchaseRequestUserFavorites[] = $purchaseRequestUserFavorite;
  830.             $purchaseRequestUserFavorite->setUser($this);
  831.         }
  832.         return $this;
  833.     }
  834.     public function removePurchaseRequestUserFavorite(PurchaseRequestUserFavorites $purchaseRequestUserFavorite): self
  835.     {
  836.         if ($this->purchaseRequestUserFavorites->removeElement($purchaseRequestUserFavorite)) {
  837.             // set the owning side to null (unless already changed)
  838.             if ($purchaseRequestUserFavorite->getUser() === $this) {
  839.                 $purchaseRequestUserFavorite->setUser(null);
  840.             }
  841.         }
  842.         return $this;
  843.     }
  844.     /**
  845.      * @return Collection<int, PurchaseRequestPositions>
  846.      */
  847.     public function getPurchaseRequestPositionsApprover(): Collection
  848.     {
  849.         return $this->purchase_request_positions_approver;
  850.     }
  851.     public function addPurchaseRequestPositionsApprover(PurchaseRequestPositions $purchaseRequestPositionsApprover): self
  852.     {
  853.         if (!$this->purchase_request_positions_approver->contains($purchaseRequestPositionsApprover)) {
  854.             $this->purchase_request_positions_approver[] = $purchaseRequestPositionsApprover;
  855.             $purchaseRequestPositionsApprover->setApprover($this);
  856.         }
  857.         return $this;
  858.     }
  859.     public function removePurchaseRequestPositionsApprover(PurchaseRequestPositions $purchaseRequestPositionsApprover): self
  860.     {
  861.         if ($this->purchase_request_positions_approver->removeElement($purchaseRequestPositionsApprover)) {
  862.             // set the owning side to null (unless already changed)
  863.             if ($purchaseRequestPositionsApprover->getApprover() === $this) {
  864.                 $purchaseRequestPositionsApprover->setApprover(null);
  865.             }
  866.         }
  867.         return $this;
  868.     }
  869.     /**
  870.      * @return Collection<int, PurchaseRequestPositions>
  871.      */
  872.     public function getPurchaseRequestPositionsRejecter(): Collection
  873.     {
  874.         return $this->purchase_request_positions_rejecter;
  875.     }
  876.     public function addPurchaseRequestPositionsRejecter(PurchaseRequestPositions $purchaseRequestPositionsRejecter): self
  877.     {
  878.         if (!$this->purchase_request_positions_rejecter->contains($purchaseRequestPositionsRejecter)) {
  879.             $this->purchase_request_positions_rejecter[] = $purchaseRequestPositionsRejecter;
  880.             $purchaseRequestPositionsRejecter->setRejecter($this);
  881.         }
  882.         return $this;
  883.     }
  884.     public function removePurchaseRequestPositionsRejecter(PurchaseRequestPositions $purchaseRequestPositionsRejecter): self
  885.     {
  886.         if ($this->purchase_request_positions_rejecter->removeElement($purchaseRequestPositionsRejecter)) {
  887.             // set the owning side to null (unless already changed)
  888.             if ($purchaseRequestPositionsRejecter->getRejecter() === $this) {
  889.                 $purchaseRequestPositionsRejecter->setRejecter(null);
  890.             }
  891.         }
  892.         return $this;
  893.     }
  894.     /**
  895.      * @return Collection<int, PurchaseRequest>
  896.      */
  897.     public function getPurchaseRequestRejecter(): Collection
  898.     {
  899.         return $this->purchase_request_rejecter;
  900.     }
  901.     public function addPurchaseRequestRejecter(PurchaseRequest $purchaseRequestRejecter): self
  902.     {
  903.         if (!$this->purchase_request_rejecter->contains($purchaseRequestRejecter)) {
  904.             $this->purchase_request_rejecter[] = $purchaseRequestRejecter;
  905.             $purchaseRequestRejecter->setRejecter($this);
  906.         }
  907.         return $this;
  908.     }
  909.     public function removePurchaseRequestRejecter(PurchaseRequest $purchaseRequestRejecter): self
  910.     {
  911.         if ($this->purchase_request_rejecter->removeElement($purchaseRequestRejecter)) {
  912.             // set the owning side to null (unless already changed)
  913.             if ($purchaseRequestRejecter->getRejecter() === $this) {
  914.                 $purchaseRequestRejecter->setRejecter(null);
  915.             }
  916.         }
  917.         return $this;
  918.     }
  919.     /**
  920.      * @return Collection<int, Warehouses>
  921.      */
  922.     public function getWarehouses(): Collection
  923.     {
  924.         return $this->warehouses;
  925.     }
  926.     public function addWarehouse(Warehouses $warehouse): self
  927.     {
  928.         if (!$this->warehouses->contains($warehouse)) {
  929.             $this->warehouses[] = $warehouse;
  930.             $warehouse->setCreator($this);
  931.         }
  932.         return $this;
  933.     }
  934.     public function removeWarehouse(Warehouses $warehouse): self
  935.     {
  936.         if ($this->warehouses->removeElement($warehouse)) {
  937.             // set the owning side to null (unless already changed)
  938.             if ($warehouse->getCreator() === $this) {
  939.                 $warehouse->setCreator(null);
  940.             }
  941.         }
  942.         return $this;
  943.     }
  944.     /**
  945.      * @return Collection<int, StockIssue>
  946.      */
  947.     public function getStockOutIssues(): Collection
  948.     {
  949.         return $this->stock_out_issues;
  950.     }
  951.     public function addStockOutIssue(StockIssue $stockOutIssue): self
  952.     {
  953.         if (!$this->stock_out_issues->contains($stockOutIssue)) {
  954.             $this->stock_out_issues[] = $stockOutIssue;
  955.             $stockOutIssue->setIssuedBy($this);
  956.         }
  957.         return $this;
  958.     }
  959.     public function removeStockOutIssue(StockIssue $stockOutIssue): self
  960.     {
  961.         if ($this->stock_out_issues->removeElement($stockOutIssue)) {
  962.             // set the owning side to null (unless already changed)
  963.             if ($stockOutIssue->getIssuedBy() === $this) {
  964.                 $stockOutIssue->setIssuedBy(null);
  965.             }
  966.         }
  967.         return $this;
  968.     }
  969.     /**
  970.      * @return Collection<int, StockIssuePositions>
  971.      */
  972.     public function getDeliveredStockIssuePositions(): Collection
  973.     {
  974.         return $this->delivered_stock_issue_positions;
  975.     }
  976.     public function addDeliveredStockIssuePosition(StockIssuePositions $deliveredStockIssuePosition): self
  977.     {
  978.         if (!$this->delivered_stock_issue_positions->contains($deliveredStockIssuePosition)) {
  979.             $this->delivered_stock_issue_positions[] = $deliveredStockIssuePosition;
  980.             $deliveredStockIssuePosition->setDeliverer($this);
  981.         }
  982.         return $this;
  983.     }
  984.     public function removeDeliveredStockIssuePosition(StockIssuePositions $deliveredStockIssuePosition): self
  985.     {
  986.         if ($this->delivered_stock_issue_positions->removeElement($deliveredStockIssuePosition)) {
  987.             // set the owning side to null (unless already changed)
  988.             if ($deliveredStockIssuePosition->getDeliverer() === $this) {
  989.                 $deliveredStockIssuePosition->setDeliverer(null);
  990.             }
  991.         }
  992.         return $this;
  993.     }
  994. }