src/Entity/User.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Traits\DefaultTrait;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\Persistence\Event\LifecycleEventArgs;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Symfony\Component\String\ByteString;
  9. /**
  10.  * @ORM\HasLifecycleCallbacks()
  11.  * @ORM\Entity(repositoryClass="App\Repository\UserRepository")
  12.  */
  13. class User
  14. {
  15.     use DefaultTrait;
  16.     public const GENDER_NONE 0;
  17.     public const GENDER_BINARY 1;
  18.     public const GENDER_MALE 2;
  19.     public const GENDER_FEMALE 3;
  20.     public const GENDER = [
  21.         'NONE' => self::GENDER_NONE,
  22.         'BINARY' => self::GENDER_BINARY,
  23.         'MALE' => self::GENDER_MALE,
  24.         'FEMALE' => self::GENDER_FEMALE
  25.     ];
  26.     public const STATUS_UNPUBLISHED 0;
  27.     public const STATUS_PUBLISHED 1;
  28.     public const STATUS_PENDING 2;
  29.     public const STATUS = [
  30.         'UNPUBLISHED' => self::STATUS_UNPUBLISHED,
  31.         'PUBLISHED' => self::STATUS_PUBLISHED,
  32.         'PENDING' => self::STATUS_PENDING
  33.     ];
  34.     /**
  35.      * @ORM\Id
  36.      * @ORM\GeneratedValue
  37.      * @ORM\Column(type="integer")
  38.      */
  39.     private int $id;
  40.     /**
  41.      * @ORM\ManyToOne(targetEntity="App\Entity\Headquarter", inversedBy="users")
  42.      * @ORM\JoinColumn(nullable=false)
  43.      */
  44.     private Headquarter $headquarter;
  45.     /**
  46.      * @ORM\ManyToOne(targetEntity="App\Entity\Language")
  47.      * @ORM\JoinColumn(nullable=false)
  48.      */
  49.     private Language $preferred_language;
  50.     /**
  51.      * @ORM\ManyToOne(targetEntity="App\Entity\Role", inversedBy="users")
  52.      * @ORM\JoinColumn(nullable=false)
  53.      */
  54.     private Role $role;
  55.     /**
  56.      * @ORM\ManyToOne(targetEntity="App\Entity\Category", inversedBy="users")
  57.      * @ORM\JoinColumn(nullable=false)
  58.      */
  59.     private Category $category;
  60.     /**
  61.      * @ORM\Column(type="integer", nullable=true)
  62.      */
  63.     private ?int $type null;
  64.     /**
  65.      * @ORM\Column(type="string", length=255)
  66.      */
  67.     private string $email;
  68.     /**
  69.      * @ORM\Column(type="string", length=255)
  70.      */
  71.     private string $password;
  72.     /**
  73.      * @ORM\Column(type="string", length=255)
  74.      */
  75.     private string $name;
  76.     /**
  77.      * @ORM\Column(type="string", length=255)
  78.      */
  79.     private string $surname;
  80.     /**
  81.      * @ORM\Column(type="integer")
  82.      */
  83.     private int $gender self::GENDER_NONE;
  84.     /**
  85.      * @ORM\Column(type="string", length=255, nullable=true)
  86.      */
  87.     private ?string $entity null;
  88.     /**
  89.      * @ORM\Column(type="string", length=255, nullable=true)
  90.      */
  91.     private ?string $avatar null;
  92.     /**
  93.      * @ORM\Column(type="string", length=255, nullable=true)
  94.      */
  95.     private ?string $cover null;
  96.     /**
  97.      * @ORM\Column(type="string", length=255, nullable=true)
  98.      */
  99.     private ?string $code_alpha null;
  100.     /**
  101.      * @ORM\Column(type="string", length=255, nullable=true)
  102.      */
  103.     private ?string $document_type null;
  104.     /**
  105.      * @ORM\Column(type="string", length=255, nullable=true)
  106.      */
  107.     private ?string $document_number null;
  108.     /**
  109.      * @ORM\Column(type="string", length=255, nullable=true)
  110.      */
  111.     private ?string $address null;
  112.     /**
  113.      * @ORM\Column(type="string", length=255, nullable=true)
  114.      */
  115.     private ?string $city null;
  116.     /**
  117.      * @ORM\Column(type="string", length=255, nullable=true)
  118.      */
  119.     private ?string $postal null;
  120.     /**
  121.      * @ORM\Column(type="string", length=255, nullable=true)
  122.      */
  123.     private ?string $region null;
  124.     /**
  125.      * @ORM\Column(type="string", length=255, nullable=true)
  126.      */
  127.     private ?string $country null;
  128.     /**
  129.      * @ORM\Column(type="string", length=255, nullable=true)
  130.      */
  131.     private ?string $phone null;
  132.     /**
  133.      * @ORM\Column(type="string", length=255, nullable=true)
  134.      */
  135.     private ?string $current_position null;
  136.     /**
  137.      * @ORM\Column(type="date", nullable=true)
  138.      */
  139.     private ?\DateTime $birthdate null;
  140.     /**
  141.      * @ORM\Column(type="text", nullable=true)
  142.      */
  143.     private ?string $about_me null;
  144.     /**
  145.      * @ORM\Column(type="integer")
  146.      */
  147.     private int $num_total_holidays 0;
  148.     /**
  149.      * @ORM\Column(type="datetime", nullable=true)
  150.      */
  151.     private ?\DateTime $tos_accepted null;
  152.     /**
  153.      * @ORM\Column(type="boolean")
  154.      */
  155.     private bool $is_enabled_newsletter true;
  156.     /**
  157.      * @ORM\Column(type="boolean")
  158.      */
  159.     private bool $is_enabled_push true;
  160.     /**
  161.      * @ORM\Column(type="boolean")
  162.      */
  163.     private bool $is_enabled_email true;
  164.     /**
  165.      * @ORM\Column(type="datetime", nullable=true)
  166.      */
  167.     private ?\DateTime $last_visit_date null;
  168.     /**
  169.      * @ORM\Column(type="float", scale="2")
  170.      */
  171.     private float $daily_hours_monday 0;
  172.     /**
  173.      * @ORM\Column(type="float", scale="2")
  174.      */
  175.     private float $daily_hours_tuesday 0;
  176.     /**
  177.      * @ORM\Column(type="float", scale="2")
  178.      */
  179.     private float $daily_hours_wednesday 0;
  180.     /**
  181.      * @ORM\Column(type="float", scale="2")
  182.      */
  183.     private float $daily_hours_thursday 0;
  184.     /**
  185.      * @ORM\Column(type="float", scale="2")
  186.      */
  187.     private float $daily_hours_friday 0;
  188.     /**
  189.      * @ORM\Column(type="float", scale="2")
  190.      */
  191.     private float $daily_hours_saturday 0;
  192.     /**
  193.      * @ORM\Column(type="float", scale="2")
  194.      */
  195.     private float $daily_hours_sunday 0;
  196.     /**
  197.      * @var ArrayCollection|UserDevice[]
  198.      *
  199.      * @ORM\OneToMany(targetEntity="App\Entity\UserDevice", mappedBy="user", cascade={"persist", "remove"})
  200.      */
  201.     private $devices;
  202.     /**
  203.      * @var ArrayCollection|UserHoliday[]
  204.      *
  205.      * @ORM\OneToMany(targetEntity="App\Entity\UserHoliday", mappedBy="user", cascade={"persist", "remove"})
  206.      */
  207.     private $holidays;
  208.     /**
  209.      * @var ArrayCollection|UserRecovery[]
  210.      *
  211.      * @ORM\OneToMany(targetEntity="App\Entity\UserRecovery", mappedBy="user", cascade={"persist", "remove"})
  212.      */
  213.     private $recoveries;
  214.     /**
  215.      * @var ArrayCollection|UserTimesheet[]
  216.      *
  217.      * @ORM\OneToMany(targetEntity="App\Entity\UserTimesheet", mappedBy="user", cascade={"persist", "remove"})
  218.      */
  219.     private $timesheets;
  220.     /**
  221.      * @var ArrayCollection|UserSchedule[]
  222.      *
  223.      * @ORM\OneToMany(targetEntity="App\Entity\UserSchedule", mappedBy="user", cascade={"persist", "remove"})
  224.      */
  225.     private $schedules;
  226.     /**
  227.      * @var ArrayCollection|SurveyUserAnswer[]
  228.      *
  229.      * @ORM\OneToMany(targetEntity="App\Entity\SurveyUserAnswer", mappedBy="user", cascade={"persist", "remove"})
  230.      * @ORM\OrderBy({"cdate" = "DESC"})
  231.      */
  232.     private $surveys;
  233.     /**
  234.      * @var ArrayCollection|QuizzUserAnswer[]
  235.      *
  236.      * @ORM\OneToMany(targetEntity="App\Entity\QuizzUserAnswer", mappedBy="user", cascade={"persist", "remove"})
  237.      * @ORM\OrderBy({"cdate" = "DESC"})
  238.      */
  239.     private $quizzes;
  240.     /**
  241.      * @var ArrayCollection|Tag[]
  242.      *
  243.      * @ORM\ManyToMany(targetEntity="App\Entity\Tag", inversedBy="users")
  244.      * @ORM\JoinTable(name="user_tag")
  245.      */
  246.     private $tags;
  247.     /**
  248.      * @var ArrayCollection|Audience[]
  249.      *
  250.      * @ORM\ManyToMany(targetEntity="App\Entity\Audience", mappedBy="users")
  251.      */
  252.     private $audiences;
  253.     /**
  254.      * @var ArrayCollection|Audience[]
  255.      *
  256.      * @ORM\ManyToMany(targetEntity="App\Entity\Audience", mappedBy="filter_users")
  257.      */
  258.     private $filter_audiences;
  259.     /**
  260.      * @var ArrayCollection|Article[]
  261.      *
  262.      * @ORM\ManyToMany(targetEntity="App\Entity\Article", mappedBy="users_assigned")
  263.      */
  264.     private $articles_assigned;
  265.     /**
  266.      * @var ArrayCollection|Email[]
  267.      *
  268.      * @ORM\ManyToMany(targetEntity="App\Entity\Email", mappedBy="users_assigned")
  269.      */
  270.     private $emails_assigned;
  271.     /**
  272.      * @var ArrayCollection|Notification[]
  273.      *
  274.      * @ORM\ManyToMany(targetEntity="App\Entity\Notification", mappedBy="users_assigned")
  275.      */
  276.     private $notifications_assigned;
  277.     /**
  278.      * @var ArrayCollection|Reservation[]
  279.      *
  280.      * @ORM\ManyToMany(targetEntity="App\Entity\Reservation", mappedBy="users_assigned")
  281.      */
  282.     private $reservations_assigned;
  283.     /**
  284.      * @var ArrayCollection|UserNotification[]
  285.      *
  286.      * @ORM\OneToMany(targetEntity="App\Entity\UserNotification", mappedBy="user", cascade={"persist", "remove"})
  287.      */
  288.     private $notifications;
  289.     /**
  290.      * @var ArrayCollection|Survey[]
  291.      *
  292.      * @ORM\ManyToMany(targetEntity="App\Entity\Survey", mappedBy="users_assigned")
  293.      */
  294.     private $surveys_assigned;
  295.     /**
  296.      * @var ArrayCollection|WorkgroupUserSubscribed[]
  297.      *
  298.      * @ORM\OneToMany(targetEntity="App\Entity\WorkgroupUserSubscribed", mappedBy="user", cascade={"persist", "remove"})
  299.      */
  300.     private $workgroups_subscribed;
  301.     /**
  302.      * @var ArrayCollection|WorkgroupComment[]
  303.      *
  304.      * @ORM\ManyToMany(targetEntity="App\Entity\WorkgroupComment", mappedBy="likes")
  305.      */
  306.     private $workgroup_comment_likes;
  307.     /**
  308.      * @var ArrayCollection|Article[]
  309.      *
  310.      * @ORM\ManyToMany(targetEntity="App\Entity\Article", mappedBy="users_subscribed")
  311.      */
  312.     private $articles_subscribed;
  313.     /**
  314.      * @var ArrayCollection|UserReservation[]
  315.      *
  316.      * @ORM\OneToMany(targetEntity="App\Entity\UserReservation", mappedBy="user", cascade={"persist", "remove"})
  317.      */
  318.     private $reservations;
  319.     /**
  320.      * @var ArrayCollection|Category[]
  321.      *
  322.      * @ORM\OneToMany(targetEntity="App\Entity\Category", mappedBy="head_holidays")
  323.      */
  324.     private $categories_head_holidays;
  325.     /**
  326.      * @var ArrayCollection|Category[]
  327.      *
  328.      * @ORM\OneToMany(targetEntity="App\Entity\Category", mappedBy="head_timesheets")
  329.      */
  330.     private $categories_head_timesheets;
  331.     /**
  332.      * @var User
  333.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="users_head_holidays")
  334.      * @ORM\JoinColumn(onDelete="SET NULL")
  335.      */
  336.     private $head_holidays;
  337.     /**
  338.      * @var ArrayCollection|User[]
  339.      * @ORM\OneToMany(targetEntity=User::class, mappedBy="head_holidays")
  340.      */
  341.     private $users_head_holidays;
  342.     /**
  343.      * @var User
  344.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="users_head_timesheets")
  345.      * @ORM\JoinColumn(onDelete="SET NULL")
  346.      */
  347.     private $head_timesheets;
  348.     /**
  349.      * @var ArrayCollection|User[]
  350.      * @ORM\OneToMany(targetEntity=User::class, mappedBy="head_timesheets")
  351.      */
  352.     private $users_head_timesheets;
  353.     /**
  354.      * @var Workplace
  355.      * @ORM\ManyToOne(targetEntity=Workplace::class, inversedBy="users")
  356.      */
  357.     private $workplace;
  358.     /**
  359.      * @var float
  360.      * @ORM\Column(type="float", nullable=true)
  361.      */
  362.     private $daily_hours;
  363.     /**
  364.      * @var ArrayCollection|ArticleUserView[]
  365.      *
  366.      * @ORM\OneToMany(targetEntity=ArticleUserView::class, mappedBy="user")
  367.      */
  368.     private $articleUserViews;
  369.     /**
  370.      * @var ArrayCollection|WorkgroupUserView[]
  371.      *
  372.      * @ORM\OneToMany(targetEntity=WorkgroupUserView::class, mappedBy="user")
  373.      */
  374.     private $workgroupUserViews;
  375.     /**
  376.      * @var ArrayCollection|DocumentFileView[]
  377.      *
  378.      * @ORM\OneToMany(targetEntity=DocumentFileView::class, mappedBy="user")
  379.      */
  380.     private $documentFileViews;
  381.     /**
  382.      * @ORM\OneToMany(targetEntity=Fingerprint::class, mappedBy="user", orphanRemoval=true)
  383.      */
  384.     private $fingerprints;
  385.     public function __construct(Headquarter $headquarter)
  386.     {
  387.         $this->headquarter $headquarter;
  388.         $this->preferred_language $headquarter->getPreferredLanguage();
  389.         $this->setPassword(ByteString::fromRandom(4)->upper());
  390.         $this->status self::STATUS_PUBLISHED;
  391.         $this->devices = new ArrayCollection();
  392.         $this->recoveries = new ArrayCollection();
  393.         $this->timesheets = new ArrayCollection();
  394.         $this->surveys = new ArrayCollection();
  395.         $this->tags = new ArrayCollection();
  396.         $this->audiences = new ArrayCollection();
  397.         $this->filter_audiences = new ArrayCollection();
  398.         $this->articles_assigned = new ArrayCollection();
  399.         $this->emails_assigned = new ArrayCollection();
  400.         $this->notifications_assigned = new ArrayCollection();
  401.         $this->reservations_assigned = new ArrayCollection();
  402.         $this->notifications = new ArrayCollection();
  403.         $this->surveys_assigned = new ArrayCollection();
  404.         $this->workgroups_subscribed = new ArrayCollection();
  405.         $this->workgroup_comment_likes = new ArrayCollection();
  406.         $this->articles_subscribed = new ArrayCollection();
  407.         $this->reservations = new ArrayCollection();
  408.         $this->holidays = new ArrayCollection();
  409.         $this->categories_head_holidays = new ArrayCollection();
  410.         $this->categories_head_timesheets = new ArrayCollection();
  411.         $this->users_head_holidays = new ArrayCollection();
  412.         $this->users_head_timesheets = new ArrayCollection();
  413.         $this->articleUserViews = new ArrayCollection();
  414.         $this->workgroupUserViews = new ArrayCollection();
  415.         $this->quizzes = new ArrayCollection();
  416.         $this->documentFileViews = new ArrayCollection();
  417.         $this->schedules = new ArrayCollection();
  418.         $this->fingerprints = new ArrayCollection();
  419.     }
  420.     /**
  421.      * @internal Added function
  422.      */
  423.     public function getFullname(): ?string
  424.     {
  425.         return sprintf('%s %s'$this->name$this->surname);
  426.     }
  427.     /**
  428.      * @return false|string
  429.      * @internal Added function
  430.      *
  431.      */
  432.     public function getGenderToString()
  433.     {
  434.         return array_search($this->genderself::GENDER);
  435.     }
  436.     /**
  437.      * @internal Added function
  438.      */
  439.     public function setGenderFromString(string $gender): self
  440.     {
  441.         $this->gender self::GENDER[$gender];
  442.         return $this;
  443.     }
  444.     /**
  445.      * @internal Added function
  446.      */
  447.     public function getIsTosAccepted(): bool
  448.     {
  449.         return $this->tos_accepted !== null;
  450.     }
  451.     /*
  452.      * @internal Added function
  453.      *
  454.     public function setPasswordBcrypt(string $bcrypt): self
  455.     {
  456.         $this->password = $bcrypt;
  457.         return $this;
  458.     }
  459.     */
  460.     /**
  461.      * @internal Updated function
  462.      */
  463.     public function setPassword(string $password): self
  464.     {
  465.         $this->password = (string)password_hash($passwordPASSWORD_BCRYPT);
  466.         return $this;
  467.     }
  468.     public function getId(): ?int
  469.     {
  470.         return $this->id;
  471.     }
  472.     public function getEmail(): ?string
  473.     {
  474.         return $this->email;
  475.     }
  476.     public function setEmail(string $email): self
  477.     {
  478.         $this->email $email;
  479.         return $this;
  480.     }
  481.     public function getPassword(): ?string
  482.     {
  483.         return $this->password;
  484.     }
  485.     public function getType(): ?int
  486.     {
  487.         return $this->type;
  488.     }
  489.     public function setType(?int $type): self
  490.     {
  491.         $this->type $type;
  492.         return $this;
  493.     }
  494.     public function getName(): ?string
  495.     {
  496.         return $this->name;
  497.     }
  498.     public function setName(string $name): self
  499.     {
  500.         $this->name $name;
  501.         return $this;
  502.     }
  503.     public function getSurname(): ?string
  504.     {
  505.         return $this->surname;
  506.     }
  507.     public function setSurname(string $surname): self
  508.     {
  509.         $this->surname $surname;
  510.         return $this;
  511.     }
  512.     public function getGender(): ?int
  513.     {
  514.         return $this->gender;
  515.     }
  516.     public function setGender(int $gender): self
  517.     {
  518.         $this->gender $gender;
  519.         return $this;
  520.     }
  521.     public function getAvatar(): ?string
  522.     {
  523.         return $this->avatar;
  524.     }
  525.     public function setAvatar(?string $avatar): self
  526.     {
  527.         $this->avatar $avatar;
  528.         return $this;
  529.     }
  530.     public function getCover(): ?string
  531.     {
  532.         return $this->cover;
  533.     }
  534.     public function setCover(?string $cover): self
  535.     {
  536.         $this->cover $cover;
  537.         return $this;
  538.     }
  539.     public function getCodeAlpha(): ?string
  540.     {
  541.         return $this->code_alpha;
  542.     }
  543.     public function setCodeAlpha(?string $code_alpha): self
  544.     {
  545.         $this->code_alpha $code_alpha;
  546.         return $this;
  547.     }
  548.     public function getDocumentType(): ?string
  549.     {
  550.         return $this->document_type;
  551.     }
  552.     public function setDocumentType(?string $document_type): self
  553.     {
  554.         $this->document_type $document_type;
  555.         return $this;
  556.     }
  557.     public function getDocumentNumber(): ?string
  558.     {
  559.         return $this->document_number;
  560.     }
  561.     public function setDocumentNumber(?string $document_number): self
  562.     {
  563.         $this->document_number $document_number;
  564.         return $this;
  565.     }
  566.     public function getAddress(): ?string
  567.     {
  568.         return $this->address;
  569.     }
  570.     public function setAddress(?string $address): self
  571.     {
  572.         $this->address $address;
  573.         return $this;
  574.     }
  575.     public function getCity(): ?string
  576.     {
  577.         return $this->city;
  578.     }
  579.     public function setCity(?string $city): self
  580.     {
  581.         $this->city $city;
  582.         return $this;
  583.     }
  584.     public function getPostal(): ?string
  585.     {
  586.         return $this->postal;
  587.     }
  588.     public function setPostal(?string $postal): self
  589.     {
  590.         $this->postal $postal;
  591.         return $this;
  592.     }
  593.     public function getRegion(): ?string
  594.     {
  595.         return $this->region;
  596.     }
  597.     public function setRegion(?string $region): self
  598.     {
  599.         $this->region $region;
  600.         return $this;
  601.     }
  602.     public function getCountry(): ?string
  603.     {
  604.         return $this->country;
  605.     }
  606.     public function setCountry(?string $country): self
  607.     {
  608.         $this->country $country;
  609.         return $this;
  610.     }
  611.     public function getPhone(): ?string
  612.     {
  613.         return $this->phone;
  614.     }
  615.     public function setPhone(?string $phone): self
  616.     {
  617.         $this->phone $phone;
  618.         return $this;
  619.     }
  620.     public function getCurrentPosition(): ?string
  621.     {
  622.         return $this->current_position;
  623.     }
  624.     public function setCurrentPosition(?string $current_position): self
  625.     {
  626.         $this->current_position $current_position;
  627.         return $this;
  628.     }
  629.     public function getBirthdate(): ?\DateTime
  630.     {
  631.         return $this->birthdate;
  632.     }
  633.     public function setBirthdate(?\DateTime $birthdate): self
  634.     {
  635.         $this->birthdate $birthdate;
  636.         return $this;
  637.     }
  638.     public function getAboutMe(): ?string
  639.     {
  640.         return $this->about_me;
  641.     }
  642.     public function setAboutMe(?string $about_me): self
  643.     {
  644.         $this->about_me $about_me;
  645.         return $this;
  646.     }
  647.     public function getTosAccepted(): ?\DateTime
  648.     {
  649.         return $this->tos_accepted;
  650.     }
  651.     public function setTosAccepted(?\DateTime $tos_accepted): self
  652.     {
  653.         $this->tos_accepted $tos_accepted;
  654.         return $this;
  655.     }
  656.     public function getIsEnabledNewsletter(): ?bool
  657.     {
  658.         return $this->is_enabled_newsletter;
  659.     }
  660.     public function setIsEnabledNewsletter(bool $is_enabled_newsletter): self
  661.     {
  662.         $this->is_enabled_newsletter $is_enabled_newsletter;
  663.         return $this;
  664.     }
  665.     public function getIsEnabledPush(): ?bool
  666.     {
  667.         return $this->is_enabled_push;
  668.     }
  669.     public function setIsEnabledPush(bool $is_enabled_push): self
  670.     {
  671.         $this->is_enabled_push $is_enabled_push;
  672.         return $this;
  673.     }
  674.     public function getIsEnabledEmail(): ?bool
  675.     {
  676.         return $this->is_enabled_email;
  677.     }
  678.     public function setIsEnabledEmail(bool $is_enabled_email): self
  679.     {
  680.         $this->is_enabled_email $is_enabled_email;
  681.         return $this;
  682.     }
  683.     public function getLastVisitDate(): ?\DateTime
  684.     {
  685.         return $this->last_visit_date;
  686.     }
  687.     public function setLastVisitDate(?\DateTime $last_visit_date): self
  688.     {
  689.         $this->last_visit_date $last_visit_date;
  690.         return $this;
  691.     }
  692.     public function getEntity(): ?string
  693.     {
  694.         return $this->entity;
  695.     }
  696.     public function setEntity(?string $entity): self
  697.     {
  698.         $this->entity $entity;
  699.         return $this;
  700.     }
  701.     public function getHeadquarter(): ?Headquarter
  702.     {
  703.         return $this->headquarter;
  704.     }
  705.     public function setHeadquarter(?Headquarter $headquarter): self
  706.     {
  707.         $this->headquarter $headquarter;
  708.         return $this;
  709.     }
  710.     public function getPreferredLanguage(): ?Language
  711.     {
  712.         return $this->preferred_language;
  713.     }
  714.     public function setPreferredLanguage(?Language $preferred_language): self
  715.     {
  716.         $this->preferred_language $preferred_language;
  717.         return $this;
  718.     }
  719.     public function getRole(): ?Role
  720.     {
  721.         return $this->role;
  722.     }
  723.     public function setRole(?Role $role): self
  724.     {
  725.         $this->role $role;
  726.         return $this;
  727.     }
  728.     public function getCategory(): ?Category
  729.     {
  730.         return $this->category;
  731.     }
  732.     public function setCategory(?Category $category): self
  733.     {
  734.         $this->category $category;
  735.         return $this;
  736.     }
  737.     /**
  738.      * @return Collection|UserDevice[]
  739.      */
  740.     public function getDevices(): Collection
  741.     {
  742.         return $this->devices;
  743.     }
  744.     public function addDevice(UserDevice $device): self
  745.     {
  746.         if (!$this->devices->contains($device)) {
  747.             $this->devices[] = $device;
  748.             $device->setUser($this);
  749.         }
  750.         return $this;
  751.     }
  752.     public function removeDevice(UserDevice $device): self
  753.     {
  754.         if ($this->devices->removeElement($device)) {
  755.             // set the owning side to null (unless already changed)
  756.             if ($device->getUser() === $this) {
  757.                 $device->setUser(null);
  758.             }
  759.         }
  760.         return $this;
  761.     }
  762.     /**
  763.      * @return Collection|UserRecovery[]
  764.      */
  765.     public function getRecoveries(): Collection
  766.     {
  767.         return $this->recoveries;
  768.     }
  769.     public function addRecovery(UserRecovery $recovery): self
  770.     {
  771.         if (!$this->recoveries->contains($recovery)) {
  772.             $this->recoveries[] = $recovery;
  773.             $recovery->setUser($this);
  774.         }
  775.         return $this;
  776.     }
  777.     public function removeRecovery(UserRecovery $recovery): self
  778.     {
  779.         if ($this->recoveries->removeElement($recovery)) {
  780.             // set the owning side to null (unless already changed)
  781.             if ($recovery->getUser() === $this) {
  782.                 $recovery->setUser(null);
  783.             }
  784.         }
  785.         return $this;
  786.     }
  787.     /**
  788.      * @return Collection|UserTimesheet[]
  789.      */
  790.     public function getTimesheets(): Collection
  791.     {
  792.         return $this->timesheets;
  793.     }
  794.     public function addTimesheet(UserTimesheet $timesheet): self
  795.     {
  796.         if (!$this->timesheets->contains($timesheet)) {
  797.             $this->timesheets[] = $timesheet;
  798.             $timesheet->setUser($this);
  799.         }
  800.         return $this;
  801.     }
  802.     public function removeTimesheet(UserTimesheet $timesheet): self
  803.     {
  804.         if ($this->timesheets->removeElement($timesheet)) {
  805.             // set the owning side to null (unless already changed)
  806.             if ($timesheet->getUser() === $this) {
  807.                 $timesheet->setUser(null);
  808.             }
  809.         }
  810.         return $this;
  811.     }
  812.     /**
  813.      * @return Collection|SurveyUserAnswer[]
  814.      */
  815.     public function getSurveys(): Collection
  816.     {
  817.         return $this->surveys;
  818.     }
  819.     public function addSurvey(SurveyUserAnswer $survey): self
  820.     {
  821.         if (!$this->surveys->contains($survey)) {
  822.             $this->surveys[] = $survey;
  823.             $survey->setUser($this);
  824.         }
  825.         return $this;
  826.     }
  827.     public function removeSurvey(SurveyUserAnswer $survey): self
  828.     {
  829.         if ($this->surveys->removeElement($survey)) {
  830.             // set the owning side to null (unless already changed)
  831.             if ($survey->getUser() === $this) {
  832.                 $survey->setUser(null);
  833.             }
  834.         }
  835.         return $this;
  836.     }
  837.     /**
  838.      * @return Collection|Tag[]
  839.      */
  840.     public function getTags(): Collection
  841.     {
  842.         return $this->tags;
  843.     }
  844.     public function addTag(Tag $tag): self
  845.     {
  846.         if (!$this->tags->contains($tag)) {
  847.             $this->tags[] = $tag;
  848.         }
  849.         return $this;
  850.     }
  851.     public function removeTag(Tag $tag): self
  852.     {
  853.         $this->tags->removeElement($tag);
  854.         return $this;
  855.     }
  856.     /**
  857.      * @return Collection|Audience[]
  858.      */
  859.     public function getAudiences(): Collection
  860.     {
  861.         return $this->audiences;
  862.     }
  863.     public function addAudience(Audience $audience): self
  864.     {
  865.         if (!$this->audiences->contains($audience)) {
  866.             $this->audiences[] = $audience;
  867.             $audience->addUser($this);
  868.         }
  869.         return $this;
  870.     }
  871.     public function removeAudience(Audience $audience): self
  872.     {
  873.         if ($this->audiences->removeElement($audience)) {
  874.             $audience->removeUser($this);
  875.         }
  876.         return $this;
  877.     }
  878.     /**
  879.      * @return Collection|Audience[]
  880.      */
  881.     public function getFilterAudiences(): Collection
  882.     {
  883.         return $this->filter_audiences;
  884.     }
  885.     public function addFilterAudience(Audience $filterAudience): self
  886.     {
  887.         if (!$this->filter_audiences->contains($filterAudience)) {
  888.             $this->filter_audiences[] = $filterAudience;
  889.             $filterAudience->addFilterUser($this);
  890.         }
  891.         return $this;
  892.     }
  893.     public function removeFilterAudience(Audience $filterAudience): self
  894.     {
  895.         if ($this->filter_audiences->removeElement($filterAudience)) {
  896.             $filterAudience->removeFilterUser($this);
  897.         }
  898.         return $this;
  899.     }
  900.     /**
  901.      * @return Collection|Article[]
  902.      */
  903.     public function getArticlesAssigned(): Collection
  904.     {
  905.         return $this->articles_assigned;
  906.     }
  907.     public function addArticlesAssigned(Article $articlesAssigned): self
  908.     {
  909.         if (!$this->articles_assigned->contains($articlesAssigned)) {
  910.             $this->articles_assigned[] = $articlesAssigned;
  911.             $articlesAssigned->addUsersAssigned($this);
  912.         }
  913.         return $this;
  914.     }
  915.     public function removeArticlesAssigned(Article $articlesAssigned): self
  916.     {
  917.         if ($this->articles_assigned->removeElement($articlesAssigned)) {
  918.             $articlesAssigned->removeUsersAssigned($this);
  919.         }
  920.         return $this;
  921.     }
  922.     /**
  923.      * @return Collection|Email[]
  924.      */
  925.     public function getEmailsAssigned(): Collection
  926.     {
  927.         return $this->emails_assigned;
  928.     }
  929.     public function addEmailsAssigned(Email $emailsAssigned): self
  930.     {
  931.         if (!$this->emails_assigned->contains($emailsAssigned)) {
  932.             $this->emails_assigned[] = $emailsAssigned;
  933.             $emailsAssigned->addUsersAssigned($this);
  934.         }
  935.         return $this;
  936.     }
  937.     public function removeEmailsAssigned(Email $emailsAssigned): self
  938.     {
  939.         if ($this->emails_assigned->removeElement($emailsAssigned)) {
  940.             $emailsAssigned->removeUsersAssigned($this);
  941.         }
  942.         return $this;
  943.     }
  944.     /**
  945.      * @return Collection|Notification[]
  946.      */
  947.     public function getNotificationsAssigned(): Collection
  948.     {
  949.         return $this->notifications_assigned;
  950.     }
  951.     public function addNotificationsAssigned(Notification $notificationsAssigned): self
  952.     {
  953.         if (!$this->notifications_assigned->contains($notificationsAssigned)) {
  954.             $this->notifications_assigned[] = $notificationsAssigned;
  955.             $notificationsAssigned->addUsersAssigned($this);
  956.         }
  957.         return $this;
  958.     }
  959.     public function removeNotificationsAssigned(Notification $notificationsAssigned): self
  960.     {
  961.         if ($this->notifications_assigned->removeElement($notificationsAssigned)) {
  962.             $notificationsAssigned->removeUsersAssigned($this);
  963.         }
  964.         return $this;
  965.     }
  966.     /**
  967.      * @return Collection|Reservation[]
  968.      */
  969.     public function getReservationsAssigned(): Collection
  970.     {
  971.         return $this->reservations_assigned;
  972.     }
  973.     public function addReservationsAssigned(Reservation $reservationsAssigned): self
  974.     {
  975.         if (!$this->reservations_assigned->contains($reservationsAssigned)) {
  976.             $this->reservations_assigned[] = $reservationsAssigned;
  977.             $reservationsAssigned->addUsersAssigned($this);
  978.         }
  979.         return $this;
  980.     }
  981.     public function removeReservationsAssigned(Reservation $reservationsAssigned): self
  982.     {
  983.         if ($this->reservations_assigned->removeElement($reservationsAssigned)) {
  984.             $reservationsAssigned->removeUsersAssigned($this);
  985.         }
  986.         return $this;
  987.     }
  988.     /**
  989.      * @return Collection|UserNotification[]
  990.      */
  991.     public function getNotifications(): Collection
  992.     {
  993.         return $this->notifications;
  994.     }
  995.     public function addNotification(UserNotification $notification): self
  996.     {
  997.         if (!$this->notifications->contains($notification)) {
  998.             $this->notifications[] = $notification;
  999.             $notification->setUser($this);
  1000.         }
  1001.         return $this;
  1002.     }
  1003.     public function removeNotification(UserNotification $notification): self
  1004.     {
  1005.         if ($this->notifications->removeElement($notification)) {
  1006.             // set the owning side to null (unless already changed)
  1007.             if ($notification->getUser() === $this) {
  1008.                 $notification->setUser(null);
  1009.             }
  1010.         }
  1011.         return $this;
  1012.     }
  1013.     /**
  1014.      * @return Collection|Survey[]
  1015.      */
  1016.     public function getSurveysAssigned(): Collection
  1017.     {
  1018.         return $this->surveys_assigned;
  1019.     }
  1020.     public function addSurveysAssigned(Survey $surveysAssigned): self
  1021.     {
  1022.         if (!$this->surveys_assigned->contains($surveysAssigned)) {
  1023.             $this->surveys_assigned[] = $surveysAssigned;
  1024.             $surveysAssigned->addUsersAssigned($this);
  1025.         }
  1026.         return $this;
  1027.     }
  1028.     public function removeSurveysAssigned(Survey $surveysAssigned): self
  1029.     {
  1030.         if ($this->surveys_assigned->removeElement($surveysAssigned)) {
  1031.             $surveysAssigned->removeUsersAssigned($this);
  1032.         }
  1033.         return $this;
  1034.     }
  1035.     /**
  1036.      * @return Collection|WorkgroupUserSubscribed[]
  1037.      */
  1038.     public function getWorkgroupsSubscribed(): Collection
  1039.     {
  1040.         return $this->workgroups_subscribed;
  1041.     }
  1042.     public function addWorkgroupsSubscribed(WorkgroupUserSubscribed $workgroupsSubscribed): self
  1043.     {
  1044.         if (!$this->workgroups_subscribed->contains($workgroupsSubscribed)) {
  1045.             $this->workgroups_subscribed[] = $workgroupsSubscribed;
  1046.             $workgroupsSubscribed->setUser($this);
  1047.         }
  1048.         return $this;
  1049.     }
  1050.     public function removeWorkgroupsSubscribed(WorkgroupUserSubscribed $workgroupsSubscribed): self
  1051.     {
  1052.         if ($this->workgroups_subscribed->removeElement($workgroupsSubscribed)) {
  1053.             // set the owning side to null (unless already changed)
  1054.             if ($workgroupsSubscribed->getUser() === $this) {
  1055.                 $workgroupsSubscribed->setUser(null);
  1056.             }
  1057.         }
  1058.         return $this;
  1059.     }
  1060.     /**
  1061.      * @return Collection|WorkgroupComment[]
  1062.      */
  1063.     public function getWorkgroupCommentLikes(): Collection
  1064.     {
  1065.         return $this->workgroup_comment_likes;
  1066.     }
  1067.     public function addWorkgroupCommentLike(WorkgroupComment $workgroupCommentLike): self
  1068.     {
  1069.         if (!$this->workgroup_comment_likes->contains($workgroupCommentLike)) {
  1070.             $this->workgroup_comment_likes[] = $workgroupCommentLike;
  1071.             $workgroupCommentLike->addLike($this);
  1072.         }
  1073.         return $this;
  1074.     }
  1075.     public function removeWorkgroupCommentLike(WorkgroupComment $workgroupCommentLike): self
  1076.     {
  1077.         if ($this->workgroup_comment_likes->removeElement($workgroupCommentLike)) {
  1078.             $workgroupCommentLike->removeLike($this);
  1079.         }
  1080.         return $this;
  1081.     }
  1082.     /**
  1083.      * @return Collection|Article[]
  1084.      */
  1085.     public function getArticlesSubscribed(): Collection
  1086.     {
  1087.         return $this->articles_subscribed;
  1088.     }
  1089.     public function addArticleSubscribed(Article $articleSubscribed): self
  1090.     {
  1091.         if (!$this->articles_subscribed->contains($articleSubscribed)) {
  1092.             $this->articles_subscribed[] = $articleSubscribed;
  1093.             $articleSubscribed->addUsersSubscribed($this);
  1094.         }
  1095.         return $this;
  1096.     }
  1097.     public function removeArticleSubscribed(Article $articleSubscribed): self
  1098.     {
  1099.         if ($this->articles_subscribed->removeElement($articleSubscribed)) {
  1100.             $articleSubscribed->removeUsersSubscribed($this);
  1101.         }
  1102.         return $this;
  1103.     }
  1104.     /**
  1105.      * @return Collection|UserReservation[]
  1106.      */
  1107.     public function getReservations(): Collection
  1108.     {
  1109.         return $this->reservations;
  1110.     }
  1111.     public function addReservation(UserReservation $reservation): self
  1112.     {
  1113.         if (!$this->reservations->contains($reservation)) {
  1114.             $this->reservations[] = $reservation;
  1115.             $reservation->setUser($this);
  1116.         }
  1117.         return $this;
  1118.     }
  1119.     public function removeReservation(UserReservation $reservation): self
  1120.     {
  1121.         if ($this->reservations->removeElement($reservation)) {
  1122.             // set the owning side to null (unless already changed)
  1123.             if ($reservation->getUser() === $this) {
  1124.                 $reservation->setUser(null);
  1125.             }
  1126.         }
  1127.         return $this;
  1128.     }
  1129.     public function getNumTotalHolidays(): ?int
  1130.     {
  1131.         return $this->num_total_holidays;
  1132.     }
  1133.     public function setNumTotalHolidays(int $num_total_holidays): self
  1134.     {
  1135.         $this->num_total_holidays $num_total_holidays;
  1136.         return $this;
  1137.     }
  1138.     /**
  1139.      * @return Collection|UserHoliday[]
  1140.      */
  1141.     public function getHolidays(): Collection
  1142.     {
  1143.         return $this->holidays;
  1144.     }
  1145.     public function addHoliday(UserHoliday $holiday): self
  1146.     {
  1147.         if (!$this->holidays->contains($holiday)) {
  1148.             $this->holidays[] = $holiday;
  1149.             $holiday->setUser($this);
  1150.         }
  1151.         return $this;
  1152.     }
  1153.     public function removeHoliday(UserHoliday $holiday): self
  1154.     {
  1155.         if ($this->holidays->removeElement($holiday)) {
  1156.             // set the owning side to null (unless already changed)
  1157.             if ($holiday->getUser() === $this) {
  1158.                 $holiday->setUser(null);
  1159.             }
  1160.         }
  1161.         return $this;
  1162.     }
  1163.     /**
  1164.      * @return Collection|Category[]
  1165.      */
  1166.     public function getCategoriesHeadHolidays(): Collection
  1167.     {
  1168.         return $this->categories_head_holidays;
  1169.     }
  1170.     public function addCategoriesHeadHoliday(Category $categoriesHeadHoliday): self
  1171.     {
  1172.         if (!$this->categories_head_holidays->contains($categoriesHeadHoliday)) {
  1173.             $this->categories_head_holidays[] = $categoriesHeadHoliday;
  1174.             $categoriesHeadHoliday->setHeadHolidays($this);
  1175.         }
  1176.         return $this;
  1177.     }
  1178.     public function removeCategoriesHeadHoliday(Category $categoriesHeadHoliday): self
  1179.     {
  1180.         if ($this->categories_head_holidays->removeElement($categoriesHeadHoliday)) {
  1181.             // set the owning side to null (unless already changed)
  1182.             if ($categoriesHeadHoliday->getHeadHolidays() === $this) {
  1183.                 $categoriesHeadHoliday->setHeadHolidays(null);
  1184.             }
  1185.         }
  1186.         return $this;
  1187.     }
  1188.     /**
  1189.      * @return Collection|Category[]
  1190.      */
  1191.     public function getCategoriesHeadTimesheets(): Collection
  1192.     {
  1193.         return $this->categories_head_timesheets;
  1194.     }
  1195.     public function addCategoriesHeadTimesheet(Category $categoriesHeadTimesheet): self
  1196.     {
  1197.         if (!$this->categories_head_timesheets->contains($categoriesHeadTimesheet)) {
  1198.             $this->categories_head_timesheets[] = $categoriesHeadTimesheet;
  1199.             $categoriesHeadTimesheet->setHeadTimesheets($this);
  1200.         }
  1201.         return $this;
  1202.     }
  1203.     public function removeCategoriesHeadTimesheet(Category $categoriesHeadTimesheet): self
  1204.     {
  1205.         if ($this->categories_head_timesheets->removeElement($categoriesHeadTimesheet)) {
  1206.             // set the owning side to null (unless already changed)
  1207.             if ($categoriesHeadTimesheet->getHeadTimesheets() === $this) {
  1208.                 $categoriesHeadTimesheet->setHeadTimesheets(null);
  1209.             }
  1210.         }
  1211.         return $this;
  1212.     }
  1213.     public function getHeadHolidays(): ?self
  1214.     {
  1215.         return $this->head_holidays;
  1216.     }
  1217.     public function setHeadHolidays(?self $head_holidays): self
  1218.     {
  1219.         $this->head_holidays $head_holidays;
  1220.         return $this;
  1221.     }
  1222.     /**
  1223.      * @return Collection|self[]
  1224.      */
  1225.     public function getUsersHeadHolidays(): Collection
  1226.     {
  1227.         return $this->users_head_holidays;
  1228.     }
  1229.     public function addUsersHeadHoliday(self $usersHeadHoliday): self
  1230.     {
  1231.         if (!$this->users_head_holidays->contains($usersHeadHoliday)) {
  1232.             $this->users_head_holidays[] = $usersHeadHoliday;
  1233.             $usersHeadHoliday->setHeadHolidays($this);
  1234.         }
  1235.         return $this;
  1236.     }
  1237.     public function removeUsersHeadHoliday(self $usersHeadHoliday): self
  1238.     {
  1239.         if ($this->users_head_holidays->removeElement($usersHeadHoliday)) {
  1240.             // set the owning side to null (unless already changed)
  1241.             if ($usersHeadHoliday->getHeadHolidays() === $this) {
  1242.                 $usersHeadHoliday->setHeadHolidays(null);
  1243.             }
  1244.         }
  1245.         return $this;
  1246.     }
  1247.     public function getHeadTimesheets(): ?self
  1248.     {
  1249.         return $this->head_timesheets;
  1250.     }
  1251.     public function setHeadTimesheets(?self $head_timesheets): self
  1252.     {
  1253.         $this->head_timesheets $head_timesheets;
  1254.         return $this;
  1255.     }
  1256.     /**
  1257.      * @return Collection|self[]
  1258.      */
  1259.     public function getUsersHeadTimesheets(): Collection
  1260.     {
  1261.         return $this->users_head_timesheets;
  1262.     }
  1263.     public function addUsersHeadTimesheet(self $usersHeadTimesheet): self
  1264.     {
  1265.         if (!$this->users_head_timesheets->contains($usersHeadTimesheet)) {
  1266.             $this->users_head_timesheets[] = $usersHeadTimesheet;
  1267.             $usersHeadTimesheet->setHeadTimesheets($this);
  1268.         }
  1269.         return $this;
  1270.     }
  1271.     public function removeUsersHeadTimesheet(self $usersHeadTimesheet): self
  1272.     {
  1273.         if ($this->users_head_timesheets->removeElement($usersHeadTimesheet)) {
  1274.             // set the owning side to null (unless already changed)
  1275.             if ($usersHeadTimesheet->getHeadTimesheets() === $this) {
  1276.                 $usersHeadTimesheet->setHeadTimesheets(null);
  1277.             }
  1278.         }
  1279.         return $this;
  1280.     }
  1281.     public function getWorkplace(): ?Workplace
  1282.     {
  1283.         return $this->workplace;
  1284.     }
  1285.     public function setWorkplace(?Workplace $workplace): self
  1286.     {
  1287.         $this->workplace $workplace;
  1288.         return $this;
  1289.     }
  1290.     public function getDailyHours(): ?float
  1291.     {
  1292.         return $this->daily_hours;
  1293.     }
  1294.     public function setDailyHours(?float $daily_hours): self
  1295.     {
  1296.         $this->daily_hours $daily_hours;
  1297.         return $this;
  1298.     }
  1299.     /**
  1300.      * @return Collection|ArticleUserView[]
  1301.      */
  1302.     public function getArticleUserViews(): Collection
  1303.     {
  1304.         return $this->articleUserViews;
  1305.     }
  1306.     public function addArticleUserView(ArticleUserView $articleUserView): self
  1307.     {
  1308.         if (!$this->articleUserViews->contains($articleUserView)) {
  1309.             $this->articleUserViews[] = $articleUserView;
  1310.             $articleUserView->setUser($this);
  1311.         }
  1312.         return $this;
  1313.     }
  1314.     public function removeArticleUserView(ArticleUserView $articleUserView): self
  1315.     {
  1316.         if ($this->articleUserViews->removeElement($articleUserView)) {
  1317.             // set the owning side to null (unless already changed)
  1318.             if ($articleUserView->getUser() === $this) {
  1319.                 $articleUserView->setUser(null);
  1320.             }
  1321.         }
  1322.         return $this;
  1323.     }
  1324.     /**
  1325.      * @return Collection|WorkgroupUserView[]
  1326.      */
  1327.     public function getWorkgroupUserViews(): Collection
  1328.     {
  1329.         return $this->workgroupUserViews;
  1330.     }
  1331.     public function addWorkgroupUserView(WorkgroupUserView $workgroupUserView): self
  1332.     {
  1333.         if (!$this->workgroupUserViews->contains($workgroupUserView)) {
  1334.             $this->workgroupUserViews[] = $workgroupUserView;
  1335.             $workgroupUserView->setUser($this);
  1336.         }
  1337.         return $this;
  1338.     }
  1339.     public function removeWorkgroupUserView(WorkgroupUserView $workgroupUserView): self
  1340.     {
  1341.         if ($this->workgroupUserViews->removeElement($workgroupUserView)) {
  1342.             // set the owning side to null (unless already changed)
  1343.             if ($workgroupUserView->getUser() === $this) {
  1344.                 $workgroupUserView->setUser(null);
  1345.             }
  1346.         }
  1347.         return $this;
  1348.     }
  1349.     /**
  1350.      * @return Collection|QuizzUserAnswer[]
  1351.      */
  1352.     public function getQuizzes(): Collection
  1353.     {
  1354.         return $this->quizzes;
  1355.     }
  1356.     public function addQuiz(QuizzUserAnswer $quiz): self
  1357.     {
  1358.         if (!$this->quizzes->contains($quiz)) {
  1359.             $this->quizzes[] = $quiz;
  1360.             $quiz->setUser($this);
  1361.         }
  1362.         return $this;
  1363.     }
  1364.     public function removeQuiz(QuizzUserAnswer $quiz): self
  1365.     {
  1366.         if ($this->quizzes->removeElement($quiz)) {
  1367.             // set the owning side to null (unless already changed)
  1368.             if ($quiz->getUser() === $this) {
  1369.                 $quiz->setUser(null);
  1370.             }
  1371.         }
  1372.         return $this;
  1373.     }
  1374.     /**
  1375.      * @return Collection|DocumentFileView[]
  1376.      */
  1377.     public function getDocumentFileViews(): Collection
  1378.     {
  1379.         return $this->documentFileViews;
  1380.     }
  1381.     public function addDocumentFileView(DocumentFileView $documentFileView): self
  1382.     {
  1383.         if (!$this->documentFileViews->contains($documentFileView)) {
  1384.             $this->documentFileViews[] = $documentFileView;
  1385.             $documentFileView->setUser($this);
  1386.         }
  1387.         return $this;
  1388.     }
  1389.     public function removeDocumentFileView(DocumentFileView $documentFileView): self
  1390.     {
  1391.         if ($this->documentFileViews->removeElement($documentFileView)) {
  1392.             // set the owning side to null (unless already changed)
  1393.             if ($documentFileView->getUser() === $this) {
  1394.                 $documentFileView->setUser(null);
  1395.             }
  1396.         }
  1397.         return $this;
  1398.     }
  1399.     /**
  1400.      * @return Collection|UserSchedule[]
  1401.      */
  1402.     public function getSchedules(): Collection
  1403.     {
  1404.         return $this->schedules;
  1405.     }
  1406.     public function addSchedule(UserSchedule $schedule): self
  1407.     {
  1408.         if (!$this->schedules->contains($schedule)) {
  1409.             $this->schedules[] = $schedule;
  1410.             $schedule->setUser($this);
  1411.         }
  1412.         return $this;
  1413.     }
  1414.     public function removeSchedule(UserSchedule $schedule): self
  1415.     {
  1416.         if ($this->schedules->removeElement($schedule)) {
  1417.             // set the owning side to null (unless already changed)
  1418.             if ($schedule->getUser() === $this) {
  1419.                 $schedule->setUser(null);
  1420.             }
  1421.         }
  1422.         return $this;
  1423.     }
  1424.     /**
  1425.      * @return Collection<int, Fingerprint>
  1426.      */
  1427.     public function getFingerprints(): Collection
  1428.     {
  1429.         return $this->fingerprints;
  1430.     }
  1431.     public function addFingerprint(Fingerprint $fingerprint): self
  1432.     {
  1433.         if (!$this->fingerprints->contains($fingerprint)) {
  1434.             $this->fingerprints[] = $fingerprint;
  1435.             $fingerprint->setUser($this);
  1436.         }
  1437.         return $this;
  1438.     }
  1439.     public function removeFingerprint(Fingerprint $fingerprint): self
  1440.     {
  1441.         if ($this->fingerprints->removeElement($fingerprint)) {
  1442.             // set the owning side to null (unless already changed)
  1443.             if ($fingerprint->getUser() === $this) {
  1444.                 $fingerprint->setUser(null);
  1445.             }
  1446.         }
  1447.         return $this;
  1448.     }
  1449.     public function getDailyHoursMonday(): ?float
  1450.     {
  1451.         return $this->daily_hours_monday;
  1452.     }
  1453.     public function setDailyHoursMonday(float $daily_hours_monday): self
  1454.     {
  1455.         $this->daily_hours_monday $daily_hours_monday;
  1456.         return $this;
  1457.     }
  1458.     public function getDailyHoursTuesday(): ?float
  1459.     {
  1460.         return $this->daily_hours_tuesday;
  1461.     }
  1462.     public function setDailyHoursTuesday(float $daily_hours_tuesday): self
  1463.     {
  1464.         $this->daily_hours_tuesday $daily_hours_tuesday;
  1465.         return $this;
  1466.     }
  1467.     public function getDailyHoursWednesday(): ?float
  1468.     {
  1469.         return $this->daily_hours_wednesday;
  1470.     }
  1471.     public function setDailyHoursWednesday(float $daily_hours_wednesday): self
  1472.     {
  1473.         $this->daily_hours_wednesday $daily_hours_wednesday;
  1474.         return $this;
  1475.     }
  1476.     public function getDailyHoursThursday(): ?float
  1477.     {
  1478.         return $this->daily_hours_thursday;
  1479.     }
  1480.     public function setDailyHoursThursday(float $daily_hours_thursday): self
  1481.     {
  1482.         $this->daily_hours_thursday $daily_hours_thursday;
  1483.         return $this;
  1484.     }
  1485.     public function getDailyHoursFriday(): ?float
  1486.     {
  1487.         return $this->daily_hours_friday;
  1488.     }
  1489.     public function setDailyHoursFriday(float $daily_hours_friday): self
  1490.     {
  1491.         $this->daily_hours_friday $daily_hours_friday;
  1492.         return $this;
  1493.     }
  1494.     public function getDailyHoursSaturday(): ?float
  1495.     {
  1496.         return $this->daily_hours_saturday;
  1497.     }
  1498.     public function setDailyHoursSaturday(float $daily_hours_saturday): self
  1499.     {
  1500.         $this->daily_hours_saturday $daily_hours_saturday;
  1501.         return $this;
  1502.     }
  1503.     public function getDailyHoursSunday(): ?float
  1504.     {
  1505.         return $this->daily_hours_sunday;
  1506.     }
  1507.     public function setDailyHoursSunday(float $daily_hours_sunday): self
  1508.     {
  1509.         $this->daily_hours_sunday $daily_hours_sunday;
  1510.         return $this;
  1511.     }
  1512.     public function getDailyHoursByDate(\DateTimeInterface $date): ?float
  1513.     {
  1514.         return match ($date->format('l')) {
  1515.             'Monday' => $this->daily_hours_monday,
  1516.             'Tuesday' => $this->daily_hours_tuesday,
  1517.             'Wednesday' => $this->daily_hours_wednesday,
  1518.             'Thursday' => $this->daily_hours_thursday,
  1519.             'Friday' => $this->daily_hours_friday,
  1520.             'Saturday' => $this->daily_hours_saturday,
  1521.             'Sunday' => $this->daily_hours_sunday,
  1522.             default => $this->daily_hours,
  1523.         };
  1524.     }
  1525.     public function getStatusLabel(): string
  1526.     {
  1527.         return match ($this->getStatus()) {
  1528.             self::STATUS['PENDING'] => 'Pendiente',
  1529.             self::STATUS['PUBLISHED'] => 'Habilitado',
  1530.             self::STATUS_UNPUBLISHED => 'Deshabilitado',
  1531.             default => '',
  1532.         };
  1533.     }
  1534. }