src/Entity/User.php line 23

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