<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
use Symfony\Component\Security\Core\User\UserInterface;
/**
* @ORM\Table(name="til_user")
* @ORM\Entity(repositoryClass="App\Repository\UserRepository")
*/
class User implements UserInterface, PasswordAuthenticatedUserInterface
{
public function __toString(){
return $this->surname.' '.$this->name;
}
public function printPdfName(){
return $this->surname.' '.substr($this->name, 0, 1);
}
public function getHasProvince($facilityProvince){
if($this->getAccountType()->getSlug() == "kam"){
foreach ($this->coveredProvinces as $province){
if($province->getId() == $facilityProvince)
return true;
}
}
return false;
}
public function getSellName(){
if($this->getAccountType()->getSlug() == "kam" && $this->getName() != "Tillomed")
return $this->surname. ' ' .$this->name;
elseif($this->getAccountType()->getSlug() == "kam" && $this->getName() == "Tillomed")
return "Vacant";
else
return "Customer Service";
}
public function getIsEligible($feature){
switch($feature){
case 'alarmBtn':
if($this->getAccountType()->getSlug() == 'supervisor_enrico'
|| strpos($this->getAccountType()->getSlug(), "commercial") !== false
|| $this->getAccountType()->getSlug() == 'kam'
|| $this->getAccountType()->getSlug() == 'administration')
return true;
}
return false;
}
public function getUnreadNotifications(){
$count = 0;
foreach($this->notifications as $n){
if($n->getIsPersonal() && !$n->getIsRead())
$count++;
}
return $count;
}
public function getActualOdometer($month, $year){
foreach($this->reimbursmentYears as $ry){
if($ry->getValue() == $year){
foreach($ry->getReimbursmentMonths() as $rm){
if($rm->getValue() == $month)
return $rm->getEndMonthOdometer();
}
}
}
return 0;
}
public function getActualKmPlusMinus($month, $year){
$odometer = $this->getActualOdometer($month, $year);
foreach($this->reimbursmentYears as $ry){
foreach($ry->getReimbursmentMonths() as $rm){
return $odometer - $l->getStartKm() - ($rm->getValue()*$l->getKmMonth());
}
}
foreach($this->leasings as $l){
}
return 0;
}
public function getMonthlyEarnedHolidays($year){
if($this->employee != null)
foreach($this->employee->getWorkHolidays() as $wh){
if($wh->getYear() == $year)
return $wh->getHoliday();
}
return 0;
}
public function getMonthlyEarnedRols($year){
if($this->employee != null)
foreach($this->employee->getWorkHolidays() as $wh){
if($wh->getYear() == $year)
return $wh->getRol();
}
return 0;
}
public function getReimbursmentTypeBudget($type, $year){
foreach($this->jturt as $jt){
if($jt->getReimbursmentType()->getId() == $type && $jt->getYear() == $year && $jt->getValue() != null)
return $jt->getValue();
}
return "0.00";
}
public function getReimbursmentTypeBudgetCount($year){
$count = 0;
foreach($this->jturt as $jt){
if($jt->getYear() == $year && $jt->getValue() > 0)
$count ++;
}
return $count;
}
public function getCurrentBudgetKamPercentage($date){
$year = $date->format("Y");
if($date->format("m") < 4)
$year--;
foreach($this->budgetKams as $bk){
if($bk->getBudgetTotal()->getYear() == $year)
return $bk->getPercentage();
}
return "0";
}
public function getUnclosedPresenceMonth(){
$months = array();
foreach($this->presenceYears as $py){
foreach($py->getPresenceMonths() as $pm){
if($pm->getStatus() < 2){
array_push($months, $pm);
}
}
}
return $months;
}
public function getMonthPresenceStats($month, $year, $startDate, $endDate, $filterType){
$presence = 0;
$rol = 0;
$holiday = 0;
$transfer = 0;
$permission = 0;
$illness = 0;
$meeting = 0;
$congress = 0;
foreach($this->presenceYears as $py){
if($filterType == "progressive"){
if($month < 4 && ($py->getValue() == $year || $py->getValue() == $year - 1)){
foreach($py->getPresenceMonths() as $pm){
if(($py->getValue() == $year && $pm->getValue() <= $month) || ($py->getValue() == $year - 1 && $pm->getValue() >= 4)){
foreach($pm->getPresenceDays() as $pd){
if($pd->getJobHours() > 0)
$presence++;
$rol += $pd->getRol();
$holiday += $pd->getHoliday();
$transfer += $pd->getIsTransfer();
$permission += $pd->getPermission();
$illness += $pd->getIllness();
$meeting += $pd->getIsMeeting();
$congress += $pd->getIsCongress();
}
}
}
}
elseif($month >= 4 && $py->getValue() == $year){
foreach($py->getPresenceMonths() as $pm){
if($pm->getValue() >= 4 && $pm->getValue() <= $month){
foreach($pm->getPresenceDays() as $pd){
if($pd->getJobHours() > 0)
$presence++;
$rol += $pd->getRol();
$holiday += $pd->getHoliday();
$transfer += $pd->getIsTransfer();
$permission += $pd->getPermission();
$illness += $pd->getIllness();
$meeting += $pd->getIsMeeting();
$congress += $pd->getIsCongress();
}
}
}
}
}
elseif($filterType == "monthly"){
if($py->getValue() == $year){
foreach($py->getPresenceMonths() as $pm){
if($pm->getValue() == $month){
foreach($pm->getPresenceDays() as $pd){
if($pd->getJobHours() > 0)
$presence++;
$rol += $pd->getRol();
$holiday += $pd->getHoliday();
$transfer += $pd->getIsTransfer();
$permission += $pd->getPermission();
$illness += $pd->getIllness();
$meeting += $pd->getIsMeeting();
$congress += $pd->getIsCongress();
}
}
}
}
}
else{
if($py->getValue() >= $startDate->format("Y") and $py->getValue() <= $endDate->format("Y")){
foreach($py->getPresenceMonths() as $pm){
foreach($pm->getPresenceDays() as $pd){
if($pd->getDate()->format("Ymd") >= $startDate->format("Ymd") && $pd->getDate()->format("Ymd") <= $endDate->format("Ymd")){
if($pd->getJobHours() > 0)
$presence++;
$rol += $pd->getRol();
$holiday += $pd->getHoliday();
$transfer += $pd->getIsTransfer();
$permission += $pd->getPermission();
$illness += $pd->getIllness();
$meeting += $pd->getIsMeeting();
$congress += $pd->getIsCongress();
}
}
}
}
}
}
return array($presence, $rol, $holiday, $transfer, $permission, $illness, $meeting, $congress);
}
public function getMonthReimbursmentStats($month, $year, $filterType){
$types = array();
foreach($this->reimbursmentYears as $ry){
if($filterType == "progressive"){
if($month < 4 && ($ry->getValue() == $year || $ry->getValue() == $year - 1)){
foreach($ry->getReimbursmentMonths() as $rm){
if(($ry->getValue() == $year && $rm->getValue() <= $month) || ($ry->getValue() == $year - 1 && $rm->getValue() >= 4)){
foreach($rm->getReimbursmentDays() as $rd){
foreach($rd->getReimbursments() as $r){
$index = $r->getReimbursmentType()->getId();
if(array_key_exists($index, $types))
$types[$index] += $r->getValue();
else
$types[$index] = $r->getValue();
}
}
}
}
}
elseif($month >= 4 && $ry->getValue() == $year){
foreach($ry->getReimbursmentMonths() as $rm){
if($rm->getValue() >= 4 && $rm->getValue() <= $month){
foreach($rm->getReimbursmentDays() as $rd){
foreach($rd->getReimbursments() as $r){
$index = $r->getReimbursmentType()->getId();
if(array_key_exists($index, $types))
$types[$index] += $r->getValue();
else
$types[$index] = $r->getValue();
}
}
}
}
}
}
else{
if($ry->getValue() == $year){
foreach($ry->getReimbursmentMonths() as $rm){
if($rm->getValue() == $month){
foreach($rm->getReimbursmentDays() as $rd){
foreach($rd->getReimbursments() as $r){
$index = $r->getReimbursmentType()->getId();
if(array_key_exists($index, $types))
$types[$index] += $r->getValue();
else
$types[$index] = $r->getValue();
}
}
}
}
}
}
}
return $types;
}
/**
* @var int
*
* @ORM\Column(name="id", type="bigint", nullable=false)
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
/**
* @ORM\Column(name="email", type="string", length=191, unique=true, nullable=true)
*/
protected $email;
/**
* @ORM\Column(name="name", type="string", length=191)
*/
protected $name;
/**
* @ORM\Column(name="surname", type="string", length=191)
*/
protected $surname;
/**
* @ORM\Column(name="password", type="string", length=191, nullable=true)
*/
protected $password;
/**
* @var bool
*
* @ORM\Column(name="is_active", type="boolean", nullable=false)
*/
private $isActive = 0;
/**
* @var bool
*
* @ORM\Column(name="is_admin_active", type="boolean", nullable=false)
*/
private $isAdminActive = true;
/**
* @var string
*
* @ORM\Column(name="directory_path", type="string", length=191, length=255, nullable=false)
*/
private $directoryPath;
/**
* @var string|null
*
* @ORM\Column(name="one_time_code", type="string", length=191, length=255, nullable=true)
*/
private $oneTimeCode;
/**
* @var \DateTime|null
*
* @ORM\Column(name="expiration_one_time_code", type="date", nullable=true)
*/
private $expirationOneTimeCode;
/**
* @var bool
*
* @ORM\Column(name="is_email_notification_active", type="boolean", nullable=false)
*/
private $isEmailNotificationActive = 0;
/**
* @var string|null
*
* @ORM\Column(name="office_hours", type="text", length=0, nullable=true)
*/
private $officeHours;
/**
* @var bool
*
* @ORM\Column(name="is_alert_read", type="boolean", nullable=false)
*/
private $isAlertRead = 0;
/**
* @var bool
*
* @ORM\Column(name="is_gdpr_sent", type="boolean", nullable=false)
*/
private $isGdprSent = 0;
/**
* @ORM\Column(name="role", type="string", length=191)
*/
protected $role = "ROLE_USER";
// ONE TO ONE
/**
* @ORM\OneToOne(targetEntity="Privacy", mappedBy="user", cascade={"remove", "persist"})
*/
protected $privacy;
/**
* @ORM\OneToOne(targetEntity="Profile", mappedBy="user", cascade={"remove", "persist"})
*/
protected $profile;
/**
* @ORM\OneToOne(targetEntity="EmployeeData", mappedBy="user", cascade={"remove", "persist"})
*/
protected $employee;
//
// MANY TO ONE
/**
* @ORM\ManyToOne(targetEntity="AccountType", inversedBy="users")
* @ORM\JoinColumn(name="account_type_id", referencedColumnName="id")
*/
private $accountType;
/**
* @ORM\ManyToOne(targetEntity="User", inversedBy="underResponsibilityUsers")
* @ORM\JoinColumn(name="supervisor_id", referencedColumnName="id")
*/
private $supervisor;
//
// ONE TO MANY
/**
* @ORM\OneToMany(targetEntity="User", mappedBy="supervisor")
*/
protected $underResponsibilityUsers;
/**
* @ORM\OneToMany(targetEntity="TestCode", mappedBy="user")
*/
protected $codes;
/**
* @ORM\OneToMany(targetEntity="JoinTableUserTest", mappedBy="user")
*/
protected $tests;
/**
* @ORM\OneToMany(targetEntity="JoinTableUserReimbursmentType", mappedBy="user")
*/
private $jturt;
/**
* @ORM\OneToMany(targetEntity="Leasing", mappedBy="user")
*/
private $leasings;
/**
* @ORM\OneToMany(targetEntity="Answer", mappedBy="user")
*/
protected $answers;
/**
* @ORM\OneToMany(targetEntity="Document", mappedBy="user")
*/
protected $documents;
/**
* @ORM\OneToMany(targetEntity="Document", mappedBy="owner")
*/
protected $uploads;
/**
* @ORM\OneToMany(targetEntity="Notification", mappedBy="user")
*/
protected $notifications;
/**
* @ORM\OneToMany(targetEntity="Log", mappedBy="user")
*/
protected $logs;
/**
* @ORM\OneToMany(targetEntity="PresenceYear", mappedBy="user")
*/
protected $presenceYears;
/**
* @ORM\OneToMany(targetEntity="RequestHoliday", mappedBy="user")
*/
protected $requestHolidays;
/**
* @ORM\OneToMany(targetEntity="ReimbursmentYear", mappedBy="user")
*/
protected $reimbursmentYears;
/**
* @ORM\OneToMany(targetEntity="Facility", mappedBy="assignedKam")
*/
protected $assignedFacilities;
/**
* @ORM\OneToMany(targetEntity="Offer", mappedBy="sender")
*/
protected $sentOffers;
/**
* @ORM\OneToMany(targetEntity="Offer", mappedBy="refUser")
*/
protected $refUserOffers;
/**
* @ORM\OneToMany(targetEntity="OfferRequest", mappedBy="sender")
*/
protected $sentOfferRequests;
/**
* @ORM\OneToMany(targetEntity="OfferRequest", mappedBy="refUser")
*/
protected $refUserOfferRequests;
/**
* @ORM\OneToMany(targetEntity="ActivityYear", mappedBy="user")
*/
protected $activityYears;
/**
* @ORM\OneToMany(targetEntity="Activity", mappedBy="user")
*/
protected $activities;
/**
* @ORM\OneToMany(targetEntity="Sell", mappedBy="user")
*/
protected $sells;
/**
* @ORM\OneToMany(targetEntity="BudgetKam", mappedBy="user")
*/
protected $budgetKams;
/**
* @ORM\OneToMany(targetEntity="EditRequest", mappedBy="sender")
*/
protected $editRequests;
/**
* @ORM\OneToMany(targetEntity="PresenceDay", mappedBy="insertedBy")
*/
protected $presenceDays;
//
// MANY TO MANY
/**
* @ORM\ManyToMany(targetEntity="Province", inversedBy="kams")
* @ORM\JoinTable(name="til_join_table_user_province")
*/
private $coveredProvinces;
//
/**
* Constructor
*/
public function __construct()
{
$this->province = new \Doctrine\Common\Collections\ArrayCollection();
$this->codes = new ArrayCollection();
$this->tests = new ArrayCollection();
$this->jturt = new ArrayCollection();
$this->leasings = new ArrayCollection();
$this->answers = new ArrayCollection();
$this->documents = new ArrayCollection();
$this->uploads = new ArrayCollection();
$this->notifications = new ArrayCollection();
$this->presenceYears = new ArrayCollection();
$this->reimbursmentYears = new ArrayCollection();
$this->sentOffers = new ArrayCollection();
$this->refUserOffers = new ArrayCollection();
$this->sentOfferRequests = new ArrayCollection();
$this->refUserOfferRequests = new ArrayCollection();
$this->activityYears = new ArrayCollection();
$this->activities = new ArrayCollection();
$this->sells = new ArrayCollection();
$this->budgetKams = new ArrayCollection();
$this->assignedFacilities = new ArrayCollection();
$this->coveredProvinces = new ArrayCollection();
$this->requestHolidays = new ArrayCollection();
$this->editRequests = new ArrayCollection();
$this->logs = new ArrayCollection();
$this->presenceDays = new ArrayCollection();
$this->underResponsibilityUsers = new ArrayCollection();
}
/**
* @inheritdoc
*/
public function getRoles(): array
{
switch($this->role){
case 'ROLE_ADMIN': return array('ROLE_ADMIN');
case 'ROLE_USER': return array('ROLE_USER');
}
}
public function getSalt(): ?string
{
return null;
}
/**
* @see UserInterface
*/
public function eraseCredentials()
{
}
public function getUserIdentifier(): string
{
return (string) $this->email;
}
public function getUsername(): string
{
return null;
}
/**
* @see PasswordAuthenticatedUserInterface
*/
public function getPassword(): string
{
return $this->password;
}
public function setPassword(string $password): self
{
$this->password = $password;
return $this;
}
public function getId(): ?string
{
return $this->id;
}
public function getEmail(): ?string
{
return $this->email;
}
public function setEmail(?string $email): self
{
$this->email = $email;
return $this;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getSurname(): ?string
{
return $this->surname;
}
public function setSurname(string $surname): self
{
$this->surname = $surname;
return $this;
}
public function isIsActive(): ?bool
{
return $this->isActive;
}
public function setIsActive(bool $isActive): self
{
$this->isActive = $isActive;
return $this;
}
public function isIsAdminActive(): ?bool
{
return $this->isAdminActive;
}
public function setIsAdminActive(bool $isAdminActive): self
{
$this->isAdminActive = $isAdminActive;
return $this;
}
public function getDirectoryPath(): ?string
{
return $this->directoryPath;
}
public function setDirectoryPath(string $directoryPath): self
{
$this->directoryPath = $directoryPath;
return $this;
}
public function getOneTimeCode(): ?string
{
return $this->oneTimeCode;
}
public function setOneTimeCode(?string $oneTimeCode): self
{
$this->oneTimeCode = $oneTimeCode;
return $this;
}
public function getExpirationOneTimeCode(): ?\DateTimeInterface
{
return $this->expirationOneTimeCode;
}
public function setExpirationOneTimeCode(?\DateTimeInterface $expirationOneTimeCode): self
{
$this->expirationOneTimeCode = $expirationOneTimeCode;
return $this;
}
public function isIsEmailNotificationActive(): ?bool
{
return $this->isEmailNotificationActive;
}
public function setIsEmailNotificationActive(bool $isEmailNotificationActive): self
{
$this->isEmailNotificationActive = $isEmailNotificationActive;
return $this;
}
public function getOfficeHours(): ?string
{
return $this->officeHours;
}
public function setOfficeHours(?string $officeHours): self
{
$this->officeHours = $officeHours;
return $this;
}
public function isIsAlertRead(): ?bool
{
return $this->isAlertRead;
}
public function setIsAlertRead(bool $isAlertRead): self
{
$this->isAlertRead = $isAlertRead;
return $this;
}
public function isIsGdprSent(): ?bool
{
return $this->isGdprSent;
}
public function setIsGdprSent(bool $isGdprSent): self
{
$this->isGdprSent = $isGdprSent;
return $this;
}
public function getRole(): ?string
{
return $this->role;
}
public function setRole(string $role): self
{
$this->role = $role;
return $this;
}
public function getPrivacy(): ?Privacy
{
return $this->privacy;
}
public function setPrivacy(?Privacy $privacy): self
{
// unset the owning side of the relation if necessary
if ($privacy === null && $this->privacy !== null) {
$this->privacy->setUser(null);
}
// set the owning side of the relation if necessary
if ($privacy !== null && $privacy->getUser() !== $this) {
$privacy->setUser($this);
}
$this->privacy = $privacy;
return $this;
}
public function getProfile(): ?Profile
{
return $this->profile;
}
public function setProfile(?Profile $profile): self
{
// unset the owning side of the relation if necessary
if ($profile === null && $this->profile !== null) {
$this->profile->setUser(null);
}
// set the owning side of the relation if necessary
if ($profile !== null && $profile->getUser() !== $this) {
$profile->setUser($this);
}
$this->profile = $profile;
return $this;
}
public function getEmployee(): ?EmployeeData
{
return $this->employee;
}
public function setEmployee(?EmployeeData $employee): self
{
// unset the owning side of the relation if necessary
if ($employee === null && $this->employee !== null) {
$this->employee->setUser(null);
}
// set the owning side of the relation if necessary
if ($employee !== null && $employee->getUser() !== $this) {
$employee->setUser($this);
}
$this->employee = $employee;
return $this;
}
/**
* @return Collection<int, TestCode>
*/
public function getCodes(): Collection
{
return $this->codes;
}
public function addCode(TestCode $code): self
{
if (!$this->codes->contains($code)) {
$this->codes[] = $code;
$code->setUser($this);
}
return $this;
}
public function removeCode(TestCode $code): self
{
if ($this->codes->removeElement($code)) {
// set the owning side to null (unless already changed)
if ($code->getUser() === $this) {
$code->setUser(null);
}
}
return $this;
}
/**
* @return Collection<int, JoinTableUserTest>
*/
public function getTests(): Collection
{
return $this->tests;
}
public function addTest(JoinTableUserTest $test): self
{
if (!$this->tests->contains($test)) {
$this->tests[] = $test;
$test->setUser($this);
}
return $this;
}
public function removeTest(JoinTableUserTest $test): self
{
if ($this->tests->removeElement($test)) {
// set the owning side to null (unless already changed)
if ($test->getUser() === $this) {
$test->setUser(null);
}
}
return $this;
}
/**
* @return Collection<int, JoinTableUserReimbursmentType>
*/
public function getJturt(): Collection
{
return $this->jturt;
}
public function addJturt(JoinTableUserReimbursmentType $jturt): self
{
if (!$this->jturt->contains($jturt)) {
$this->jturt[] = $jturt;
$jturt->setUser($this);
}
return $this;
}
public function removeJturt(JoinTableUserReimbursmentType $jturt): self
{
if ($this->jturt->removeElement($jturt)) {
// set the owning side to null (unless already changed)
if ($jturt->getUser() === $this) {
$jturt->setUser(null);
}
}
return $this;
}
/**
* @return Collection<int, Leasing>
*/
public function getLeasings(): Collection
{
return $this->leasings;
}
public function addLeasing(Leasing $leasing): self
{
if (!$this->leasings->contains($leasing)) {
$this->leasings[] = $leasing;
$leasing->setUser($this);
}
return $this;
}
public function removeLeasing(Leasing $leasing): self
{
if ($this->leasings->removeElement($leasing)) {
// set the owning side to null (unless already changed)
if ($leasing->getUser() === $this) {
$leasing->setUser(null);
}
}
return $this;
}
/**
* @return Collection<int, Answer>
*/
public function getAnswers(): Collection
{
return $this->answers;
}
public function addAnswer(Answer $answer): self
{
if (!$this->answers->contains($answer)) {
$this->answers[] = $answer;
$answer->setUser($this);
}
return $this;
}
public function removeAnswer(Answer $answer): self
{
if ($this->answers->removeElement($answer)) {
// set the owning side to null (unless already changed)
if ($answer->getUser() === $this) {
$answer->setUser(null);
}
}
return $this;
}
/**
* @return Collection<int, Document>
*/
public function getDocuments(): Collection
{
return $this->documents;
}
public function addDocument(Document $document): self
{
if (!$this->documents->contains($document)) {
$this->documents[] = $document;
$document->setUser($this);
}
return $this;
}
public function removeDocument(Document $document): self
{
if ($this->documents->removeElement($document)) {
// set the owning side to null (unless already changed)
if ($document->getUser() === $this) {
$document->setUser(null);
}
}
return $this;
}
/**
* @return Collection<int, Document>
*/
public function getUploads(): Collection
{
return $this->uploads;
}
public function addUpload(Document $upload): self
{
if (!$this->uploads->contains($upload)) {
$this->uploads[] = $upload;
$upload->setOwner($this);
}
return $this;
}
public function removeUpload(Document $upload): self
{
if ($this->uploads->removeElement($upload)) {
// set the owning side to null (unless already changed)
if ($upload->getOwner() === $this) {
$upload->setOwner(null);
}
}
return $this;
}
/**
* @return Collection<int, Notification>
*/
public function getNotifications(): Collection
{
return $this->notifications;
}
public function addNotification(Notification $notification): self
{
if (!$this->notifications->contains($notification)) {
$this->notifications[] = $notification;
$notification->setUser($this);
}
return $this;
}
public function removeNotification(Notification $notification): self
{
if ($this->notifications->removeElement($notification)) {
// set the owning side to null (unless already changed)
if ($notification->getUser() === $this) {
$notification->setUser(null);
}
}
return $this;
}
/**
* @return Collection<int, PresenceYear>
*/
public function getPresenceYears(): Collection
{
return $this->presenceYears;
}
public function addPresenceYear(PresenceYear $presenceYear): self
{
if (!$this->presenceYears->contains($presenceYear)) {
$this->presenceYears[] = $presenceYear;
$presenceYear->setUser($this);
}
return $this;
}
public function removePresenceYear(PresenceYear $presenceYear): self
{
if ($this->presenceYears->removeElement($presenceYear)) {
// set the owning side to null (unless already changed)
if ($presenceYear->getUser() === $this) {
$presenceYear->setUser(null);
}
}
return $this;
}
/**
* @return Collection<int, RequestHoliday>
*/
public function getRequestHolidays(): Collection
{
return $this->requestHolidays;
}
public function addRequestHoliday(RequestHoliday $requestHoliday): self
{
if (!$this->requestHolidays->contains($requestHoliday)) {
$this->requestHolidays[] = $requestHoliday;
$requestHoliday->setUser($this);
}
return $this;
}
public function removeRequestHoliday(RequestHoliday $requestHoliday): self
{
if ($this->requestHolidays->removeElement($requestHoliday)) {
// set the owning side to null (unless already changed)
if ($requestHoliday->getUser() === $this) {
$requestHoliday->setUser(null);
}
}
return $this;
}
/**
* @return Collection<int, ReimbursmentYear>
*/
public function getReimbursmentYears(): Collection
{
return $this->reimbursmentYears;
}
public function addReimbursmentYear(ReimbursmentYear $reimbursmentYear): self
{
if (!$this->reimbursmentYears->contains($reimbursmentYear)) {
$this->reimbursmentYears[] = $reimbursmentYear;
$reimbursmentYear->setUser($this);
}
return $this;
}
public function removeReimbursmentYear(ReimbursmentYear $reimbursmentYear): self
{
if ($this->reimbursmentYears->removeElement($reimbursmentYear)) {
// set the owning side to null (unless already changed)
if ($reimbursmentYear->getUser() === $this) {
$reimbursmentYear->setUser(null);
}
}
return $this;
}
/**
* @return Collection<int, Facility>
*/
public function getAssignedFacilities(): Collection
{
return $this->assignedFacilities;
}
public function addAssignedFacility(Facility $assignedFacility): self
{
if (!$this->assignedFacilities->contains($assignedFacility)) {
$this->assignedFacilities[] = $assignedFacility;
$assignedFacility->setAssignedKam($this);
}
return $this;
}
public function removeAssignedFacility(Facility $assignedFacility): self
{
if ($this->assignedFacilities->removeElement($assignedFacility)) {
// set the owning side to null (unless already changed)
if ($assignedFacility->getAssignedKam() === $this) {
$assignedFacility->setAssignedKam(null);
}
}
return $this;
}
/**
* @return Collection<int, Offer>
*/
public function getSentOffers(): Collection
{
return $this->sentOffers;
}
public function addSentOffer(Offer $sentOffer): self
{
if (!$this->sentOffers->contains($sentOffer)) {
$this->sentOffers[] = $sentOffer;
$sentOffer->setSender($this);
}
return $this;
}
public function removeSentOffer(Offer $sentOffer): self
{
if ($this->sentOffers->removeElement($sentOffer)) {
// set the owning side to null (unless already changed)
if ($sentOffer->getSender() === $this) {
$sentOffer->setSender(null);
}
}
return $this;
}
/**
* @return Collection<int, Offer>
*/
public function getRefUserOffers(): Collection
{
return $this->refUserOffers;
}
public function addRefUserOffer(Offer $refUserOffer): self
{
if (!$this->refUserOffers->contains($refUserOffer)) {
$this->refUserOffers[] = $refUserOffer;
$refUserOffer->setRefUser($this);
}
return $this;
}
public function removeRefUserOffer(Offer $refUserOffer): self
{
if ($this->refUserOffers->removeElement($refUserOffer)) {
// set the owning side to null (unless already changed)
if ($refUserOffer->getRefUser() === $this) {
$refUserOffer->setRefUser(null);
}
}
return $this;
}
/**
* @return Collection<int, OfferRequest>
*/
public function getSentOfferRequests(): Collection
{
return $this->sentOfferRequests;
}
public function addSentOfferRequest(OfferRequest $sentOfferRequest): self
{
if (!$this->sentOfferRequests->contains($sentOfferRequest)) {
$this->sentOfferRequests[] = $sentOfferRequest;
$sentOfferRequest->setSender($this);
}
return $this;
}
public function removeSentOfferRequest(OfferRequest $sentOfferRequest): self
{
if ($this->sentOfferRequests->removeElement($sentOfferRequest)) {
// set the owning side to null (unless already changed)
if ($sentOfferRequest->getSender() === $this) {
$sentOfferRequest->setSender(null);
}
}
return $this;
}
/**
* @return Collection<int, OfferRequest>
*/
public function getRefUserOfferRequests(): Collection
{
return $this->refUserOfferRequests;
}
public function addRefUserOfferRequest(OfferRequest $refUserOfferRequest): self
{
if (!$this->refUserOfferRequests->contains($refUserOfferRequest)) {
$this->refUserOfferRequests[] = $refUserOfferRequest;
$refUserOfferRequest->setRefUser($this);
}
return $this;
}
public function removeRefUserOfferRequest(OfferRequest $refUserOfferRequest): self
{
if ($this->refUserOfferRequests->removeElement($refUserOfferRequest)) {
// set the owning side to null (unless already changed)
if ($refUserOfferRequest->getRefUser() === $this) {
$refUserOfferRequest->setRefUser(null);
}
}
return $this;
}
/**
* @return Collection<int, ActivityYear>
*/
public function getActivityYears(): Collection
{
return $this->activityYears;
}
public function addActivityYear(ActivityYear $activityYear): self
{
if (!$this->activityYears->contains($activityYear)) {
$this->activityYears[] = $activityYear;
$activityYear->setUser($this);
}
return $this;
}
public function removeActivityYear(ActivityYear $activityYear): self
{
if ($this->activityYears->removeElement($activityYear)) {
// set the owning side to null (unless already changed)
if ($activityYear->getUser() === $this) {
$activityYear->setUser(null);
}
}
return $this;
}
/**
* @return Collection<int, Activity>
*/
public function getActivities(): Collection
{
return $this->activities;
}
public function addActivity(Activity $activity): self
{
if (!$this->activities->contains($activity)) {
$this->activities[] = $activity;
$activity->setUser($this);
}
return $this;
}
public function removeActivity(Activity $activity): self
{
if ($this->activities->removeElement($activity)) {
// set the owning side to null (unless already changed)
if ($activity->getUser() === $this) {
$activity->setUser(null);
}
}
return $this;
}
/**
* @return Collection<int, Sell>
*/
public function getSells(): Collection
{
return $this->sells;
}
public function addSell(Sell $sell): self
{
if (!$this->sells->contains($sell)) {
$this->sells[] = $sell;
$sell->setUser($this);
}
return $this;
}
public function removeSell(Sell $sell): self
{
if ($this->sells->removeElement($sell)) {
// set the owning side to null (unless already changed)
if ($sell->getUser() === $this) {
$sell->setUser(null);
}
}
return $this;
}
/**
* @return Collection<int, BudgetKam>
*/
public function getBudgetKams(): Collection
{
return $this->budgetKams;
}
public function addBudgetKam(BudgetKam $budgetKam): self
{
if (!$this->budgetKams->contains($budgetKam)) {
$this->budgetKams[] = $budgetKam;
$budgetKam->setUser($this);
}
return $this;
}
public function removeBudgetKam(BudgetKam $budgetKam): self
{
if ($this->budgetKams->removeElement($budgetKam)) {
// set the owning side to null (unless already changed)
if ($budgetKam->getUser() === $this) {
$budgetKam->setUser(null);
}
}
return $this;
}
/**
* @return Collection<int, EditRequest>
*/
public function getEditRequests(): Collection
{
return $this->editRequests;
}
public function addEditRequest(EditRequest $editRequest): self
{
if (!$this->editRequests->contains($editRequest)) {
$this->editRequests[] = $editRequest;
$editRequest->setSender($this);
}
return $this;
}
public function removeEditRequest(EditRequest $editRequest): self
{
if ($this->editRequests->removeElement($editRequest)) {
// set the owning side to null (unless already changed)
if ($editRequest->getSender() === $this) {
$editRequest->setSender(null);
}
}
return $this;
}
public function getAccountType(): ?AccountType
{
return $this->accountType;
}
public function setAccountType(?AccountType $accountType): self
{
$this->accountType = $accountType;
return $this;
}
/**
* @return Collection<int, Province>
*/
public function getCoveredProvinces(): Collection
{
return $this->coveredProvinces;
}
public function addCoveredProvince(Province $coveredProvince): self
{
if (!$this->coveredProvinces->contains($coveredProvince)) {
$this->coveredProvinces[] = $coveredProvince;
}
return $this;
}
public function removeCoveredProvince(Province $coveredProvince): self
{
$this->coveredProvinces->removeElement($coveredProvince);
return $this;
}
/**
* @return Collection<int, Log>
*/
public function getLogs(): Collection
{
return $this->logs;
}
public function addLog(Log $log): self
{
if (!$this->logs->contains($log)) {
$this->logs[] = $log;
$log->setUser($this);
}
return $this;
}
public function removeLog(Log $log): self
{
if ($this->logs->removeElement($log)) {
// set the owning side to null (unless already changed)
if ($log->getUser() === $this) {
$log->setUser(null);
}
}
return $this;
}
/**
* @return Collection<int, PresenceDay>
*/
public function getPresenceDays(): Collection
{
return $this->presenceDays;
}
public function addPresenceDay(PresenceDay $presenceDay): self
{
if (!$this->presenceDays->contains($presenceDay)) {
$this->presenceDays[] = $presenceDay;
$presenceDay->setInssertedBy($this);
}
return $this;
}
public function removePresenceDay(PresenceDay $presenceDay): self
{
if ($this->presenceDays->removeElement($presenceDay)) {
// set the owning side to null (unless already changed)
if ($presenceDay->getInssertedBy() === $this) {
$presenceDay->setInssertedBy(null);
}
}
return $this;
}
public function getSupervisor(): ?self
{
return $this->supervisor;
}
public function setSupervisor(?self $supervisor): self
{
$this->supervisor = $supervisor;
return $this;
}
/**
* @return Collection<int, User>
*/
public function getUnderResponsibilityUsers(): Collection
{
return $this->underResponsibilityUsers;
}
public function addUnderResponsibilityUser(User $underResponsibilityUser): self
{
if (!$this->underResponsibilityUsers->contains($underResponsibilityUser)) {
$this->underResponsibilityUsers->add($underResponsibilityUser);
$underResponsibilityUser->setSupervisor($this);
}
return $this;
}
public function removeUnderResponsibilityUser(User $underResponsibilityUser): self
{
if ($this->underResponsibilityUsers->removeElement($underResponsibilityUser)) {
// set the owning side to null (unless already changed)
if ($underResponsibilityUser->getSupervisor() === $this) {
$underResponsibilityUser->setSupervisor(null);
}
}
return $this;
}
}