src/Entity/Worker.php line 45

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TimesheetStatusRepository;
  4. use App\Repository\WorkerRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Event\LifecycleEventArgs;
  8. use Doctrine\ORM\Mapping as ORM;
  9. use phpDocumentor\Reflection\Types\This;
  10. use Monolog\DateTimeImmutable;
  11. use PhpParser\ErrorHandler\Collecting;
  12. use Sensio\Bundle\FrameworkExtraBundle\Configuration\Entity;
  13. use Symfony\Component\Validator\Constraints\DateTime;
  14. use Symfony\Component\Serializer\Annotation\MaxDepth;
  15. use Symfony\Component\Serializer\Annotation\Groups;
  16. use Gedmo\Mapping\Annotation as Gedmo;
  17. use Doctrine\ORM\Mapping\Table;
  18. use Doctrine\ORM\Mapping\UniqueConstraint;
  19. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  20. use Doctrine\Common\Collections\Criteria;
  21. /**
  22.  * @ORM\Entity(repositoryClass=WorkerRepository::class)
  23.  */
  24. /**
  25.  * @ORM\HasLifecycleCallbacks
  26.  * @ORM\Entity(repositoryClass=WorkerRepository::class)
  27.  * @ORM\Table(
  28.  *     name="worker",
  29.  *     uniqueConstraints={
  30.  *          @ORM\UniqueConstraint(columns={"name", "surname", "birthday_at"}),
  31.  *          @ORM\UniqueConstraint(name="unique_personal_id", columns={"personal_id"}, options={"where": "(personal_id IS NOT NULL)"}),
  32.  *     }
  33.  * )
  34.  * @UniqueEntity(
  35.  *      fields={"name", "surname", "birthday_at"},
  36.  *      message="Employee already registered|Employee with combination (%s %s %s) is already registered"
  37.  * )
  38.  */
  39. class Worker
  40. {
  41.     // Same Process processed via Entity Subscriber
  42.     /**
  43.      * @ORM\Id
  44.      * @ORM\GeneratedValue
  45.      * @ORM\Column(type="integer")
  46.      * @Groups({
  47.      *     "worker.manage.base",
  48.      *     "partner.smart.active.employees",
  49.      *     "timesheet.for.stakeholder",
  50.      *     "worker.manage.base.timesheet",
  51.      *     "partner.selected.project",
  52.      * 
  53.      *     "project.details.orders",
  54.      *     "order.detail",
  55.      *     "order.lead",
  56.      *
  57.      *     "timesheet.collected.base",
  58.      *
  59.      *     "worker.base",
  60.      *     "worker.core",
  61.      *
  62.      *     "worker.activity.substitution.worker.activity.worker.core",
  63.      *
  64.      *     "worker@ref",
  65.      *     "worker@core",
  66.      *     "worker@base",
  67.      * })
  68.      */
  69.     private $id;
  70.     /**
  71.      * TODO replace base with core
  72.      * @ORM\Column(type="string", length=255)
  73.      * @Groups({
  74.      *     "worker.manage.base",
  75.      *     "partner.joined.projects.assigned.team.leaders",
  76.      *     "partner.manage.base.team.lead",
  77.      *     "partner.smart.active.employees",
  78.      *     "timesheet.for.stakeholder",
  79.      *     "timesheet.for.partner",
  80.      *     "partner.selected.project",
  81.      * 
  82.      *     "project.details.orders",
  83.      *     "order.detail",
  84.      *     "order.lead",
  85.      *
  86.      *     "timesheet.collected.base",
  87.      *
  88.      *     "worker.base",
  89.      *     "worker.core",
  90.      *
  91.      *     "worker.substitution.core",
  92.      *
  93.      *     "worker@ref",
  94.      *     "worker@core",
  95.      *     "worker@base"
  96.      *
  97.      * })
  98.      */
  99.     private $name;
  100.     /**
  101.      * @ORM\Column(type="string", length=255)
  102.      * @Groups({"worker.manage.base",
  103.      *     "partner.joined.projects.assigned.team.leaders",
  104.      *     "partner.manage.base.team.lead",
  105.      *     "partner.smart.active.employees",
  106.      *     "timesheet.for.stakeholder",
  107.      *     "timesheet.for.partner",
  108.      *     "partner.selected.project",
  109.      * 
  110.      *     "project.details.orders",
  111.      *     "order.detail",
  112.      * 
  113.      *     "order.lead",
  114.      *
  115.      *     "timesheet.collected.base",
  116.      *
  117.      *     "worker.base",
  118.      *     "worker.core",
  119.      *
  120.      *     "worker.substitution.core",
  121.      *
  122.      *     "worker@ref",
  123.      *     "worker@core",
  124.      *     "worker@base"
  125.      * })
  126.      */
  127.     private $surname;
  128.     /**
  129.      * Update over Subscriber 🔥
  130.      * @Groups({
  131.      *     "partner.joined.projects.assigned.team.leaders",
  132.      *     "partner.manage.base.team.lead",
  133.      *     "partner.smart.active.employees",
  134.      *     "worker.manage.base",
  135.      *     "partner.selected.project",
  136.      *
  137.      *     "project.details.orders",
  138.      *     "order.detail",
  139.      *     "order.lead",
  140.      *     "worker.substitution.core",
  141.      *
  142.      *     "worker.core",
  143.      *
  144.      *     "worker@core",
  145.      *     "worker@base"
  146.      * })
  147.      */
  148.     private $full_name;
  149.     /**
  150.      * @deprecated use in WorkerActivities
  151.      * @ORM\Column(type="datetime_immutable", nullable=true)
  152.      */
  153.     private $entry_at;
  154.     /**
  155.      * @deprecated use in WorkerActivities
  156.      * @ORM\Column(type="datetime_immutable", nullable=true)
  157.      */
  158.     private $exit_at;
  159.     /**
  160.      * @ORM\Column(type="datetime_immutable", nullable=true)
  161.      * @Groups({
  162.      *     "worker.manage.base",
  163.      *     "worker.core",
  164.      *
  165.      *     "worker@core"
  166.      * })
  167.      */
  168.     private $birthday_at;
  169.     /**
  170.      * @ORM\Column(type="string", length=255)
  171.      * @Gedmo\Slug(fields={"name", "surname"})
  172.      * @Groups({
  173.      *     "worker.manage.base",
  174.      *     "partner.smart.active.employees",
  175.      *     "worker.core",
  176.      *
  177.      *     "worker@core",
  178.      *     "worker@base"
  179.      * })
  180.      */
  181.     private $slug;
  182.     /**
  183.      * @ORM\ManyToMany(targetEntity=Qualification::class, inversedBy="workers", fetch="EXTRA_LAZY")
  184.      * @Groups({
  185.      *     "worker.manage.base",
  186.      *
  187.      *     "worker@qualifications"
  188.      * })
  189.      * @ORM\JoinColumn(onDelete="CASCADE")
  190.      */
  191.     private $qualifications;
  192.     /**
  193.      * ❌❌❌❌❌ TODO Bu kisim table halen colon cikarilmasi lazim
  194.      * @deprecated use in WorkerActivities
  195.      * ORM\OneToMany(targetEntity=WorkerInProject::class, mappedBy="worker", orphanRemoval=true, fetch="EXTRA_LAZY")
  196.      * @ORM\OrderBy({"id":"DESC"})
  197.      */
  198.     private $worker_in_projects;
  199.     /**
  200.      * @ORM\OneToMany(targetEntity=WorkerActivities::class, mappedBy="worker", cascade={"persist", "remove"}, orphanRemoval=true, fetch="EXTRA_LAZY" )
  201.      * @ORM\OrderBy({"id":"DESC"})
  202.      * @Groups({
  203.      *     "worker.manage.base",
  204.      *     "worker.actually.activity",
  205.      *     "worker.activities",
  206.      *
  207.      *     "worker@activities"
  208.      *
  209.      * })
  210.      *
  211.      */
  212.     private $worker_activities;
  213.     /**
  214.      * @deprecated use latest_activity
  215.      * Groups({"worker.actually.activity"})
  216.      */
  217.     private $worker_actually_activity;
  218.     /**
  219.      * @ORM\OneToMany(targetEntity=WorkerCertificates::class, mappedBy="worker", cascade={"persist", "remove"}, orphanRemoval=true, fetch="EXTRA_LAZY" )
  220.      * @Groups({
  221.      *     "worker.manage.base",
  222.      *
  223.      *     "worker@certificates"
  224.      * })
  225.      */
  226.     private $worker_certificates;
  227.     /**
  228.      * @deprecated use inside WorkerActivities
  229.      * ORM\OneToMany(targetEntity=WorkerTimesheet::class, mappedBy="worker_a", cascade={"persist"}, cascade={"persist", "remove"}, orphanRemoval=true, fetch="EXTRA_LAZY")
  230.      */
  231.     private $worker_timesheets;
  232.     /**
  233.      * ⚠️ TODO Bu alan ismi deprecated
  234.      * @deprecated this is worker_activity daily_working_hours
  235.      *  Bu alan Isciye ozel onun default calisma saati ama her Activity icin farkil olabilir
  236.      * @ORM\Column(type="decimal", precision=4, scale=2, nullable=true)
  237.      * @Groups({
  238.      *     "worker.manage.base",
  239.      *
  240.      *     "worker@core"
  241.      * })
  242.      */
  243.     private $daily_work_time;
  244.     /**
  245.      *  ⚠️ TODO Bu alan ismi deprecated
  246.      * @deprecated this is worker_activity hourly_rate
  247.      * Bu alan Isciye ozel onun default calisma ucreti ama her Activity icin farkil olabilir, ayrica her proje icinde
  248.      * @ORM\Column(type="decimal", precision=7, scale=2, nullable=true)
  249.      * @Groups({
  250.      *     "worker.manage.base",
  251.      *     "worker.manage.selected.worker.in.project",
  252.      *     "worker.manage.joined.projects",
  253.      *
  254.      *     "worker@core"
  255.      * })
  256.      */
  257.     private $cost_per_hour;
  258.     /**
  259.      * @ORM\Column(type="string", length=64, nullable=true, unique=false )
  260.      * @Groups({
  261.      *     "worker.manage.base",
  262.      *
  263.      *     "worker@base",
  264.      *     "worker@core"
  265.      * })
  266.      */
  267.     private $personal_id;
  268.     // Additional param
  269.     private array $total_worked_time;
  270.     /**
  271.      * @ORM\Column(type="datetime_immutable", nullable=true)
  272.      * @Groups({
  273.      *      "worker@core"
  274.      *  })
  275.      */
  276.     private $created_at;
  277.     /**
  278.      * @ORM\Column(type="string", length=24 , nullable=true )
  279.      * @Groups({
  280.      *     "worker.manage.base",
  281.      *
  282.      *     "worker@ref",
  283.      *     "worker@base",
  284.      *     "worker@core"
  285.      * })
  286.      */
  287.     private $tel;
  288.     /**
  289.      * @ORM\Column(type="string", length=255, nullable=true)
  290.      * @Groups({
  291.      *     "worker.manage.base",
  292.      *
  293.      *     "worker@core"
  294.      * })
  295.      */
  296.     private $uiid;
  297.     /**
  298.      * MUTATE THIS
  299.      * @ORM\Column(type="string", length=255, nullable=true)
  300.      * @Groups({
  301.      *     "worker.manage.base",
  302.      *     "partner.smart.active.employees",
  303.      *
  304.      *     "worker@core",
  305.      *     "worker@base"
  306.      * })
  307.      */
  308.     private $profile_image;
  309.     /**
  310.      * ____________________________________________________________________________________________________
  311.      * @deprecated use Original Filed And Mutate is over Subscriber
  312.      *
  313.      * Event Listener Prop
  314.      * This prop Update during event.listener
  315.      * @Groups({
  316.      *     "worker.manage.base",
  317.      *     "partner.smart.active.employees",
  318.      *
  319.      *     "worker@core"
  320.      * })
  321.      */
  322.     private $profile_image_full_path;
  323.     /**
  324.      * @deprecated use Original Filed And Mutate is over Subscriber use profile_image instead
  325.      * TODO bu ozellik EventListernes yada Subscriber uzerinden yapilacak
  326.      * Event Listener Prop
  327.      * This prop Update during event.listener
  328.      * @param string $profile_image_full_path
  329.      * @return Worker|null
  330.      */
  331.     public function setProfileImageFullPathstring $profile_image_full_path ): ?self {
  332.         $this->profile_image_full_path $profile_image_full_path;//  $this->getServiceArgumentFileDirs()['fetch'] . DIRECTORY_SEPARATOR . $this->getProfileImage();
  333.         return $this;
  334.     }
  335.     /**
  336.      * @deprecated use Original Filed And Mutate is over Subscriber use profile_image instead
  337.      * Event Listener Prop
  338.      */
  339.     public function getProfileImageFullPath(): ?string { return $this->profile_image_full_path/* $this->getServiceArgumentFileDirs()['fetch'] . DIRECTORY_SEPARATOR . $this->getProfileImage(); */ }
  340.     //  ____________________________________________________________________________________________________
  341.     /**
  342.      * TODO here 🔥worker activity uzerinden degil !!!
  343.      * @ORM\OneToMany(targetEntity=UserAppSettings::class, mappedBy="worker")
  344.      * @Groups({
  345.      *     "worker@user_app_settings"
  346.      *  })
  347.      */
  348.     private $user_app_settings;
  349.     /**
  350.      * @deprecated use in worker activity
  351.      * @ORM\ManyToMany(targetEntity=AccessRoles::class, inversedBy="workers")
  352.      */
  353.     private $worker_accessed_roles;
  354.     /**
  355.      * TODO islemler bittikten sonra cikar
  356.      * TODO this should be in WorkerActivities
  357.      * @ORM\OneToMany(targetEntity=ProjectOrders::class, mappedBy="order_lead")
  358.      */
  359.     private $projectOrders;
  360.     /**
  361.      * TODO thisi deprecated !!!!
  362.      * @deprecated use inside WorkerActivities
  363.      * @ORM\OneToOne(targetEntity=User::class, inversedBy="worker", cascade={"persist", "remove"})
  364.      * @Groups({
  365.      *     "worker.user",
  366.      * })
  367.      */
  368.     private $user;
  369.     /**
  370.      * ⚠️ Update over Subscriber
  371.      * @Groups({
  372.      *     "worker.latest.activity",
  373.      *     "worker@latest_activity"
  374.      * })
  375.     */
  376.     private $latest_activity;
  377.     /**
  378.      * @ORM\Column(type="string", length=255, nullable=true)
  379.      * @Groups({
  380.      *       "worker@core"
  381.      * })
  382.      */
  383.     private $email;
  384.     /**
  385.      * @param mixed $latest_activity
  386.      */
  387.     public function setLatestActivity(?WorkerActivities $latest_activity): self
  388.     {
  389.         $this->latest_activity $latest_activity;
  390.         return $this;
  391.     }
  392.     public function getLatestActivity(): ?WorkerActivities
  393.     {
  394.         return $this->latest_activity;
  395.     }
  396.     /**
  397.      * @return mixed
  398.      */
  399.     public function getTotalWorkedTime(): array
  400.     {
  401.         return $this->total_worked_time;
  402.     }
  403.     /**
  404.      * @param mixed $total_worked_time
  405.      */
  406.     public function setTotalWorkedTime( \DateInterval $total_worked_time ): void
  407.     {
  408.         $this->total_worked_time = [
  409.             "days" => $total_worked_time->days,
  410.             "month" => $total_worked_time->m,
  411.             "year" => $total_worked_time->y,
  412.         ];
  413.     }
  414.     /**
  415.      * @return mixed
  416.      */
  417.     public function getFullName()
  418.     {
  419.         return $this->full_name ?? $this->name " " $this->surname;
  420.     }
  421.     /**
  422.      * @param mixed $full_name
  423.      */
  424.     public function setFullName($full_name): self
  425.     {
  426.         $this->full_name $full_name;
  427.         return $this;
  428.     }
  429.     public function __construct()
  430.     {
  431.         $this->qualifications = new ArrayCollection();
  432.         $this->projects = new ArrayCollection();
  433.         $this->worker_in_projects = new ArrayCollection();
  434.         $this->worker_activities = new ArrayCollection();
  435.         $this->worker_certificates = new ArrayCollection();
  436.         $this->worker_timesheets = new ArrayCollection();
  437.         $this->user_app_settings = new ArrayCollection();
  438.         $this->role = new ArrayCollection();
  439.         $this->worker_accessed_roles = new ArrayCollection();
  440.         // TODO this should be in WorkerActivities
  441.         $this->projectOrders = new ArrayCollection();
  442.         // $this->ordersWithDelegatedAccess = new ArrayCollection();
  443.     }
  444.     public function getId(): ?int
  445.     {
  446.         return $this->id;
  447.     }
  448.     public function getName(): ?string
  449.     {
  450.         return $this->name;
  451.     }
  452.     public function setName(string $name): self
  453.     {
  454.         $this->name $name;
  455.         return $this;
  456.     }
  457.     public function getSurname(): ?string
  458.     {
  459.         return $this->surname;
  460.     }
  461.     public function setSurname(string $surname): self
  462.     {
  463.         $this->surname $surname;
  464.         return $this;
  465.     }
  466.     public function getEntryAt(): ?\DateTimeImmutable
  467.     {
  468.         return $this->entry_at;
  469.     }
  470.     public function setEntryAt(?\DateTimeImmutable $entry_at): self
  471.     {
  472.         $this->entry_at $entry_at;
  473.         return $this;
  474.     }
  475.     public function getExitAt(): ?\DateTimeImmutable
  476.     {
  477.         return $this->exit_at;
  478.     }
  479.     public function setExitAt(?\DateTimeImmutable $exit_at): self
  480.     {
  481.         $this->exit_at $exit_at;
  482.         return $this;
  483.     }
  484.     public function getBirthdayAt(): ?\DateTimeImmutable
  485.     {
  486.         return $this->birthday_at;
  487.         // return (new \DateTimeImmutable($this->birthday_at))->format('d.m.Y');
  488.     }
  489.     public function setBirthdayAt(?\DateTimeImmutable $birthday_at): self
  490.     {
  491.         $this->birthday_at $birthday_at;
  492.         return $this;
  493.     }
  494.     public function getSlug(): ?string
  495.     {
  496.         return $this->slug;
  497.     }
  498.     public function setSlug(string $slug): self
  499.     {
  500.         $this->slug $slug;
  501.         return $this;
  502.     }
  503.     /**
  504.      * @return Collection<int, Qualification>
  505.      */
  506.     public function getQualifications(): ?Collection
  507.     {
  508.             return $this->qualifications;
  509.     }
  510.     public function addQualification(Qualification $qualification): self
  511.     {
  512.         if (!$this->qualifications->contains($qualification)) {
  513.             $this->qualifications[] = $qualification;
  514.         }
  515.         return $this;
  516.     }
  517.     public function removeQualification(Qualification $qualification): self
  518.     {
  519.         $this->qualifications->removeElement($qualification);
  520.         return $this;
  521.     }
  522.     /**
  523.      * @return Collection<int, WorkerInProject>
  524.      */
  525.     public function getWorkerInProjects(): ?Collection
  526.     {
  527.         return $this->worker_in_projects;
  528.     }
  529.     public function addWorkerInProject(WorkerInProject $workerInProject): self
  530.     {
  531.         if (!$this->worker_in_projects->contains($workerInProject)) {
  532.             $this->worker_in_projects[] = $workerInProject;
  533.             $workerInProject->setWorker($this);
  534.         }
  535.         return $this;
  536.     }
  537.     public function removeWorkerInProject(WorkerInProject $workerInProject): self
  538.     {
  539.         if ($this->worker_in_projects->removeElement($workerInProject)) {
  540.             // set the owning side to null (unless already changed)
  541.             if ($workerInProject->getWorker() === $this) {
  542.                 $workerInProject->setWorker(null);
  543.             }
  544.         }
  545.         return $this;
  546.     }
  547.     /**
  548.      * @return Collection<int, WorkerActivities>
  549.      */
  550.     public function getWorkerActivities(): Collection
  551.     {
  552.         return $this->worker_activities;
  553.     }
  554.     /**
  555.      * @deprecated use worker_actually_activity
  556.      * @return Collection<int, WorkerActivities>
  557.      */
  558.     public function getWorkerActuallyPartner(): ?Partner
  559.     {
  560.         #dd($this->getWorkerActuallyActivity()['entity']->getPartner());
  561.         return $this->getWorkerActuallyActivity() ? $this->getWorkerActuallyActivity()['entity']->getPartner() : null;
  562.     }
  563.     /**
  564.      * ¨@deprecated use latest_activity
  565.     */
  566.     public function setWorkerActuallyActivityWorkerActivities $workerActivity ): void
  567.     {
  568.         $this->worker_actually_activity $workerActivity;
  569.     }
  570.     /**
  571.      * ¨@deprecated use latest_activity
  572.      */
  573.     public function getWorkerActuallyActivity()
  574.     {
  575.        // return $this->worker_actually_activity;
  576. //        $arr = $this->getWorkerActivities()->filter( function ( /**@var $workerActivity WorkerActivities*/ $workerActivity ){
  577. //            return is_null($workerActivity->getExitAt());
  578. //        })->toArray();
  579.         $simplified $this->getWorkerActivities()->map( function ( /**@var $workerActivity WorkerActivities*/ $workerActivity ){
  580.             return [
  581.                 "id" => $workerActivity->getId(),
  582.                 "entry_at" => $workerActivity->getEntryAt(),
  583.                 "exit_at" => $workerActivity->getExitAt(),
  584.                 "created_at" => $workerActivity->getCreatedAt(),
  585.                 "entity" => $workerActivity
  586.             ];
  587.         })->toArray();
  588.         usort($simplified, fn($a$b) => $b['created_at'] <=> $a['created_at']); // ID'ye göre azalan sıralama
  589.         return $simplified[0] ?? null// ID'si en büyük olan
  590.     }
  591.     public function addWorkerActivity(WorkerActivities $workerActivity): self
  592.     {
  593.         if (!$this->worker_activities->contains($workerActivity)) {
  594.             $this->worker_activities[] = $workerActivity;
  595.             $workerActivity->setWorker($this);
  596.         }
  597.         return $this;
  598.     }
  599.     public function removeWorkerActivity(WorkerActivities $workerActivity): self
  600.     {
  601.         if ($this->worker_activities->removeElement($workerActivity)) {
  602.             // set the owning side to null (unless already changed)
  603.             if ($workerActivity->getWorker() === $this) {
  604.                 $workerActivity->setWorker(null);
  605.             }
  606.         }
  607.         return $this;
  608.     }
  609.     /**
  610.      * @return Collection<int, WorkerCertificates>
  611.      */
  612.     public function getWorkerCertificates(): Collection
  613.     {
  614.         return $this->worker_certificates;
  615.     }
  616.     public function addWorkerCertificate(WorkerCertificates $workerCertificate): self
  617.     {
  618.         if (!$this->worker_certificates->contains($workerCertificate)) {
  619.             $this->worker_certificates[] = $workerCertificate;
  620.             $workerCertificate->setWorker($this);
  621.         }
  622.         return $this;
  623.     }
  624.     public function removeWorkerCertificate(WorkerCertificates $workerCertificate): self
  625.     {
  626.         if ($this->worker_certificates->removeElement($workerCertificate)) {
  627.             // set the owning side to null (unless already changed)
  628.             if ($workerCertificate->getWorker() === $this) {
  629.                 $workerCertificate->setWorker(null);
  630.             }
  631.         }
  632.         return $this;
  633.     }
  634.     /**
  635.      * @return Collection<int, WorkerTimesheet>
  636.      */
  637.     public function getWorkerTimesheets(): ?Collection
  638.     {
  639.         return $this->worker_timesheets;
  640.     }
  641.     public function addWorkerTimesheet(WorkerTimesheet $workerTimesheet): self
  642.     {
  643.         if (!$this->worker_timesheets->contains($workerTimesheet)) {
  644.             $this->worker_timesheets[] = $workerTimesheet;
  645.             $workerTimesheet->setWorker($this);
  646.         }
  647.         return $this;
  648.     }
  649.     public function removeWorkerTimesheet(WorkerTimesheet $workerTimesheet): self
  650.     {
  651.         if ($this->worker_timesheets->removeElement($workerTimesheet)) {
  652.             // set the owning side to null (unless already changed)
  653.             if ($workerTimesheet->getWorker() === $this) {
  654.                 $workerTimesheet->setWorker(null);
  655.             }
  656.         }
  657.         return $this;
  658.     }
  659.     public function getCostPerHour(): ?float
  660.     {
  661.         return $this->cost_per_hour;
  662.     }
  663.     public function setCostPerHour(?float $cost_per_hour): self
  664.     {
  665.         $this->cost_per_hour $cost_per_hour;
  666.         return $this;
  667.     }
  668.     public function getDailyWorkTime(): ?float
  669.     {
  670.         return $this->daily_work_time;
  671.     }
  672.     public function setDailyWorkTime(?float $daily_work_time): self
  673.     {
  674.         $this->daily_work_time $daily_work_time;
  675.         return $this;
  676.     }
  677.     public function getPersonalId(): ?string
  678.     {
  679.         return $this->personal_id;
  680.     }
  681.     public function setPersonalId(?string $personal_id): self
  682.     {
  683.         $this->personal_id $personal_id;
  684.         return $this;
  685.     }
  686.     public function getCreatedAt(): ?\DateTimeImmutable
  687.     {
  688.         return $this->created_at;
  689.     }
  690.     public function setCreatedAt(\DateTimeImmutable $created_at): self
  691.     {
  692.         $this->created_at $created_at;
  693.         return $this;
  694.     }
  695.     public function getTel(): ?string
  696.     {
  697.         return $this->tel;
  698.     }
  699.     public function setTel(?string $tel): self
  700.     {
  701.         $this->tel $tel;
  702.         return $this;
  703.     }
  704.     public function getUiid(): ?string
  705.     {
  706.         return $this->uiid;
  707.     }
  708.     public function setUiid(?string $uiid): self
  709.     {
  710.         $this->uiid $uiid;
  711.         return $this;
  712.     }
  713.     public function getProfileImage(): ?string
  714.     {
  715.         return $this->profile_image;
  716.     }
  717.     public function setProfileImage(?string $profile_image): self
  718.     {
  719.         $this->profile_image $profile_image;
  720.         return $this;
  721.     }
  722.     /**
  723.      * @return Collection<int, UserAppSettings>
  724.      */
  725.     public function getUserAppSettings(): Collection
  726.     {
  727.         return $this->user_app_settings;
  728.     }
  729.     public function addUserAppSetting(UserAppSettings $userAppSetting): self
  730.     {
  731.         if (!$this->user_app_settings->contains($userAppSetting)) {
  732.             $this->user_app_settings[] = $userAppSetting;
  733.             $userAppSetting->setWorker($this);
  734.         }
  735.         return $this;
  736.     }
  737.     public function removeUserAppSetting(UserAppSettings $userAppSetting): self
  738.     {
  739.         if ($this->user_app_settings->removeElement($userAppSetting)) {
  740.             // set the owning side to null (unless already changed)
  741.             if ($userAppSetting->getWorker() === $this) {
  742.                 $userAppSetting->setWorker(null);
  743.             }
  744.         }
  745.         return $this;
  746.     }
  747.     /**
  748.      * @return Collection<int, AccessRoles>
  749.      */
  750.     public function getWorkerAccessedRoles(): Collection
  751.     {
  752.         return $this->worker_accessed_roles;
  753.     }
  754.     public function addWorkerAccessedRole(AccessRoles $workerAccessedRole): self
  755.     {
  756.         if (!$this->worker_accessed_roles->contains($workerAccessedRole)) {
  757.             $this->worker_accessed_roles[] = $workerAccessedRole;
  758.         }
  759.         return $this;
  760.     }
  761.     public function removeWorkerAccessedRole(AccessRoles $workerAccessedRole): self
  762.     {
  763.         $this->worker_accessed_roles->removeElement($workerAccessedRole);
  764.         return $this;
  765.     }
  766.     /**
  767.      * // TODO this should be in WorkerActivities
  768.      * @return Collection<int, ProjectOrders>
  769.      */
  770.     public function getProjectOrders(): Collection
  771.     {
  772.         return $this->projectOrders;
  773.     }
  774.     // TODO this should be in WorkerActivities
  775.     public function addProjectOrder(ProjectOrders $projectOrder): self
  776.     {
  777.         if (!$this->projectOrders->contains($projectOrder)) {
  778.             $this->projectOrders[] = $projectOrder;
  779.             $projectOrder->setOrderLead($this);
  780.         }
  781.         return $this;
  782.     }
  783.     // TODO this should be in WorkerActivities
  784.     public function removeProjectOrder(ProjectOrders $projectOrder): self
  785.     {
  786.         if ($this->projectOrders->removeElement($projectOrder)) {
  787.             // set the owning side to null (unless already changed)
  788.             if ($projectOrder->getOrderLead() === $this) {
  789.                 $projectOrder->setOrderLead(null);
  790.             }
  791.         }
  792.         return $this;
  793.     }
  794.     public function getUser(): ?User
  795.     {
  796.         return $this->user;
  797.     }
  798.     public function setUser(?User $user): self
  799.     {
  800.         $this->user $user;
  801.         return $this;
  802.     }
  803.     public function getEmail(): ?string
  804.     {
  805.         return $this->email;
  806.     }
  807.     public function setEmail(?string $email): self
  808.     {
  809.         $this->email $email;
  810.         return $this;
  811.     }
  812. }