src/Entity/WorkerActivities.php line 23

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\WorkerActivitiesRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\Common\Collections\Selectable;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Doctrine\ORM\PersistentCollection;
  9. use phpDocumentor\Reflection\Types\This;
  10. use Monolog\DateTimeImmutable;
  11. use Symfony\Component\Serializer\Annotation\MaxDepth;
  12. use function PHPUnit\Framework\returnArgument;
  13. use Symfony\Component\Serializer\Annotation\Groups;
  14. // Criteria olustur...
  15. use Doctrine\Common\Collections\Criteria;
  16. /**
  17.  * @ORM\Entity(repositoryClass=WorkerActivitiesRepository::class)
  18.  */
  19. class WorkerActivities
  20. {
  21.     /**
  22.      * @ORM\Id
  23.      * @ORM\GeneratedValue
  24.      * @ORM\Column(type="integer")
  25.      * @Groups({
  26.      *      "worker.activity.core",
  27.      *      "partner.smart.active.employees",
  28.      *      "worker.manage.base",
  29.      *      "worker.actually.activity",
  30.      *      "timesheet.for.stakeholder",
  31.      *      "timesheet.for.partner",
  32.      *      "partner.selected.project",
  33.      *
  34.      *      "timesheet.collected.base",
  35.      *
  36.      *      "worker.in.project.worker.activity.base",
  37.      *
  38.      *
  39.      *      "worker.activity.substitution.worker.activity.core",
  40.      *
  41.      *     "worker_activity@core",
  42.      *     "worker_activity@base"
  43.      *
  44.      * })
  45.      */
  46.     private $id;
  47.     /**
  48.      * @ORM\ManyToOne(targetEntity=Worker::class, inversedBy="worker_activities" )
  49.      * // INFO Since cascade={"remove"} ignores the foreign key references by explicitly deleting the record.
  50.      * @ORM\JoinColumn(nullable=true, onDelete="CASCADE")
  51.      * @Groups({
  52.      *     "partner.smart.active.employees",
  53.      *     "worker.manage.base",
  54.      *     "timesheet.for.stakeholder",
  55.      *     "timesheet.for.partner",
  56.      *     "partner.selected.project",
  57.      *
  58.      *     "timesheet.collected.base",
  59.      *
  60.      *     "worker.in.project.worker.activity.worker",
  61.      *
  62.      *     "worker.activity.substitution.worker.activity.worker",
  63.      *
  64.      *     "worker.activity.worker",
  65.      *
  66.      *     "worker_activity@worker",
  67.      *
  68.      *     })
  69.      * @ORM\OrderBy({"name" = "ASC"})
  70.      */
  71.     private $worker;
  72.     /**
  73.      * @ORM\Column(type="datetime_immutable", nullable=true)
  74.      * @Groups({
  75.      *     "partner.smart.active.employees",
  76.      *     "worker.manage.base",
  77.      *     "worker.actually.activity",
  78.      *
  79.      *     "worker.activity.core",
  80.      *
  81.      *     "worker_activity@core"
  82.      * })
  83.      */
  84.     private $entry_at;
  85.     /**
  86.      * @ORM\Column(type="datetime_immutable", nullable=true)
  87.      * @Groups({
  88.      *     "partner.smart.active.employees",
  89.      *     "worker.manage.base",
  90.      *     "worker.actually.activity",
  91.      *
  92.      *     "worker.activity.core",
  93.      *
  94.      *      "worker_activity@core",
  95.      * })
  96.      */
  97.     private $exit_at;
  98.     /**
  99.      * @ORM\Column(type="datetime_immutable", nullable=true)
  100.      * @Groups({
  101.      *     "worker_activity@core"
  102.      * })
  103.      */
  104.     private $created_at;
  105.     /**
  106.      * @ORM\ManyToOne(targetEntity=Partner::class, inversedBy="worker_activities")
  107.      * @ORM\JoinColumn(nullable=false, onDelete="CASCADE")
  108.      * @Groups({
  109.      *     "worker.actually.activity",
  110.      *     "timesheet.for.stakeholder",
  111.      *     "partner.selected.project",
  112.      *
  113.      *     "worker.in.project.worker.activity.partner",
  114.      *
  115.      *     "worker.activity.partner",
  116.      *
  117.      *     "worker_activity@partner"
  118.      *
  119.      *
  120.      *     })
  121.      */
  122.     private $partner;
  123.     /**
  124.      * @Groups({
  125.      *     "partner.smart.active.employees",
  126.      *     "worker.manage.base"
  127.      * })
  128.     */
  129.     private $editable;
  130.     /**
  131.      * @Groups({
  132.      *     "partner.smart.active.employees",
  133.      *     "worker.manage.base",
  134.      *
  135.      * })
  136.     */
  137.     private $status;
  138.     /**
  139.      * @deprecated use timesheets instead
  140.      * @ORM\OneToMany(targetEntity=WorkerTimesheet::class, mappedBy="worker_activity", cascade={"persist", "remove"})
  141.      *
  142.      * @Groups({
  143.      *     "worker.manage.base.timesheet",
  144.      *     "timesheet.for.stakeholder",
  145.      *     "timesheet.for.partner",
  146.      *
  147.      *     "project.joined.stakeholder.worker.in.project.worker.activity.timesheet",
  148.      *
  149.      *
  150.      * })
  151.      */
  152.     private $worker_timesheets;
  153.     /**
  154.      * @MaxDepth(1)
  155.      * @ORM\OneToMany(targetEntity=WorkerInProject::class, mappedBy="worker_activity", orphanRemoval=true, fetch="EXTRA_LAZY")
  156.      * @ORM\OrderBy({"id":"DESC"})
  157.      * @Groups({
  158.      *     "worker.manage.base",
  159.      *     "worker.manage.joined.projects",
  160.      *     "worker_activity@worker_in_project",
  161.      * })
  162.      *
  163.      */
  164.     private $worker_in_projects;
  165.     /**
  166.      * @ORM\Column(type="boolean", nullable=true)
  167.      * @Groups({
  168.      *     "worker.manage.base",
  169.      *     "partner.smart.active.employees",
  170.      *     "timesheet.for.stakeholder",
  171.      *
  172.      *     "worker_activity@core"
  173.      * })
  174.      */
  175.     private $guest;
  176.     /**
  177.      * @ORM\OneToMany(targetEntity=WorkerTimesheetPayments::class, mappedBy="worker_activity", orphanRemoval=true, cascade={"persist", "remove"} )
  178.      * @Groups({
  179.      *     "worker.manage.base.timesheet.payments",
  180.      *
  181.      *     "worker_activity@worker_timesheet_payments"
  182.      * })
  183.      */
  184.     private $worker_timesheet_payments;
  185.     /**
  186.      * TODO this should be in WorkerActivities
  187.      * @ORM\OneToMany(targetEntity=ProjectOrders::class, mappedBy="order_primary_lead")
  188.      */
  189.     private $projectOrders;
  190.     /**
  191.      *
  192.      *      Bu yapı, WorkerActivities (İşçi Aktiviteleri) tablosunda bir aktivitenin başka bir aktiviteyle ilişkili
  193.      *      olduğunu belirtmek için kullanılır.
  194.      *      Bu, özellikle bir işçinin yokluğunda onun yerine geçen başka bir işçinin aktivitesini takip etmek için
  195.      *      faydalıdır.
  196.      *
  197.      * 🧱   Teknik Açıklama
  198.      *      ManyToMany İlişki: Bir aktivite birden fazla aktiviteyle ilişkili olabilir ve tersi de geçerlidir.
  199.      *      Self-Referencing: İlişki aynı tablo (WorkerActivities) içinde tanımlanmıştır.
  200.      *      JoinTable: İlişkiyi temsil eden ara tablo manuel olarak adlandırılmıştır: worker_activity_substitutions.
  201.      *      joinColumns: İlişkinin sahibi olan aktiviteyi belirtir.
  202.      *      inverseJoinColumns: İlişkinin hedefi olan aktiviteyi belirtir.
  203.      *
  204.      *      This property defines the activities that this activity *replaces* or *substitutes*.
  205.      *
  206.      *      In other words, if a worker cannot perform their original activity (e.g., due to absence),
  207.      *      this activity can take over those responsibilities. This allows tracking which activities
  208.      *      serve as substitutes for others.
  209.      *
  210.      *      The relationship is many-to-many and self-referencing within the WorkerActivities entity.
  211.      *
  212.      *      For example:
  213.      *      - Activity A substitutes Activity B and C.
  214.      *      - Activity B is substituted by Activity A.
  215.      *
  216.      *      This is the owning side of the relation.
  217.      * @MaxDepth(1)
  218.      * @ORM\ManyToMany(targetEntity=WorkerActivities::class, inversedBy="worker_substituted_activities")
  219.      * @ORM\JoinTable(
  220.      *      name="worker_activity_substitutions",
  221.      *      joinColumns={@ORM\JoinColumn(name="main_activity_id", referencedColumnName="id")},
  222.      *      inverseJoinColumns={@ORM\JoinColumn(name="substituted_activity_id", referencedColumnName="id")}
  223.      *  )
  224.      * @Groups({
  225.      *     "worker.activity.substitutions",
  226.      *
  227.      *     "worker_activity@worker_activity_substitutions"
  228.      * })
  229.     */
  230.     private $worker_activity_substitutions;
  231.     /**
  232.      * @MaxDepth(1)
  233.      * @ORM\ManyToMany(targetEntity=WorkerActivities::class, mappedBy="worker_activity_substitutions")
  234.      * @Groups({
  235.      *     "worker.activity.coverages",
  236.      *
  237.      *     "worker_activity@worker_substituted_activities"
  238.      * })
  239.      */
  240.     private $worker_substituted_activities;
  241.     /**
  242.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="worker_activities")
  243.      * @Groups({
  244.      *     "worker.activity.user",
  245.      *
  246.      *     "worker_activity@user"
  247.      * })
  248.      * @ORM\JoinColumn(onDelete="SET NULL")
  249.      */
  250.     private $user;
  251.     /**
  252.      * @ORM\Column(type="boolean", nullable=true, options={"comment": "Indicates whether the worker is accountable for the profitability performance of the Aufträge they participated in. If true, the worker's success/failure will be evaluated based on whether the project met its profit margin targets. ( Bu işçinin görev aldığı Aufträg'ların kâr hedefine ulaşıp ulaşmamasıyla ilişkilendirilmesini sağlayan bilgi alanı.)"} )
  253.      * @Groups({
  254.      *     "worker.manage.base",
  255.      *     "worker.activity.core", "worker_activity@core",
  256.      *     "partner.smart.active.employees",
  257.      *
  258.      *     "worker_activity@core"
  259.      * })
  260.      */
  261.     private $is_kpi_responsible;
  262.     /**
  263.      * @ORM\ManyToMany(targetEntity=ProjectOrders::class, mappedBy="assigned_workers")
  264.      */
  265.     private $assigned_orders;
  266.     /**
  267.      * TODO Temporarily Durduruldu Baglanti Entityler Entity_Archived icinde!
  268.      * ORM\OneToMany(targetEntity=Timesheets::class, mappedBy="worker_activity", orphanRemoval=true)
  269.      * @Groups({
  270.      *     "worker_activity@timesheets",
  271.      * })
  272.      */
  273.     private $timesheets;
  274.     /**
  275.      * @ORM\Column(type="string", length=255, nullable=true)
  276.      * @Groups({
  277.      *      "worker.activity.core",
  278.      *
  279.      *      "worker_activity@core"
  280.      *  })
  281.      *
  282.      */
  283.     private $termination_reason;
  284.     /**
  285.      * Setter over Subscriber
  286.      * @Groups({
  287.      *      "worker_activity@core"
  288.      *  })
  289.      */
  290.     private $activity_status;
  291.     /**
  292.      * @ORM\Column(type="float", nullable=true)
  293.      * @Groups({
  294.      *       "worker_activity@core"
  295.      * })
  296.      */
  297.     private $hourly_rate;
  298.     /**
  299.      * @ORM\Column(type="float", nullable=true)
  300.      * @Groups({
  301.      *        "worker_activity@core"
  302.      * })
  303.      */
  304.     private $daily_working_hours;
  305.     /**
  306.      * @ORM\OneToMany(targetEntity=StockIssue::class, mappedBy="issue_to_employee_activity")
  307.      */
  308.     private $stockIssues;
  309.     /**
  310.      * @ORM\OneToMany(targetEntity=ProjectOrderTasks::class, mappedBy="responsible_person")
  311.      */
  312.     private $project_order_tasks;
  313.     /**
  314.      * @ORM\OneToMany(targetEntity=ProjectOrderTaskFulfillment::class, mappedBy="branch_contact_person")
  315.      */
  316.     private $project_order_task_fulfillments;
  317.     /**
  318.      * Controle over Subscriber
  319.      * @return mixed
  320.      */
  321.     public function getActivityStatus()
  322.     {
  323.         return $this->activity_status;
  324.     }
  325.     /**
  326.      * Controle over Subscriber
  327.      * @param mixed $activity_status
  328.      */
  329.     public function setActivityStatus($activity_status): self
  330.     {
  331.         $this->activity_status $activity_status;
  332.         return $this;
  333.     }
  334.     public function __construct()
  335.     {
  336.         $this->worker_timesheets = new ArrayCollection();
  337.         $this->worker_in_projects = new ArrayCollection();
  338.         $this->worker_timesheet_payments = new ArrayCollection();
  339.         $this->projectOrders = new ArrayCollection();
  340.         $this->worker_activity_substitutions = new ArrayCollection();
  341.         $this->worker_substituted_activities = new ArrayCollection();
  342.         $this->assigned_orders = new ArrayCollection();
  343.         $this->timesheets = new ArrayCollection();
  344.         $this->stockIssues = new ArrayCollection();
  345.         $this->project_order_tasks = new ArrayCollection();
  346.         $this->project_order_task_fulfillments = new ArrayCollection();;
  347.     }
  348.     /**
  349.      * @Groups("partner.workers.smart.list")
  350.     */
  351.     public function getEditable(): bool {
  352.         return !($this->getExitAt() && $this->getExitAt() < new \DateTimeImmutable('now'));;
  353.     }
  354.     public function getStatus(): ?array {
  355.         if( !$this->getEntryAt() && !$this->getExitAt() ){
  356.             return [
  357.                 'status' => 'unknown',
  358.                 'color' => 'yellow',
  359.                 'message' => 'Unknown status'
  360.             ];
  361.         } else if( $this->getEntryAt() && !$this->getExitAt() ){
  362.             return [
  363.                 'status' => 'active',
  364.                 'color' => 'green',
  365.                 'message' => "Active since " . (new DateTimeImmutable('now'))->diff$this->getEntryAt())->days ' day(s)'
  366.             ];
  367.         }
  368.         else {
  369.             $today = new \DateTimeImmutable('now');
  370.             $exitAt $this->getExitAt();
  371.             if( $exitAt && $today $exitAt ){
  372.                 $restDay $exitAt->diff$today )->days;
  373.                 if( !$restDay ){
  374.                     return [
  375.                         'status' => 'inactive',
  376.                         'color' => 'red',
  377.                         'message' => "Inactive in " $exitAt->diff$today )->" Hour(s)"
  378.                     ];
  379.                 }
  380.                 return [
  381.                     'status' => 'inactive',
  382.                     'color' => 'red',
  383.                     'message' => "Inactive in " $restDay " Day(s)"
  384.                 ];
  385.             }
  386.         }
  387.         return [
  388.             'status' => 'inactive',
  389.             'color' => 'red',
  390.             'message' => "Inactive since " . (new DateTimeImmutable('now'))->diff$this->getExitAt())->days ' day(s)'
  391.         ];
  392.     }
  393.     public function getCompanyName(): ?string{
  394.         return $this->getPartner()->getCompany();
  395.     }
  396.     public function getId(): ?int
  397.     {
  398.         return $this->id;
  399.     }
  400.     public function getWorker(): ?Worker
  401.     {
  402.         return $this->worker;
  403.     }
  404.     public function setWorker(?Worker $worker): self
  405.     {
  406.         $this->worker $worker;
  407.         return $this;
  408.     }
  409.     public function getEntryAt(): ?\DateTimeImmutable
  410.     {
  411.         return $this->entry_at;
  412.     }
  413.     public function setEntryAt(?\DateTimeImmutable $entry_at): self
  414.     {
  415.         $this->entry_at $entry_at;
  416.         return $this;
  417.     }
  418.     public function getExitAt(): ?\DateTimeImmutable
  419.     {
  420.         return $this->exit_at;
  421.     }
  422.     public function setExitAt(?\DateTimeImmutable $exit_at): self
  423.     {
  424.         $this->exit_at $exit_at;
  425.         return $this;
  426.     }
  427.     public function getCreatedAt(): ?\DateTimeImmutable
  428.     {
  429.         return $this->created_at;
  430.     }
  431.     public function setCreatedAt(?\DateTimeImmutable $created_at): self
  432.     {
  433.         $this->created_at $created_at;
  434.         return $this;
  435.     }
  436.     public function getPartner(): ?Partner
  437.     {
  438.         return $this->partner;
  439.     }
  440.     public function setPartner(?Partner $partner): self
  441.     {
  442.         $this->partner $partner;
  443.         return $this;
  444.     }
  445.     /**
  446.      * @return Collection<int, WorkerTimesheet>&Selectable
  447.      */
  448.     public function getWorkerTimesheets(): Collection
  449.     {
  450.         return $this->worker_timesheets;
  451.     }
  452.     public function addWorkerTimesheet(WorkerTimesheet $workerTimesheet): self
  453.     {
  454.         if (!$this->worker_timesheets->contains($workerTimesheet)) {
  455.             $this->worker_timesheets[] = $workerTimesheet;
  456.             $workerTimesheet->setWorkerActivity($this);
  457.         }
  458.         return $this;
  459.     }
  460.     public function removeWorkerTimesheet(WorkerTimesheet $workerTimesheet): self
  461.     {
  462.         if ($this->worker_timesheets->removeElement($workerTimesheet)) {
  463.             // set the owning side to null (unless already changed)
  464.             if ($workerTimesheet->getWorkerActivity() === $this) {
  465.                 $workerTimesheet->setWorkerActivity(null);
  466.             }
  467.         }
  468.         return $this;
  469.     }
  470.     /**
  471.      * @return Collection<int, WorkerInProject>&Selectable
  472.      */
  473.     public function getWorkerInProjects(): ?Collection
  474.     {
  475.         return $this->worker_in_projects;
  476.     }
  477.     public function addWorkerInProject(WorkerInProject $workerInProject): self
  478.     {
  479.         // dd($workerInProject);
  480.         if (!$this->worker_in_projects->contains($workerInProject)) {
  481.             $this->worker_in_projects[] = $workerInProject;
  482.             // $workerInProject->setWorker($this);
  483.             // $workerInProject->setStakeholderProject($this);
  484.             // $workerInProject->setProject($this);
  485.             $workerInProject->setWorkerActivity($this);
  486.         }
  487.         return $this;
  488.     }
  489.     public function removeWorkerInProject(WorkerInProject $workerInProject): self
  490.     {
  491.         if ($this->worker_in_projects->removeElement($workerInProject)) {
  492.             // set the owning side to null (unless already changed)
  493. //             if ($workerInProject->getWorker() === $this) {
  494. //                 $workerInProject->setWorker(null);
  495. //             }
  496.             if ($workerInProject->getWorkerActivity() === $this) {
  497.                 $workerInProject->setWorkerActivity(null);
  498.             }
  499.         }
  500.         return $this;
  501.     }
  502.     public function isGuest(): ?bool
  503.     {
  504.         return $this->guest;
  505.     }
  506.     public function setGuest(?bool $guest): self
  507.     {
  508.         $this->guest $guest;
  509.         return $this;
  510.     }
  511.     /**
  512.      * @return Collection<int, WorkerTimesheetPayments>
  513.      */
  514.     public function getWorkerTimesheetpayments(): Collection
  515.     {
  516.         return $this->worker_timesheet_payments;
  517.     }
  518.     public function addWorkerTimesheetPayment(WorkerTimesheetPayments $workerTimesheetPayment): self
  519.     {
  520.         if (!$this->worker_timesheet_payments->contains($workerTimesheetPayment)) {
  521.             $this->worker_timesheet_payments[] = $workerTimesheetPayment;
  522.             $workerTimesheetPayment->setWorkerActivity($this);
  523.         }
  524.         return $this;
  525.     }
  526.     public function removeWorkerTimesheetPayment(WorkerTimesheetPayments $workerTimesheetPayment): self
  527.     {
  528.         if ($this->worker_timesheet_payments->removeElement($workerTimesheetPayment)) {
  529.             // set the owning side to null (unless already changed)
  530.             if ($workerTimesheetPayment->getWorkerActivity() === $this) {
  531.                 $workerTimesheetPayment->setWorkerActivity(null);
  532.             }
  533.         }
  534.         return $this;
  535.     }
  536.     /**
  537.      * @return Collection<int, ProjectOrders>
  538.      */
  539.     public function getProjectOrders(): Collection
  540.     {
  541.         return $this->projectOrders;
  542.     }
  543.     public function addProjectOrder(ProjectOrders $projectOrder): self
  544.     {
  545.         if (!$this->projectOrders->contains($projectOrder)) {
  546.             $this->projectOrders[] = $projectOrder;
  547.             $projectOrder->setOrderLead($this);
  548.         }
  549.         return $this;
  550.     }
  551.     public function removeProjectOrder(ProjectOrders $projectOrder): self
  552.     {
  553.         if ($this->projectOrders->removeElement($projectOrder)) {
  554.             // set the owning side to null (unless already changed)
  555.             if ($projectOrder->getOrderLead() === $this) {
  556.                 $projectOrder->setOrderLead(null);
  557.             }
  558.         }
  559.         return $this;
  560.     }
  561.     /**
  562.      * @return Collection<int, self>
  563.      */
  564.     public function getWorkerActivitySubstitutions(): Collection
  565.     {
  566.         return $this->worker_activity_substitutions;
  567.     }
  568.     public function addWorkerSubstitutedActivity(self $workerSubstitutedActivity): self
  569.     {
  570.         if (!$this->worker_activity_substitutions->contains($workerSubstitutedActivity)) {
  571.             $this->worker_activity_substitutions[] = $workerSubstitutedActivity;
  572.         }
  573.         return $this;
  574.     }
  575.     public function removeWorkerSubstitutedActivity(self $workerSubstitutedActivity): self
  576.     {
  577.         $this->worker_activity_substitutions->removeElement($workerSubstitutedActivity);
  578.         return $this;
  579.     }
  580.     /**
  581.      * @return Collection<int, self>
  582.      */
  583.     public function getWorkerSubstitutedActivities(): Collection
  584.     {
  585.         return $this->worker_substituted_activities;
  586.     }
  587.     public function getUser(): ?User
  588.     {
  589.         return $this->user;
  590.     }
  591.     public function setUser(?User $user): self
  592.     {
  593.         $this->user $user;
  594.         return $this;
  595.     }
  596.     public function isIsKpiResponsible(): ?bool
  597.     {
  598.         return $this->is_kpi_responsible;
  599.     }
  600.     public function setIsKpiResponsible(?bool $is_kpi_responsible): self
  601.     {
  602.         $this->is_kpi_responsible $is_kpi_responsible;
  603.         return $this;
  604.     }
  605.     /**
  606.      * @return Collection<int, ProjectOrders>&Selectable
  607.      */
  608.     public function getAssignedOrders(): Collection
  609.     {
  610.         return $this->assigned_orders;
  611.     }
  612.     public function addAssignedOrder(ProjectOrders $assignedOrder): self
  613.     {
  614.         if (!$this->assigned_orders->contains($assignedOrder)) {
  615.             $this->assigned_orders[] = $assignedOrder;
  616.             $assignedOrder->addAssignedWorker($this);
  617.         }
  618.         return $this;
  619.     }
  620.     public function removeAssignedOrder(ProjectOrders $assignedOrder): self
  621.     {
  622.         if ($this->assigned_orders->removeElement($assignedOrder)) {
  623.             $assignedOrder->removeAssignedWorker($this);
  624.         }
  625.         return $this;
  626.     }
  627.     /**
  628.      * @return Collection<int, Timesheets>&Selectable
  629.      */
  630.     public function getTimesheets(): ?Collection
  631.     {
  632.         return $this->timesheets;
  633.     }
  634.     public function addTimesheet(Timesheets $timesheet): self
  635.     {
  636.         if (!$this->timesheets->contains($timesheet)) {
  637.             $this->timesheets[] = $timesheet;
  638.             $timesheet->setWorkerActivity($this);
  639.         }
  640.         return $this;
  641.     }
  642.     public function removeTimesheet(Timesheets $timesheet): self
  643.     {
  644.         if ($this->timesheets->removeElement($timesheet)) {
  645.             // set the owning side to null (unless already changed)
  646.             if ($timesheet->getWorkerActivity() === $this) {
  647.                 $timesheet->setWorkerActivity(null);
  648.             }
  649.         }
  650.         return $this;
  651.     }
  652.     public function getTerminationReason(): ?string
  653.     {
  654.         return $this->termination_reason;
  655.     }
  656.     public function setTerminationReason(?string $termination_reason): self
  657.     {
  658.         $this->termination_reason $termination_reason;
  659.         return $this;
  660.     }
  661.     public function getHourlyRate(): ?float
  662.     {
  663.         return $this->hourly_rate;
  664.     }
  665.     public function setHourlyRate(?float $hourly_rate): self
  666.     {
  667.         $this->hourly_rate $hourly_rate;
  668.         return $this;
  669.     }
  670.     /**
  671.      * @return Collection<int, StockIssue>
  672.      */
  673.     public function getStockIssues(): Collection
  674.     {
  675.         return $this->stockIssues;
  676.     }
  677.     public function addStockIssue(StockIssue $stockIssue): self
  678.     {
  679.         if (!$this->stockIssues->contains($stockIssue)) {
  680.             $this->stockIssues[] = $stockIssue;
  681.             $stockIssue->setIssueToEmployeeActivity($this);
  682.         }
  683.         return $this;
  684.     }
  685.     public function removeStockIssue(StockIssue $stockIssue): self
  686.     {
  687.         if ($this->stockIssues->removeElement($stockIssue)) {
  688.             // set the owning side to null (unless already changed)
  689.             if ($stockIssue->getIssueToEmployeeActivity() === $this) {
  690.                 $stockIssue->setIssueToEmployeeActivity(null);
  691.             }
  692.         }
  693.         return $this;
  694.     }
  695.     public function getDailyWorkingHours(): ?float
  696.     {
  697.         return $this->daily_working_hours;
  698.     }
  699.     public function setDailyWorkingHours(?float $daily_working_hours): self
  700.     {
  701.         $this->daily_working_hours $daily_working_hours;
  702.         return $this;
  703.     }
  704.     /**
  705.      * @return Collection<int, ProjectOrderTasks>
  706.      */
  707.     public function getProjectOrderTasks(): Collection
  708.     {
  709.         return $this->project_order_tasks;
  710.     }
  711.     public function addProjectOrderTask(ProjectOrderTasks $projectOrderTask): self
  712.     {
  713.         if (!$this->project_order_tasks->contains($projectOrderTask)) {
  714.             $this->project_order_tasks[] = $projectOrderTask;
  715.             $projectOrderTask->setResponsiblePerson($this);
  716.         }
  717.         return $this;
  718.     }
  719.     public function removeProjectOrderTask(ProjectOrderTasks $projectOrderTask): self
  720.     {
  721.         if ($this->project_order_tasks->removeElement($projectOrderTask)) {
  722.             // set the owning side to null (unless already changed)
  723.             if ($projectOrderTask->getResponsiblePerson() === $this) {
  724.                 $projectOrderTask->setResponsiblePerson(null);
  725.             }
  726.         }
  727.         return $this;
  728.     }
  729.     /**
  730.      * @return Collection<int, ProjectOrderTaskFulfillment>
  731.      */
  732.     public function getProjectOrderTaskFulfillments(): Collection
  733.     {
  734.         return $this->project_order_task_fulfillments;
  735.     }
  736.     public function addProjectOrderTaskFulfillment(ProjectOrderTaskFulfillment $projectOrderTaskFulfillment): self
  737.     {
  738.         if (!$this->project_order_task_fulfillments->contains($projectOrderTaskFulfillment)) {
  739.             $this->project_order_task_fulfillments[] = $projectOrderTaskFulfillment;
  740.             $projectOrderTaskFulfillment->setBranchContactPerson($this);
  741.         }
  742.         return $this;
  743.     }
  744.     public function removeProjectOrderTaskFulfillment(ProjectOrderTaskFulfillment $projectOrderTaskFulfillment): self
  745.     {
  746.         if ($this->project_order_task_fulfillments->removeElement($projectOrderTaskFulfillment)) {
  747.             // set the owning side to null (unless already changed)
  748.             if ($projectOrderTaskFulfillment->getBranchContactPerson() === $this) {
  749.                 $projectOrderTaskFulfillment->setBranchContactPerson(null);
  750.             }
  751.         }
  752.         return $this;
  753.     }
  754. }