src/Entity/User.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
  8. use Symfony\Component\Security\Core\User\UserInterface;
  9. /**
  10.  * @ORM\Table(name="til_user")
  11.  * @ORM\Entity(repositoryClass="App\Repository\UserRepository")
  12.  */
  13. class User implements UserInterfacePasswordAuthenticatedUserInterface
  14. {
  15.     public function __toString(){
  16.         return $this->surname.' '.$this->name;
  17.     }
  18.     public function printPdfName(){
  19.         return $this->surname.' '.substr($this->name01);
  20.     }
  21.     public function getHasProvince($facilityProvince){
  22.         if($this->getAccountType()->getSlug() == "kam"){
  23.             foreach ($this->coveredProvinces as $province){
  24.                 if($province->getId() == $facilityProvince)
  25.                     return true;
  26.             }
  27.         }
  28.         return false;
  29.     }
  30.     public function getSellName(){
  31.         if($this->getAccountType()->getSlug() == "kam" && $this->getName() != "Tillomed")
  32.             return $this->surname' ' .$this->name;
  33.         elseif($this->getAccountType()->getSlug() == "kam" && $this->getName() == "Tillomed")
  34.             return "Vacant";
  35.         else
  36.             return "Customer Service";
  37.     }
  38.     public function getIsEligible($feature){
  39.         switch($feature){
  40.             case 'alarmBtn':
  41.                 if($this->getAccountType()->getSlug() == 'supervisor_enrico' 
  42.                     || strpos($this->getAccountType()->getSlug(), "commercial") !== false 
  43.                     || $this->getAccountType()->getSlug() == 'kam'
  44.                     || $this->getAccountType()->getSlug() == 'administration')
  45.                     return true;
  46.         }
  47.         return false;
  48.     }
  49.     public function getUnreadNotifications(){
  50.         $count 0;
  51.         foreach($this->notifications as $n){
  52.             if($n->getIsPersonal() && !$n->getIsRead())
  53.                 $count++;
  54.         }
  55.         return $count;
  56.     }
  57.     
  58.     public function getActualOdometer($month$year){
  59.         foreach($this->reimbursmentYears as $ry){
  60.             if($ry->getValue() == $year){
  61.                 foreach($ry->getReimbursmentMonths() as $rm){
  62.                     if($rm->getValue() == $month)
  63.                         return $rm->getEndMonthOdometer();
  64.                 }
  65.             }
  66.         }
  67.         return 0;
  68.     }
  69.     
  70.     public function getActualKmPlusMinus($month$year){
  71.         $odometer $this->getActualOdometer($month$year);
  72.         foreach($this->reimbursmentYears as $ry){
  73.             foreach($ry->getReimbursmentMonths() as $rm){
  74.                
  75.                 return  $odometer $l->getStartKm() - ($rm->getValue()*$l->getKmMonth());
  76.             }
  77.         }
  78.         foreach($this->leasings as $l){
  79.         }
  80.         return 0;
  81.     }
  82.     
  83.     public function getMonthlyEarnedHolidays($year){
  84.         if($this->employee != null)
  85.             foreach($this->employee->getWorkHolidays() as $wh){
  86.                 if($wh->getYear() == $year)
  87.                     return $wh->getHoliday();
  88.             }
  89.         return 0;
  90.     }
  91.     
  92.     public function getMonthlyEarnedRols($year){
  93.         if($this->employee != null)
  94.             foreach($this->employee->getWorkHolidays() as $wh){
  95.                 if($wh->getYear() == $year)
  96.                     return $wh->getRol();
  97.             }
  98.         return 0;
  99.     }
  100.     
  101.     public function getReimbursmentTypeBudget($type$year){
  102.         foreach($this->jturt as $jt){
  103.             if($jt->getReimbursmentType()->getId() == $type && $jt->getYear() == $year && $jt->getValue() != null)
  104.                 return $jt->getValue();
  105.         }
  106.         return "0.00";
  107.     }
  108.     
  109.     public function getReimbursmentTypeBudgetCount($year){
  110.         $count 0;
  111.         foreach($this->jturt as $jt){
  112.             if($jt->getYear() == $year && $jt->getValue() > 0)
  113.                 $count ++;
  114.         }
  115.         return $count;
  116.     }
  117.     public function getCurrentBudgetKamPercentage($date){
  118.         $year $date->format("Y");
  119.         if($date->format("m") < 4)
  120.             $year--;
  121.         foreach($this->budgetKams as $bk){
  122.             if($bk->getBudgetTotal()->getYear() == $year)
  123.                 return $bk->getPercentage();
  124.         }
  125.         return "0";
  126.     }
  127.     public function getUnclosedPresenceMonth(){
  128.         $months = array();
  129.         foreach($this->presenceYears as $py){
  130.             foreach($py->getPresenceMonths() as $pm){
  131.                 if($pm->getStatus() < 2){
  132.                     array_push($months$pm);
  133.                 }
  134.             }
  135.         }
  136.         return $months;
  137.     }
  138.     public function getMonthPresenceStats($month$year$startDate$endDate$filterType){
  139.         $presence 0;
  140.         $rol 0;
  141.         $holiday 0;
  142.         $transfer 0;
  143.         $permission 0;
  144.         $illness 0;
  145.         $meeting 0;
  146.         $congress 0;
  147.         foreach($this->presenceYears as $py){
  148.             if($filterType == "progressive"){
  149.                 if($month && ($py->getValue() == $year || $py->getValue() == $year 1)){
  150.                     foreach($py->getPresenceMonths() as $pm){
  151.                         if(($py->getValue() == $year && $pm->getValue() <= $month) || ($py->getValue() == $year && $pm->getValue() >= 4)){
  152.                             foreach($pm->getPresenceDays() as $pd){
  153.                                 if($pd->getJobHours() > 0)
  154.                                     $presence++;
  155.                                 $rol += $pd->getRol();
  156.                                 $holiday += $pd->getHoliday();
  157.                                 $transfer += $pd->getIsTransfer();
  158.                                 $permission += $pd->getPermission();
  159.                                 $illness += $pd->getIllness();
  160.                                 $meeting += $pd->getIsMeeting();
  161.                                 $congress += $pd->getIsCongress();
  162.                             }
  163.                         }
  164.                     }
  165.                 }
  166.                 elseif($month >= && $py->getValue() == $year){
  167.                     foreach($py->getPresenceMonths() as $pm){
  168.                         if($pm->getValue() >= && $pm->getValue() <= $month){
  169.                             foreach($pm->getPresenceDays() as $pd){
  170.                                 if($pd->getJobHours() > 0)
  171.                                     $presence++;
  172.                                 $rol += $pd->getRol();
  173.                                 $holiday += $pd->getHoliday();
  174.                                 $transfer += $pd->getIsTransfer();
  175.                                 $permission += $pd->getPermission();
  176.                                 $illness += $pd->getIllness();
  177.                                 $meeting += $pd->getIsMeeting();
  178.                                 $congress += $pd->getIsCongress();
  179.                             }
  180.                         }
  181.                     }
  182.                 }
  183.             }
  184.             elseif($filterType == "monthly"){
  185.                 if($py->getValue() == $year){
  186.                     foreach($py->getPresenceMonths() as $pm){
  187.                         if($pm->getValue() == $month){
  188.                             foreach($pm->getPresenceDays() as $pd){
  189.                                 if($pd->getJobHours() > 0)
  190.                                     $presence++;
  191.                                 $rol += $pd->getRol();
  192.                                 $holiday += $pd->getHoliday();
  193.                                 $transfer += $pd->getIsTransfer();
  194.                                 $permission += $pd->getPermission();
  195.                                 $illness += $pd->getIllness();
  196.                                 $meeting += $pd->getIsMeeting();
  197.                                 $congress += $pd->getIsCongress();
  198.                             }
  199.                         }
  200.                     }
  201.                 }
  202.             }
  203.             else{
  204.                 if($py->getValue() >= $startDate->format("Y") and $py->getValue() <= $endDate->format("Y")){
  205.                     foreach($py->getPresenceMonths() as $pm){
  206.                         foreach($pm->getPresenceDays() as $pd){
  207.                             if($pd->getDate()->format("Ymd") >= $startDate->format("Ymd") && $pd->getDate()->format("Ymd") <= $endDate->format("Ymd")){
  208.                                 if($pd->getJobHours() > 0)
  209.                                     $presence++;
  210.                                 $rol += $pd->getRol();
  211.                                 $holiday += $pd->getHoliday();
  212.                                 $transfer += $pd->getIsTransfer();
  213.                                 $permission += $pd->getPermission();
  214.                                 $illness += $pd->getIllness();
  215.                                 $meeting += $pd->getIsMeeting();
  216.                                 $congress += $pd->getIsCongress();
  217.                             }
  218.                         }
  219.                     }
  220.                 }
  221.             }
  222.         }
  223.         return array($presence$rol$holiday$transfer$permission$illness$meeting$congress);
  224.     }
  225.     public function getMonthReimbursmentStats($month$year$filterType){
  226.         $types = array();
  227.         foreach($this->reimbursmentYears as $ry){
  228.             if($filterType == "progressive"){
  229.                 if($month && ($ry->getValue() == $year || $ry->getValue() == $year 1)){
  230.                     foreach($ry->getReimbursmentMonths() as $rm){
  231.                         if(($ry->getValue() == $year && $rm->getValue() <= $month) || ($ry->getValue() == $year && $rm->getValue() >= 4)){
  232.                             foreach($rm->getReimbursmentDays() as $rd){
  233.                                 foreach($rd->getReimbursments() as $r){
  234.                                     $index $r->getReimbursmentType()->getId();
  235.                                     if(array_key_exists($index$types)) 
  236.                                         $types[$index] += $r->getValue(); 
  237.                                     else 
  238.                                         $types[$index] = $r->getValue();
  239.                                 }
  240.                             }
  241.                         }
  242.                     }
  243.                 }
  244.                 elseif($month >= && $ry->getValue() == $year){
  245.                     foreach($ry->getReimbursmentMonths() as $rm){
  246.                         if($rm->getValue() >= && $rm->getValue() <= $month){
  247.                             foreach($rm->getReimbursmentDays() as $rd){
  248.                                 foreach($rd->getReimbursments() as $r){
  249.                                     $index $r->getReimbursmentType()->getId();
  250.                                     if(array_key_exists($index$types)) 
  251.                                         $types[$index] += $r->getValue(); 
  252.                                     else 
  253.                                         $types[$index] = $r->getValue();
  254.                                 }
  255.                             }
  256.                         }
  257.                     }
  258.                 }
  259.             }
  260.             else{
  261.                 if($ry->getValue() == $year){
  262.                     foreach($ry->getReimbursmentMonths() as $rm){
  263.                         if($rm->getValue() == $month){
  264.                             foreach($rm->getReimbursmentDays() as $rd){
  265.                                 foreach($rd->getReimbursments() as $r){
  266.                                     $index $r->getReimbursmentType()->getId();
  267.                                     if(array_key_exists($index$types)) 
  268.                                         $types[$index] += $r->getValue(); 
  269.                                     else 
  270.                                         $types[$index] = $r->getValue();
  271.                                 }
  272.                             }
  273.                         }
  274.                     }
  275.                 }
  276.             }
  277.         }
  278.         return $types;
  279.     }
  280.     /**
  281.      * @var int
  282.      *
  283.      * @ORM\Column(name="id", type="bigint", nullable=false)
  284.      * @ORM\Id
  285.      * @ORM\GeneratedValue(strategy="IDENTITY")
  286.      */
  287.     private $id;
  288.     /**
  289.      * @ORM\Column(name="email", type="string", length=191, unique=true, nullable=true)
  290.      */
  291.     protected $email;
  292.     /**
  293.      * @ORM\Column(name="name", type="string", length=191)
  294.      */
  295.     protected $name;
  296.     /**
  297.      * @ORM\Column(name="surname", type="string", length=191)
  298.      */
  299.     protected $surname;
  300.     
  301.     /**
  302.      * @ORM\Column(name="password", type="string", length=191, nullable=true)
  303.      */
  304.     protected $password;
  305.     /**
  306.      * @var bool
  307.      *
  308.      * @ORM\Column(name="is_active", type="boolean", nullable=false)
  309.      */
  310.     private $isActive 0;
  311.     /**
  312.      * @var bool
  313.      *
  314.      * @ORM\Column(name="is_admin_active", type="boolean", nullable=false)
  315.      */
  316.     private $isAdminActive true;
  317.     /**
  318.      * @var string
  319.      *
  320.      * @ORM\Column(name="directory_path", type="string", length=191, length=255, nullable=false)
  321.      */
  322.     private $directoryPath;
  323.     /**
  324.      * @var string|null
  325.      *
  326.      * @ORM\Column(name="one_time_code", type="string", length=191, length=255, nullable=true)
  327.      */
  328.     private $oneTimeCode;
  329.     /**
  330.      * @var \DateTime|null
  331.      *
  332.      * @ORM\Column(name="expiration_one_time_code", type="date", nullable=true)
  333.      */
  334.     private $expirationOneTimeCode;
  335.     /**
  336.      * @var bool
  337.      *
  338.      * @ORM\Column(name="is_email_notification_active", type="boolean", nullable=false)
  339.      */
  340.     private $isEmailNotificationActive 0;
  341.     /**
  342.      * @var string|null
  343.      *
  344.      * @ORM\Column(name="office_hours", type="text", length=0, nullable=true)
  345.      */
  346.     private $officeHours;
  347.     /**
  348.      * @var bool
  349.      *
  350.      * @ORM\Column(name="is_alert_read", type="boolean", nullable=false)
  351.      */
  352.     private $isAlertRead 0;
  353.     /**
  354.      * @var bool
  355.      *
  356.      * @ORM\Column(name="is_gdpr_sent", type="boolean", nullable=false)
  357.      */
  358.     private $isGdprSent 0;
  359.     /**
  360.      * @ORM\Column(name="role", type="string", length=191)
  361.      */
  362.     protected $role "ROLE_USER";
  363.     
  364.     // ONE TO ONE    
  365.         /**
  366.          * @ORM\OneToOne(targetEntity="Privacy", mappedBy="user", cascade={"remove", "persist"})
  367.          */
  368.         protected $privacy;
  369.         
  370.         /**
  371.          * @ORM\OneToOne(targetEntity="Profile", mappedBy="user", cascade={"remove", "persist"})
  372.          */
  373.         protected $profile;
  374.         
  375.         /**
  376.          * @ORM\OneToOne(targetEntity="EmployeeData", mappedBy="user", cascade={"remove", "persist"})
  377.          */
  378.         protected $employee;
  379.     //
  380.     // MANY TO ONE
  381.         /**
  382.          * @ORM\ManyToOne(targetEntity="AccountType", inversedBy="users")
  383.          * @ORM\JoinColumn(name="account_type_id", referencedColumnName="id")
  384.          */
  385.         private $accountType;
  386.         /**
  387.          * @ORM\ManyToOne(targetEntity="User", inversedBy="underResponsibilityUsers")
  388.          * @ORM\JoinColumn(name="supervisor_id", referencedColumnName="id")
  389.          */
  390.         private $supervisor;
  391.     //
  392.     // ONE TO MANY
  393.         /**
  394.          * @ORM\OneToMany(targetEntity="User", mappedBy="supervisor")
  395.          */
  396.         protected $underResponsibilityUsers;
  397.         /**
  398.          * @ORM\OneToMany(targetEntity="TestCode", mappedBy="user")
  399.          */
  400.         protected $codes;
  401.         /**
  402.          * @ORM\OneToMany(targetEntity="JoinTableUserTest", mappedBy="user")
  403.          */
  404.         protected $tests;
  405.         /**
  406.          * @ORM\OneToMany(targetEntity="JoinTableUserReimbursmentType", mappedBy="user")
  407.          */
  408.         private $jturt;
  409.         /**
  410.          * @ORM\OneToMany(targetEntity="Leasing", mappedBy="user")
  411.          */
  412.         private $leasings;
  413.         /**
  414.          * @ORM\OneToMany(targetEntity="Answer", mappedBy="user")
  415.          */
  416.         protected $answers;
  417.         /**
  418.          * @ORM\OneToMany(targetEntity="Document", mappedBy="user")
  419.          */
  420.         protected $documents;
  421.         /**
  422.          * @ORM\OneToMany(targetEntity="Document", mappedBy="owner")
  423.          */
  424.         protected $uploads;
  425.         /**
  426.          * @ORM\OneToMany(targetEntity="Notification", mappedBy="user")
  427.          */
  428.         protected $notifications;
  429.         /**
  430.          * @ORM\OneToMany(targetEntity="Log", mappedBy="user")
  431.          */
  432.         protected $logs;
  433.         /**
  434.          * @ORM\OneToMany(targetEntity="PresenceYear", mappedBy="user")
  435.          */
  436.         protected $presenceYears;
  437.         /**
  438.          * @ORM\OneToMany(targetEntity="RequestHoliday", mappedBy="user")
  439.          */
  440.         protected $requestHolidays;
  441.         /**
  442.          * @ORM\OneToMany(targetEntity="ReimbursmentYear", mappedBy="user")
  443.          */
  444.         protected $reimbursmentYears;
  445.         /**
  446.          * @ORM\OneToMany(targetEntity="Facility", mappedBy="assignedKam")
  447.          */
  448.         protected $assignedFacilities;
  449.         /**
  450.          * @ORM\OneToMany(targetEntity="Offer", mappedBy="sender")
  451.          */
  452.         protected $sentOffers;
  453.         
  454.         /**
  455.          * @ORM\OneToMany(targetEntity="Offer", mappedBy="refUser")
  456.          */
  457.         protected $refUserOffers;
  458.         /**
  459.          * @ORM\OneToMany(targetEntity="OfferRequest", mappedBy="sender")
  460.          */
  461.         protected $sentOfferRequests;
  462.         
  463.         /**
  464.          * @ORM\OneToMany(targetEntity="OfferRequest", mappedBy="refUser")
  465.          */
  466.         protected $refUserOfferRequests;
  467.         /**
  468.          * @ORM\OneToMany(targetEntity="ActivityYear", mappedBy="user")
  469.          */
  470.         protected $activityYears;
  471.         /**
  472.          * @ORM\OneToMany(targetEntity="Activity", mappedBy="user")
  473.          */
  474.         protected $activities;
  475.         /**
  476.          * @ORM\OneToMany(targetEntity="Sell", mappedBy="user")
  477.          */
  478.         protected $sells;
  479.         
  480.         /**
  481.          * @ORM\OneToMany(targetEntity="BudgetKam", mappedBy="user")
  482.          */
  483.         protected $budgetKams;
  484.         /**
  485.          * @ORM\OneToMany(targetEntity="EditRequest", mappedBy="sender")
  486.          */
  487.         protected $editRequests;
  488.         /**
  489.          * @ORM\OneToMany(targetEntity="PresenceDay", mappedBy="insertedBy")
  490.          */
  491.         protected $presenceDays;
  492.     //
  493.     // MANY TO MANY
  494.         /**
  495.          * @ORM\ManyToMany(targetEntity="Province", inversedBy="kams")
  496.          * @ORM\JoinTable(name="til_join_table_user_province")
  497.          */
  498.         private $coveredProvinces;
  499.     //
  500.     /**
  501.      * Constructor
  502.      */
  503.     public function __construct()
  504.     {
  505.         $this->province = new \Doctrine\Common\Collections\ArrayCollection();
  506.         $this->codes = new ArrayCollection();
  507.         $this->tests = new ArrayCollection();
  508.         $this->jturt = new ArrayCollection();
  509.         $this->leasings = new ArrayCollection();
  510.         $this->answers = new ArrayCollection();
  511.         $this->documents = new ArrayCollection();
  512.         $this->uploads = new ArrayCollection();
  513.         $this->notifications = new ArrayCollection();
  514.         $this->presenceYears = new ArrayCollection();
  515.         $this->reimbursmentYears = new ArrayCollection();
  516.         $this->sentOffers = new ArrayCollection();
  517.         $this->refUserOffers = new ArrayCollection();
  518.         $this->sentOfferRequests = new ArrayCollection();
  519.         $this->refUserOfferRequests = new ArrayCollection();
  520.         $this->activityYears = new ArrayCollection();
  521.         $this->activities = new ArrayCollection();
  522.         $this->sells = new ArrayCollection();
  523.         $this->budgetKams = new ArrayCollection();
  524.         $this->assignedFacilities = new ArrayCollection();
  525.         $this->coveredProvinces = new ArrayCollection();
  526.         $this->requestHolidays = new ArrayCollection();
  527.         $this->editRequests = new ArrayCollection();
  528.         $this->logs = new ArrayCollection();
  529.         $this->presenceDays = new ArrayCollection();
  530.         $this->underResponsibilityUsers = new ArrayCollection();
  531.     }
  532.     /**
  533.      * @inheritdoc
  534.      */
  535.     public function getRoles(): array
  536.     {
  537.         switch($this->role){
  538.             case 'ROLE_ADMIN': return array('ROLE_ADMIN');
  539.             case 'ROLE_USER': return array('ROLE_USER');
  540.         }
  541.     }
  542.     public function getSalt(): ?string
  543.     {
  544.         return null;
  545.     }
  546.     /**
  547.      * @see UserInterface
  548.      */
  549.     public function eraseCredentials()
  550.     {
  551.     }
  552.     public function getUserIdentifier(): string
  553.     {
  554.         return (string) $this->email;
  555.     }
  556.     public function getUsername(): string
  557.     {
  558.         return null;
  559.     }
  560.     /**
  561.      * @see PasswordAuthenticatedUserInterface
  562.      */
  563.     public function getPassword(): string
  564.     {
  565.         return $this->password;
  566.     }
  567.     public function setPassword(string $password): self
  568.     {
  569.         $this->password $password;
  570.         return $this;
  571.     }
  572.     public function getId(): ?string
  573.     {
  574.         return $this->id;
  575.     }
  576.     public function getEmail(): ?string
  577.     {
  578.         return $this->email;
  579.     }
  580.     public function setEmail(?string $email): self
  581.     {
  582.         $this->email $email;
  583.         return $this;
  584.     }
  585.     public function getName(): ?string
  586.     {
  587.         return $this->name;
  588.     }
  589.     public function setName(string $name): self
  590.     {
  591.         $this->name $name;
  592.         return $this;
  593.     }
  594.     public function getSurname(): ?string
  595.     {
  596.         return $this->surname;
  597.     }
  598.     public function setSurname(string $surname): self
  599.     {
  600.         $this->surname $surname;
  601.         return $this;
  602.     }
  603.     public function isIsActive(): ?bool
  604.     {
  605.         return $this->isActive;
  606.     }
  607.     public function setIsActive(bool $isActive): self
  608.     {
  609.         $this->isActive $isActive;
  610.         return $this;
  611.     }
  612.     public function isIsAdminActive(): ?bool
  613.     {
  614.         return $this->isAdminActive;
  615.     }
  616.     public function setIsAdminActive(bool $isAdminActive): self
  617.     {
  618.         $this->isAdminActive $isAdminActive;
  619.         return $this;
  620.     }
  621.     public function getDirectoryPath(): ?string
  622.     {
  623.         return $this->directoryPath;
  624.     }
  625.     public function setDirectoryPath(string $directoryPath): self
  626.     {
  627.         $this->directoryPath $directoryPath;
  628.         return $this;
  629.     }
  630.     public function getOneTimeCode(): ?string
  631.     {
  632.         return $this->oneTimeCode;
  633.     }
  634.     public function setOneTimeCode(?string $oneTimeCode): self
  635.     {
  636.         $this->oneTimeCode $oneTimeCode;
  637.         return $this;
  638.     }
  639.     public function getExpirationOneTimeCode(): ?\DateTimeInterface
  640.     {
  641.         return $this->expirationOneTimeCode;
  642.     }
  643.     public function setExpirationOneTimeCode(?\DateTimeInterface $expirationOneTimeCode): self
  644.     {
  645.         $this->expirationOneTimeCode $expirationOneTimeCode;
  646.         return $this;
  647.     }
  648.     public function isIsEmailNotificationActive(): ?bool
  649.     {
  650.         return $this->isEmailNotificationActive;
  651.     }
  652.     public function setIsEmailNotificationActive(bool $isEmailNotificationActive): self
  653.     {
  654.         $this->isEmailNotificationActive $isEmailNotificationActive;
  655.         return $this;
  656.     }
  657.     public function getOfficeHours(): ?string
  658.     {
  659.         return $this->officeHours;
  660.     }
  661.     public function setOfficeHours(?string $officeHours): self
  662.     {
  663.         $this->officeHours $officeHours;
  664.         return $this;
  665.     }
  666.     public function isIsAlertRead(): ?bool
  667.     {
  668.         return $this->isAlertRead;
  669.     }
  670.     public function setIsAlertRead(bool $isAlertRead): self
  671.     {
  672.         $this->isAlertRead $isAlertRead;
  673.         return $this;
  674.     }
  675.     public function isIsGdprSent(): ?bool
  676.     {
  677.         return $this->isGdprSent;
  678.     }
  679.     public function setIsGdprSent(bool $isGdprSent): self
  680.     {
  681.         $this->isGdprSent $isGdprSent;
  682.         return $this;
  683.     }
  684.     public function getRole(): ?string
  685.     {
  686.         return $this->role;
  687.     }
  688.     public function setRole(string $role): self
  689.     {
  690.         $this->role $role;
  691.         return $this;
  692.     }
  693.     public function getPrivacy(): ?Privacy
  694.     {
  695.         return $this->privacy;
  696.     }
  697.     public function setPrivacy(?Privacy $privacy): self
  698.     {
  699.         // unset the owning side of the relation if necessary
  700.         if ($privacy === null && $this->privacy !== null) {
  701.             $this->privacy->setUser(null);
  702.         }
  703.         // set the owning side of the relation if necessary
  704.         if ($privacy !== null && $privacy->getUser() !== $this) {
  705.             $privacy->setUser($this);
  706.         }
  707.         $this->privacy $privacy;
  708.         return $this;
  709.     }
  710.     public function getProfile(): ?Profile
  711.     {
  712.         return $this->profile;
  713.     }
  714.     public function setProfile(?Profile $profile): self
  715.     {
  716.         // unset the owning side of the relation if necessary
  717.         if ($profile === null && $this->profile !== null) {
  718.             $this->profile->setUser(null);
  719.         }
  720.         // set the owning side of the relation if necessary
  721.         if ($profile !== null && $profile->getUser() !== $this) {
  722.             $profile->setUser($this);
  723.         }
  724.         $this->profile $profile;
  725.         return $this;
  726.     }
  727.     public function getEmployee(): ?EmployeeData
  728.     {
  729.         return $this->employee;
  730.     }
  731.     public function setEmployee(?EmployeeData $employee): self
  732.     {
  733.         // unset the owning side of the relation if necessary
  734.         if ($employee === null && $this->employee !== null) {
  735.             $this->employee->setUser(null);
  736.         }
  737.         // set the owning side of the relation if necessary
  738.         if ($employee !== null && $employee->getUser() !== $this) {
  739.             $employee->setUser($this);
  740.         }
  741.         $this->employee $employee;
  742.         return $this;
  743.     }
  744.     /**
  745.      * @return Collection<int, TestCode>
  746.      */
  747.     public function getCodes(): Collection
  748.     {
  749.         return $this->codes;
  750.     }
  751.     public function addCode(TestCode $code): self
  752.     {
  753.         if (!$this->codes->contains($code)) {
  754.             $this->codes[] = $code;
  755.             $code->setUser($this);
  756.         }
  757.         return $this;
  758.     }
  759.     public function removeCode(TestCode $code): self
  760.     {
  761.         if ($this->codes->removeElement($code)) {
  762.             // set the owning side to null (unless already changed)
  763.             if ($code->getUser() === $this) {
  764.                 $code->setUser(null);
  765.             }
  766.         }
  767.         return $this;
  768.     }
  769.     /**
  770.      * @return Collection<int, JoinTableUserTest>
  771.      */
  772.     public function getTests(): Collection
  773.     {
  774.         return $this->tests;
  775.     }
  776.     public function addTest(JoinTableUserTest $test): self
  777.     {
  778.         if (!$this->tests->contains($test)) {
  779.             $this->tests[] = $test;
  780.             $test->setUser($this);
  781.         }
  782.         return $this;
  783.     }
  784.     public function removeTest(JoinTableUserTest $test): self
  785.     {
  786.         if ($this->tests->removeElement($test)) {
  787.             // set the owning side to null (unless already changed)
  788.             if ($test->getUser() === $this) {
  789.                 $test->setUser(null);
  790.             }
  791.         }
  792.         return $this;
  793.     }
  794.     /**
  795.      * @return Collection<int, JoinTableUserReimbursmentType>
  796.      */
  797.     public function getJturt(): Collection
  798.     {
  799.         return $this->jturt;
  800.     }
  801.     public function addJturt(JoinTableUserReimbursmentType $jturt): self
  802.     {
  803.         if (!$this->jturt->contains($jturt)) {
  804.             $this->jturt[] = $jturt;
  805.             $jturt->setUser($this);
  806.         }
  807.         return $this;
  808.     }
  809.     public function removeJturt(JoinTableUserReimbursmentType $jturt): self
  810.     {
  811.         if ($this->jturt->removeElement($jturt)) {
  812.             // set the owning side to null (unless already changed)
  813.             if ($jturt->getUser() === $this) {
  814.                 $jturt->setUser(null);
  815.             }
  816.         }
  817.         return $this;
  818.     }
  819.     /**
  820.      * @return Collection<int, Leasing>
  821.      */
  822.     public function getLeasings(): Collection
  823.     {
  824.         return $this->leasings;
  825.     }
  826.     public function addLeasing(Leasing $leasing): self
  827.     {
  828.         if (!$this->leasings->contains($leasing)) {
  829.             $this->leasings[] = $leasing;
  830.             $leasing->setUser($this);
  831.         }
  832.         return $this;
  833.     }
  834.     public function removeLeasing(Leasing $leasing): self
  835.     {
  836.         if ($this->leasings->removeElement($leasing)) {
  837.             // set the owning side to null (unless already changed)
  838.             if ($leasing->getUser() === $this) {
  839.                 $leasing->setUser(null);
  840.             }
  841.         }
  842.         return $this;
  843.     }
  844.     /**
  845.      * @return Collection<int, Answer>
  846.      */
  847.     public function getAnswers(): Collection
  848.     {
  849.         return $this->answers;
  850.     }
  851.     public function addAnswer(Answer $answer): self
  852.     {
  853.         if (!$this->answers->contains($answer)) {
  854.             $this->answers[] = $answer;
  855.             $answer->setUser($this);
  856.         }
  857.         return $this;
  858.     }
  859.     public function removeAnswer(Answer $answer): self
  860.     {
  861.         if ($this->answers->removeElement($answer)) {
  862.             // set the owning side to null (unless already changed)
  863.             if ($answer->getUser() === $this) {
  864.                 $answer->setUser(null);
  865.             }
  866.         }
  867.         return $this;
  868.     }
  869.     /**
  870.      * @return Collection<int, Document>
  871.      */
  872.     public function getDocuments(): Collection
  873.     {
  874.         return $this->documents;
  875.     }
  876.     public function addDocument(Document $document): self
  877.     {
  878.         if (!$this->documents->contains($document)) {
  879.             $this->documents[] = $document;
  880.             $document->setUser($this);
  881.         }
  882.         return $this;
  883.     }
  884.     public function removeDocument(Document $document): self
  885.     {
  886.         if ($this->documents->removeElement($document)) {
  887.             // set the owning side to null (unless already changed)
  888.             if ($document->getUser() === $this) {
  889.                 $document->setUser(null);
  890.             }
  891.         }
  892.         return $this;
  893.     }
  894.     /**
  895.      * @return Collection<int, Document>
  896.      */
  897.     public function getUploads(): Collection
  898.     {
  899.         return $this->uploads;
  900.     }
  901.     public function addUpload(Document $upload): self
  902.     {
  903.         if (!$this->uploads->contains($upload)) {
  904.             $this->uploads[] = $upload;
  905.             $upload->setOwner($this);
  906.         }
  907.         return $this;
  908.     }
  909.     public function removeUpload(Document $upload): self
  910.     {
  911.         if ($this->uploads->removeElement($upload)) {
  912.             // set the owning side to null (unless already changed)
  913.             if ($upload->getOwner() === $this) {
  914.                 $upload->setOwner(null);
  915.             }
  916.         }
  917.         return $this;
  918.     }
  919.     /**
  920.      * @return Collection<int, Notification>
  921.      */
  922.     public function getNotifications(): Collection
  923.     {
  924.         return $this->notifications;
  925.     }
  926.     public function addNotification(Notification $notification): self
  927.     {
  928.         if (!$this->notifications->contains($notification)) {
  929.             $this->notifications[] = $notification;
  930.             $notification->setUser($this);
  931.         }
  932.         return $this;
  933.     }
  934.     public function removeNotification(Notification $notification): self
  935.     {
  936.         if ($this->notifications->removeElement($notification)) {
  937.             // set the owning side to null (unless already changed)
  938.             if ($notification->getUser() === $this) {
  939.                 $notification->setUser(null);
  940.             }
  941.         }
  942.         return $this;
  943.     }
  944.     /**
  945.      * @return Collection<int, PresenceYear>
  946.      */
  947.     public function getPresenceYears(): Collection
  948.     {
  949.         return $this->presenceYears;
  950.     }
  951.     public function addPresenceYear(PresenceYear $presenceYear): self
  952.     {
  953.         if (!$this->presenceYears->contains($presenceYear)) {
  954.             $this->presenceYears[] = $presenceYear;
  955.             $presenceYear->setUser($this);
  956.         }
  957.         return $this;
  958.     }
  959.     public function removePresenceYear(PresenceYear $presenceYear): self
  960.     {
  961.         if ($this->presenceYears->removeElement($presenceYear)) {
  962.             // set the owning side to null (unless already changed)
  963.             if ($presenceYear->getUser() === $this) {
  964.                 $presenceYear->setUser(null);
  965.             }
  966.         }
  967.         return $this;
  968.     }
  969.     /**
  970.      * @return Collection<int, RequestHoliday>
  971.      */
  972.     public function getRequestHolidays(): Collection
  973.     {
  974.         return $this->requestHolidays;
  975.     }
  976.     public function addRequestHoliday(RequestHoliday $requestHoliday): self
  977.     {
  978.         if (!$this->requestHolidays->contains($requestHoliday)) {
  979.             $this->requestHolidays[] = $requestHoliday;
  980.             $requestHoliday->setUser($this);
  981.         }
  982.         return $this;
  983.     }
  984.     public function removeRequestHoliday(RequestHoliday $requestHoliday): self
  985.     {
  986.         if ($this->requestHolidays->removeElement($requestHoliday)) {
  987.             // set the owning side to null (unless already changed)
  988.             if ($requestHoliday->getUser() === $this) {
  989.                 $requestHoliday->setUser(null);
  990.             }
  991.         }
  992.         return $this;
  993.     }
  994.     /**
  995.      * @return Collection<int, ReimbursmentYear>
  996.      */
  997.     public function getReimbursmentYears(): Collection
  998.     {
  999.         return $this->reimbursmentYears;
  1000.     }
  1001.     public function addReimbursmentYear(ReimbursmentYear $reimbursmentYear): self
  1002.     {
  1003.         if (!$this->reimbursmentYears->contains($reimbursmentYear)) {
  1004.             $this->reimbursmentYears[] = $reimbursmentYear;
  1005.             $reimbursmentYear->setUser($this);
  1006.         }
  1007.         return $this;
  1008.     }
  1009.     public function removeReimbursmentYear(ReimbursmentYear $reimbursmentYear): self
  1010.     {
  1011.         if ($this->reimbursmentYears->removeElement($reimbursmentYear)) {
  1012.             // set the owning side to null (unless already changed)
  1013.             if ($reimbursmentYear->getUser() === $this) {
  1014.                 $reimbursmentYear->setUser(null);
  1015.             }
  1016.         }
  1017.         return $this;
  1018.     }
  1019.     /**
  1020.      * @return Collection<int, Facility>
  1021.      */
  1022.     public function getAssignedFacilities(): Collection
  1023.     {
  1024.         return $this->assignedFacilities;
  1025.     }
  1026.     public function addAssignedFacility(Facility $assignedFacility): self
  1027.     {
  1028.         if (!$this->assignedFacilities->contains($assignedFacility)) {
  1029.             $this->assignedFacilities[] = $assignedFacility;
  1030.             $assignedFacility->setAssignedKam($this);
  1031.         }
  1032.         return $this;
  1033.     }
  1034.     public function removeAssignedFacility(Facility $assignedFacility): self
  1035.     {
  1036.         if ($this->assignedFacilities->removeElement($assignedFacility)) {
  1037.             // set the owning side to null (unless already changed)
  1038.             if ($assignedFacility->getAssignedKam() === $this) {
  1039.                 $assignedFacility->setAssignedKam(null);
  1040.             }
  1041.         }
  1042.         return $this;
  1043.     }
  1044.     /**
  1045.      * @return Collection<int, Offer>
  1046.      */
  1047.     public function getSentOffers(): Collection
  1048.     {
  1049.         return $this->sentOffers;
  1050.     }
  1051.     public function addSentOffer(Offer $sentOffer): self
  1052.     {
  1053.         if (!$this->sentOffers->contains($sentOffer)) {
  1054.             $this->sentOffers[] = $sentOffer;
  1055.             $sentOffer->setSender($this);
  1056.         }
  1057.         return $this;
  1058.     }
  1059.     public function removeSentOffer(Offer $sentOffer): self
  1060.     {
  1061.         if ($this->sentOffers->removeElement($sentOffer)) {
  1062.             // set the owning side to null (unless already changed)
  1063.             if ($sentOffer->getSender() === $this) {
  1064.                 $sentOffer->setSender(null);
  1065.             }
  1066.         }
  1067.         return $this;
  1068.     }
  1069.     /**
  1070.      * @return Collection<int, Offer>
  1071.      */
  1072.     public function getRefUserOffers(): Collection
  1073.     {
  1074.         return $this->refUserOffers;
  1075.     }
  1076.     public function addRefUserOffer(Offer $refUserOffer): self
  1077.     {
  1078.         if (!$this->refUserOffers->contains($refUserOffer)) {
  1079.             $this->refUserOffers[] = $refUserOffer;
  1080.             $refUserOffer->setRefUser($this);
  1081.         }
  1082.         return $this;
  1083.     }
  1084.     public function removeRefUserOffer(Offer $refUserOffer): self
  1085.     {
  1086.         if ($this->refUserOffers->removeElement($refUserOffer)) {
  1087.             // set the owning side to null (unless already changed)
  1088.             if ($refUserOffer->getRefUser() === $this) {
  1089.                 $refUserOffer->setRefUser(null);
  1090.             }
  1091.         }
  1092.         return $this;
  1093.     }
  1094.     /**
  1095.      * @return Collection<int, OfferRequest>
  1096.      */
  1097.     public function getSentOfferRequests(): Collection
  1098.     {
  1099.         return $this->sentOfferRequests;
  1100.     }
  1101.     public function addSentOfferRequest(OfferRequest $sentOfferRequest): self
  1102.     {
  1103.         if (!$this->sentOfferRequests->contains($sentOfferRequest)) {
  1104.             $this->sentOfferRequests[] = $sentOfferRequest;
  1105.             $sentOfferRequest->setSender($this);
  1106.         }
  1107.         return $this;
  1108.     }
  1109.     public function removeSentOfferRequest(OfferRequest $sentOfferRequest): self
  1110.     {
  1111.         if ($this->sentOfferRequests->removeElement($sentOfferRequest)) {
  1112.             // set the owning side to null (unless already changed)
  1113.             if ($sentOfferRequest->getSender() === $this) {
  1114.                 $sentOfferRequest->setSender(null);
  1115.             }
  1116.         }
  1117.         return $this;
  1118.     }
  1119.     /**
  1120.      * @return Collection<int, OfferRequest>
  1121.      */
  1122.     public function getRefUserOfferRequests(): Collection
  1123.     {
  1124.         return $this->refUserOfferRequests;
  1125.     }
  1126.     public function addRefUserOfferRequest(OfferRequest $refUserOfferRequest): self
  1127.     {
  1128.         if (!$this->refUserOfferRequests->contains($refUserOfferRequest)) {
  1129.             $this->refUserOfferRequests[] = $refUserOfferRequest;
  1130.             $refUserOfferRequest->setRefUser($this);
  1131.         }
  1132.         return $this;
  1133.     }
  1134.     public function removeRefUserOfferRequest(OfferRequest $refUserOfferRequest): self
  1135.     {
  1136.         if ($this->refUserOfferRequests->removeElement($refUserOfferRequest)) {
  1137.             // set the owning side to null (unless already changed)
  1138.             if ($refUserOfferRequest->getRefUser() === $this) {
  1139.                 $refUserOfferRequest->setRefUser(null);
  1140.             }
  1141.         }
  1142.         return $this;
  1143.     }
  1144.     /**
  1145.      * @return Collection<int, ActivityYear>
  1146.      */
  1147.     public function getActivityYears(): Collection
  1148.     {
  1149.         return $this->activityYears;
  1150.     }
  1151.     public function addActivityYear(ActivityYear $activityYear): self
  1152.     {
  1153.         if (!$this->activityYears->contains($activityYear)) {
  1154.             $this->activityYears[] = $activityYear;
  1155.             $activityYear->setUser($this);
  1156.         }
  1157.         return $this;
  1158.     }
  1159.     public function removeActivityYear(ActivityYear $activityYear): self
  1160.     {
  1161.         if ($this->activityYears->removeElement($activityYear)) {
  1162.             // set the owning side to null (unless already changed)
  1163.             if ($activityYear->getUser() === $this) {
  1164.                 $activityYear->setUser(null);
  1165.             }
  1166.         }
  1167.         return $this;
  1168.     }
  1169.     /**
  1170.      * @return Collection<int, Activity>
  1171.      */
  1172.     public function getActivities(): Collection
  1173.     {
  1174.         return $this->activities;
  1175.     }
  1176.     public function addActivity(Activity $activity): self
  1177.     {
  1178.         if (!$this->activities->contains($activity)) {
  1179.             $this->activities[] = $activity;
  1180.             $activity->setUser($this);
  1181.         }
  1182.         return $this;
  1183.     }
  1184.     public function removeActivity(Activity $activity): self
  1185.     {
  1186.         if ($this->activities->removeElement($activity)) {
  1187.             // set the owning side to null (unless already changed)
  1188.             if ($activity->getUser() === $this) {
  1189.                 $activity->setUser(null);
  1190.             }
  1191.         }
  1192.         return $this;
  1193.     }
  1194.     /**
  1195.      * @return Collection<int, Sell>
  1196.      */
  1197.     public function getSells(): Collection
  1198.     {
  1199.         return $this->sells;
  1200.     }
  1201.     public function addSell(Sell $sell): self
  1202.     {
  1203.         if (!$this->sells->contains($sell)) {
  1204.             $this->sells[] = $sell;
  1205.             $sell->setUser($this);
  1206.         }
  1207.         return $this;
  1208.     }
  1209.     public function removeSell(Sell $sell): self
  1210.     {
  1211.         if ($this->sells->removeElement($sell)) {
  1212.             // set the owning side to null (unless already changed)
  1213.             if ($sell->getUser() === $this) {
  1214.                 $sell->setUser(null);
  1215.             }
  1216.         }
  1217.         return $this;
  1218.     }
  1219.     /**
  1220.      * @return Collection<int, BudgetKam>
  1221.      */
  1222.     public function getBudgetKams(): Collection
  1223.     {
  1224.         return $this->budgetKams;
  1225.     }
  1226.     public function addBudgetKam(BudgetKam $budgetKam): self
  1227.     {
  1228.         if (!$this->budgetKams->contains($budgetKam)) {
  1229.             $this->budgetKams[] = $budgetKam;
  1230.             $budgetKam->setUser($this);
  1231.         }
  1232.         return $this;
  1233.     }
  1234.     public function removeBudgetKam(BudgetKam $budgetKam): self
  1235.     {
  1236.         if ($this->budgetKams->removeElement($budgetKam)) {
  1237.             // set the owning side to null (unless already changed)
  1238.             if ($budgetKam->getUser() === $this) {
  1239.                 $budgetKam->setUser(null);
  1240.             }
  1241.         }
  1242.         return $this;
  1243.     }
  1244.     /**
  1245.      * @return Collection<int, EditRequest>
  1246.      */
  1247.     public function getEditRequests(): Collection
  1248.     {
  1249.         return $this->editRequests;
  1250.     }
  1251.     public function addEditRequest(EditRequest $editRequest): self
  1252.     {
  1253.         if (!$this->editRequests->contains($editRequest)) {
  1254.             $this->editRequests[] = $editRequest;
  1255.             $editRequest->setSender($this);
  1256.         }
  1257.         return $this;
  1258.     }
  1259.     public function removeEditRequest(EditRequest $editRequest): self
  1260.     {
  1261.         if ($this->editRequests->removeElement($editRequest)) {
  1262.             // set the owning side to null (unless already changed)
  1263.             if ($editRequest->getSender() === $this) {
  1264.                 $editRequest->setSender(null);
  1265.             }
  1266.         }
  1267.         return $this;
  1268.     }
  1269.     public function getAccountType(): ?AccountType
  1270.     {
  1271.         return $this->accountType;
  1272.     }
  1273.     public function setAccountType(?AccountType $accountType): self
  1274.     {
  1275.         $this->accountType $accountType;
  1276.         return $this;
  1277.     }
  1278.     /**
  1279.      * @return Collection<int, Province>
  1280.      */
  1281.     public function getCoveredProvinces(): Collection
  1282.     {
  1283.         return $this->coveredProvinces;
  1284.     }
  1285.     public function addCoveredProvince(Province $coveredProvince): self
  1286.     {
  1287.         if (!$this->coveredProvinces->contains($coveredProvince)) {
  1288.             $this->coveredProvinces[] = $coveredProvince;
  1289.         }
  1290.         return $this;
  1291.     }
  1292.     public function removeCoveredProvince(Province $coveredProvince): self
  1293.     {
  1294.         $this->coveredProvinces->removeElement($coveredProvince);
  1295.         return $this;
  1296.     }
  1297.     /**
  1298.      * @return Collection<int, Log>
  1299.      */
  1300.     public function getLogs(): Collection
  1301.     {
  1302.         return $this->logs;
  1303.     }
  1304.     public function addLog(Log $log): self
  1305.     {
  1306.         if (!$this->logs->contains($log)) {
  1307.             $this->logs[] = $log;
  1308.             $log->setUser($this);
  1309.         }
  1310.         return $this;
  1311.     }
  1312.     public function removeLog(Log $log): self
  1313.     {
  1314.         if ($this->logs->removeElement($log)) {
  1315.             // set the owning side to null (unless already changed)
  1316.             if ($log->getUser() === $this) {
  1317.                 $log->setUser(null);
  1318.             }
  1319.         }
  1320.         return $this;
  1321.     }
  1322.     /**
  1323.      * @return Collection<int, PresenceDay>
  1324.      */
  1325.     public function getPresenceDays(): Collection
  1326.     {
  1327.         return $this->presenceDays;
  1328.     }
  1329.     public function addPresenceDay(PresenceDay $presenceDay): self
  1330.     {
  1331.         if (!$this->presenceDays->contains($presenceDay)) {
  1332.             $this->presenceDays[] = $presenceDay;
  1333.             $presenceDay->setInssertedBy($this);
  1334.         }
  1335.         return $this;
  1336.     }
  1337.     public function removePresenceDay(PresenceDay $presenceDay): self
  1338.     {
  1339.         if ($this->presenceDays->removeElement($presenceDay)) {
  1340.             // set the owning side to null (unless already changed)
  1341.             if ($presenceDay->getInssertedBy() === $this) {
  1342.                 $presenceDay->setInssertedBy(null);
  1343.             }
  1344.         }
  1345.         return $this;
  1346.     }
  1347.     public function getSupervisor(): ?self
  1348.     {
  1349.         return $this->supervisor;
  1350.     }
  1351.     public function setSupervisor(?self $supervisor): self
  1352.     {
  1353.         $this->supervisor $supervisor;
  1354.         return $this;
  1355.     }
  1356.     /**
  1357.      * @return Collection<int, User>
  1358.      */
  1359.     public function getUnderResponsibilityUsers(): Collection
  1360.     {
  1361.         return $this->underResponsibilityUsers;
  1362.     }
  1363.     public function addUnderResponsibilityUser(User $underResponsibilityUser): self
  1364.     {
  1365.         if (!$this->underResponsibilityUsers->contains($underResponsibilityUser)) {
  1366.             $this->underResponsibilityUsers->add($underResponsibilityUser);
  1367.             $underResponsibilityUser->setSupervisor($this);
  1368.         }
  1369.         return $this;
  1370.     }
  1371.     public function removeUnderResponsibilityUser(User $underResponsibilityUser): self
  1372.     {
  1373.         if ($this->underResponsibilityUsers->removeElement($underResponsibilityUser)) {
  1374.             // set the owning side to null (unless already changed)
  1375.             if ($underResponsibilityUser->getSupervisor() === $this) {
  1376.                 $underResponsibilityUser->setSupervisor(null);
  1377.             }
  1378.         }
  1379.         return $this;
  1380.     }
  1381. }