src/CoreBundle/Entity/Tutor.php line 21

Open in your IDE?
  1. <?php
  2. namespace CoreBundle\Entity;
  3. use CoreBundle\Entity\Common\MmppUserInterface;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Symfony\Component\Validator\Constraints as Assert;
  9. use TheCodingMachine\GraphQLite\Annotations\Field;
  10. use TheCodingMachine\GraphQLite\Annotations\Type;
  11. /**
  12.  * Tutor
  13.  *
  14.  * @ORM\Table(name="tutor")
  15.  * @ORM\Entity(repositoryClass="CoreBundle\Repository\TutorRepository")
  16.  */
  17. #[Type]
  18. class Tutor implements MmppUserInterface\Serializable
  19. {
  20.     /**
  21.      * @var int
  22.      *
  23.      * @ORM\Column(name="id", type="integer")
  24.      * @ORM\Id
  25.      * @ORM\GeneratedValue(strategy="IDENTITY")
  26.      */
  27.     private $id;
  28.     /**
  29.      * @ORM\Column(type="string")
  30.      * @Assert\NotBlank
  31.      */
  32.     private $login;
  33.     /**
  34.      * @ORM\Column(type="string")
  35.      */
  36.     private $password;
  37.     /**
  38.      * @ORM\Column(type="string")
  39.      * @Assert\NotBlank
  40.      */
  41.     private $firstname;
  42.     /**
  43.      * @ORM\Column(type="string")
  44.      * @Assert\NotBlank
  45.      */
  46.     private $lastname;
  47.     /**
  48.      * @ORM\Column(type="string")
  49.      * @Assert\NotBlank
  50.      * @Assert\Email
  51.      */
  52.     private $email;
  53.     /**
  54.      * @ORM\Column(type="string", nullable=true)
  55.      */
  56.     private $phone;
  57.     /**
  58.      * @ORM\Column(type="string", nullable=true)
  59.      */
  60.     private $avatar;
  61.     /**
  62.      * @ORM\Column(type="boolean", options={"default": false})
  63.      */
  64.     private $admin;
  65.     /**
  66.      * @ORM\Column(type="boolean", options={"default": false})
  67.      */
  68.     private $active;
  69.     /**
  70.      * @ORM\Column(type="datetimetz", name="logged_on", nullable=true)
  71.      */
  72.     private $loggedOn;
  73.     /**
  74.      * @ORM\Column(type="datetimetz", name="last_activity", nullable=true)
  75.      */
  76.     private $lastActivity;
  77.     /**
  78.      * @ORM\Column(type="string", length=32, nullable=true)
  79.      */
  80.     private $token;
  81.     /**
  82.      * @todo à refaire
  83.      * 1 = centre, 2 = bordeaux, 3 = antilles
  84.      *
  85.      * @ORM\Column(type="integer")
  86.      * @var integer
  87.      */
  88.     private $groupId;
  89.     /**
  90.      * @ORM\Column(type="boolean", nullable=true, options={"default": false})
  91.      * @var boolean
  92.      */
  93.     private $apiAccess;
  94.     /**
  95.      * @ORM\OneToMany(targetEntity="Post", mappedBy="tutor")
  96.      * @ORM\OrderBy({"createdOn" = "DESC"})
  97.      */
  98.     private $posts;
  99.     /**
  100.      * @ORM\ManyToOne(targetEntity="Category", inversedBy="tutorsConnected", )
  101.      * @ORM\JoinColumn(name="last_category_id", referencedColumnName="id", onDelete="SET NULL")
  102.      */
  103.     private $lastCategory;
  104.     /**
  105.      * @ORM\ManyToMany(targetEntity="GroupStudent", inversedBy="tutors")
  106.      * @ORM\JoinTable(name="tutor_group", inverseJoinColumns={@ORM\JoinColumn(name="group_id", referencedColumnName="id")})
  107.      */
  108.     private $groups;
  109.     /**
  110.      * @ORM\ManyToMany(targetEntity="Activity", inversedBy="tutors")
  111.      * @ORM\JoinTable(name="tutor_activity")
  112.      * @ORM\OrderBy({"name":"asc"})
  113.      */
  114.     private $activities;
  115.     /**
  116.      * @ORM\ManyToMany(targetEntity="Module", inversedBy="tutors")
  117.      * @ORM\JoinTable(name="tutor_module")
  118.      * @ORM\OrderBy({"name":"asc"})
  119.      */
  120.     private $modules;
  121.     /**
  122.      * @ORM\ManyToMany(targetEntity="Secteur", inversedBy="tutors")
  123.      * @ORM\JoinTable(name="tutor_secteur")
  124.      */
  125.     private $secteurs;
  126.     /**
  127.      * Permet d'ajouter des droits d'accès supplémentaires à une catégory pour un tutor,
  128.      * sans passer par les branches/secteurs
  129.      *
  130.      * @ORM\ManyToMany(targetEntity="Category", inversedBy="tutors")
  131.      * @ORM\JoinTable(name="forum_tutors_categories")
  132.      */
  133.     private $categories;
  134.     /**
  135.      * @ORM\OneToMany(targetEntity="QuestionnaireComment", mappedBy="tutor")
  136.      */
  137.     private $comments;
  138.     /**
  139.      * @ORM\OneToMany(targetEntity="EdtLesson", mappedBy="tutor")
  140.      */
  141.     private $edtLessons;
  142.     /**
  143.      * @ORM\OneToMany(targetEntity="QuestionnaireQcmQuestion", mappedBy="tutor")
  144.      */
  145.     private $questions;
  146.     /**
  147.      * @ORM\OneToMany(targetEntity="Calendar", mappedBy="tutor")
  148.      */
  149.     private $calendars;
  150.     /**
  151.      * @ORM\OneToMany(targetEntity="CalendarEvent", mappedBy="tutor")
  152.      */
  153.     private $calendarEvents;
  154.     /**
  155.      * @ORM\OneToMany(targetEntity="QuestionnaireRangeQuestion", mappedBy="tutor")
  156.      */
  157.     private $rangeQuestions;
  158.     /**
  159.      * @ORM\OneToMany(targetEntity="NoteTestGroup", mappedBy="tutor")
  160.      */
  161.     private $noteTestGroups;
  162.     /**
  163.      * @ORM\OneToMany(targetEntity="NoteTestStudentLog", mappedBy="tutor")
  164.      */
  165.     private $noteTestStudentLogs;
  166.     /**
  167.      * Pour faire la distinction entre tutor et student
  168.      * @var string
  169.      */
  170.     public $class 'tutor';
  171.     /**
  172.      * Pour le FormType
  173.      * @var string
  174.      */
  175.     private $plainPassword;
  176.     /**
  177.      * @ORM\OneToMany(targetEntity="NoteTestStudent", mappedBy="tutor")
  178.      */
  179.     private $noteTestStudents;
  180.     /**
  181.      * @ORM\Column(type="string", nullable=true)
  182.      * @var string
  183.      */
  184.     #[Field]
  185.     private $firebaseToken;
  186.     /**
  187.      * @ORM\Column(type="datetime_immutable", nullable=true)
  188.      * @var \DateTimeImmutable
  189.      */
  190.     #[Field]
  191.     private $firebaseTokenDate;
  192.     /**
  193.      * @ORM\Column(type="string", nullable=true)
  194.      */
  195.     private ?string $qrCode;
  196.     /**
  197.      * @ORM\Column(type="datetime_immutable", nullable=true)
  198.      */
  199.     private ?\DateTimeImmutable $qrCodeDate;
  200.     /**
  201.      * Constructor
  202.      */
  203.     public function __construct()
  204.     {
  205.         $this->active true;
  206.         $this->posts = new \Doctrine\Common\Collections\ArrayCollection();
  207.         $this->groups = new ArrayCollection();
  208.         $this->activities = new ArrayCollection();
  209.         $this->secteurs = new ArrayCollection();
  210.         $this->categories = new ArrayCollection();
  211.         $this->comments = new ArrayCollection();
  212.         $this->edtLessons = new ArrayCollection();
  213.         $this->questions = new ArrayCollection();
  214.         $this->calendars = new ArrayCollection();
  215.         $this->calendarEvents = new ArrayCollection();
  216.         $this->rangeQuestions = new ArrayCollection();
  217.         $this->noteTestGroups = new ArrayCollection();
  218.         $this->modules = new ArrayCollection();
  219.         $this->noteTestStudents = new ArrayCollection();
  220.         $this->noteTestStudentLogs = new ArrayCollection();
  221.     }
  222.     /**
  223.      * Get id
  224.      *
  225.      * @return int
  226.      */
  227.     #[Field(outputType"ID")]
  228.     public function getId()
  229.     {
  230.         return $this->id;
  231.     }
  232.     public function getSalt()
  233.     {
  234.         // you *may* need a real salt depending on your encoder
  235.         // see section on salt below
  236.         return null;
  237.     }
  238.     public function getUsername()
  239.     {
  240.         return $this->login;
  241.     }
  242.     public function getUserIdentifier(): string
  243.     {
  244.         return $this->login;
  245.     }
  246.     public function getRoles()
  247.     {
  248.         if ($this->getAdmin()) {
  249.             return array('ROLE_ADMIN');
  250.         }
  251.         if ($this->getApiAccess()) {
  252.             return array('ROLE_API');
  253.         }
  254.         return array('ROLE_TUTOR');
  255.     }
  256.     public function eraseCredentials()
  257.     {
  258.     }
  259.     public function serialize()
  260.     {
  261.         return serialize(array(
  262.             $this->id,
  263.             $this->login,
  264.             $this->email,
  265.             $this->password,
  266.         ));
  267.     }
  268.     public function unserialize($serialized)
  269.     {
  270.         list (
  271.             $this->id,
  272.             $this->login,
  273.             $this->email,
  274.             $this->password,
  275.         ) = unserialize($serialized);
  276.     }
  277.     public function setPassword(string $password): self
  278.     {
  279.         $this->password $password;
  280.         return $this;
  281.     }
  282.     public function getPassword(): ?string
  283.     {
  284.         return $this->password;
  285.     }
  286.     /**
  287.      * Set login
  288.      *
  289.      * @param string $login
  290.      *
  291.      * @return Tutor
  292.      */
  293.     public function setLogin($login)
  294.     {
  295.         $this->login $login;
  296.         return $this;
  297.     }
  298.     /**
  299.      * Get login
  300.      *
  301.      * @return string
  302.      */
  303.     public function getLogin()
  304.     {
  305.         return $this->login;
  306.     }
  307.     #[Field]
  308.     public function getName(): string
  309.     {
  310.         return $this->firstname.' '.$this->lastname;
  311.     }
  312.     /**
  313.      * Set firstname
  314.      *
  315.      * @param string $firstname
  316.      *
  317.      * @return Tutor
  318.      */
  319.     public function setFirstname($firstname)
  320.     {
  321.         $this->firstname $firstname;
  322.         return $this;
  323.     }
  324.     /**
  325.      * Get firstname
  326.      *
  327.      * @return string
  328.      */
  329.     public function getFirstname()
  330.     {
  331.         return $this->firstname;
  332.     }
  333.     /**
  334.      * Set lastname
  335.      *
  336.      * @param string $lastname
  337.      *
  338.      * @return Tutor
  339.      */
  340.     public function setLastname($lastname)
  341.     {
  342.         $this->lastname $lastname;
  343.         return $this;
  344.     }
  345.     /**
  346.      * Get lastname
  347.      *
  348.      * @return string
  349.      */
  350.     public function getLastname()
  351.     {
  352.         return $this->lastname;
  353.     }
  354.     /**
  355.      * Set email
  356.      *
  357.      * @param string $email
  358.      *
  359.      * @return Tutor
  360.      */
  361.     public function setEmail($email)
  362.     {
  363.         $this->email $email;
  364.         return $this;
  365.     }
  366.     /**
  367.      * Get email
  368.      *
  369.      * @return string
  370.      */
  371.     public function getEmail()
  372.     {
  373.         return $this->email;
  374.     }
  375.     /**
  376.      * Set phone
  377.      *
  378.      * @param string $phone
  379.      *
  380.      * @return Tutor
  381.      */
  382.     public function setPhone($phone)
  383.     {
  384.         $this->phone $phone;
  385.         return $this;
  386.     }
  387.     /**
  388.      * Get phone
  389.      *
  390.      * @return string
  391.      */
  392.     public function getPhone()
  393.     {
  394.         return $this->phone;
  395.     }
  396.     /**
  397.      * Get disabled
  398.      *
  399.      * @return boolean
  400.      */
  401.     public function getDisabled()
  402.     {
  403.         return !$this->active;
  404.     }
  405.     /**
  406.      * Set admin
  407.      *
  408.      * @param boolean $admin
  409.      *
  410.      * @return Tutor
  411.      */
  412.     public function setAdmin($admin)
  413.     {
  414.         $this->admin $admin;
  415.         return $this;
  416.     }
  417.     /**
  418.      * Get admin
  419.      *
  420.      * @return boolean
  421.      */
  422.     #[Field]
  423.     public function getAdmin(): bool
  424.     {
  425.         return $this->admin ?? false;
  426.     }
  427.     /**
  428.      * Set loggedOn
  429.      *
  430.      * @param \DateTime $loggedOn
  431.      *
  432.      * @return Tutor
  433.      */
  434.     public function setLoggedOn($loggedOn)
  435.     {
  436.         $this->loggedOn $loggedOn;
  437.         return $this;
  438.     }
  439.     /**
  440.      * Get loggedOn
  441.      *
  442.      * @return \DateTime
  443.      */
  444.     public function getLoggedOn()
  445.     {
  446.         return $this->loggedOn;
  447.     }
  448.     /**
  449.      * @return bool whether the user is active or not
  450.      */
  451.     public function isActiveNow()
  452.     {
  453.         $delay = new \DateTime('20 minutes ago');
  454.         return ($this->getlastActivity()>$delay);
  455.     }
  456.     /**
  457.      * Set lastActivity
  458.      *
  459.      * @param \DateTime $lastActivity
  460.      *
  461.      * @return Tutor
  462.      */
  463.     public function setLastActivity($lastActivity)
  464.     {
  465.         $this->lastActivity $lastActivity;
  466.         return $this;
  467.     }
  468.     /**
  469.      * Get lastActivity
  470.      *
  471.      * @return \DateTime
  472.      */
  473.     public function getLastActivity()
  474.     {
  475.         return $this->lastActivity;
  476.     }
  477.     /**
  478.      * Add post
  479.      *
  480.      * @param \CoreBundle\Entity\Post $post
  481.      *
  482.      * @return Tutor
  483.      */
  484.     public function addPost(\CoreBundle\Entity\Post $post)
  485.     {
  486.         $this->posts[] = $post;
  487.         return $this;
  488.     }
  489.     /**
  490.      * Remove post
  491.      *
  492.      * @param \CoreBundle\Entity\Post $post
  493.      */
  494.     public function removePost(\CoreBundle\Entity\Post $post)
  495.     {
  496.         $this->posts->removeElement($post);
  497.     }
  498.     /**
  499.      * Get posts
  500.      *
  501.      * @return \Doctrine\Common\Collections\Collection
  502.      */
  503.     public function getPosts()
  504.     {
  505.         return $this->posts;
  506.     }
  507.     /**
  508.      * Set lastCategory
  509.      *
  510.      * @param \CoreBundle\Entity\Category $lastCategory
  511.      *
  512.      * @return Tutor
  513.      */
  514.     public function setLastCategory(\CoreBundle\Entity\Category $lastCategory null)
  515.     {
  516.         $this->lastCategory $lastCategory;
  517.         return $this;
  518.     }
  519.     /**
  520.      * Get lastCategory
  521.      *
  522.      * @return \CoreBundle\Entity\Category
  523.      */
  524.     public function getLastCategory()
  525.     {
  526.         return $this->lastCategory;
  527.     }
  528.     /**
  529.      * Add group
  530.      *
  531.      * @param \CoreBundle\Entity\GroupStudent $group
  532.      *
  533.      * @return Tutor
  534.      */
  535.     public function addGroup(\CoreBundle\Entity\GroupStudent $group)
  536.     {
  537.         $this->groups[] = $group;
  538.         return $this;
  539.     }
  540.     /**
  541.      * Remove group
  542.      *
  543.      * @param \CoreBundle\Entity\GroupStudent $group
  544.      */
  545.     public function removeGroup(\CoreBundle\Entity\GroupStudent $group)
  546.     {
  547.         $this->groups->removeElement($group);
  548.     }
  549.     /**
  550.      * Get groups
  551.      *
  552.      * @return \Doctrine\Common\Collections\Collection
  553.      */
  554.     public function getGroups()
  555.     {
  556.         return $this->groups;
  557.     }
  558.     /**
  559.      * Add activity
  560.      *
  561.      * @param \CoreBundle\Entity\Activity $activity
  562.      *
  563.      * @return Tutor
  564.      */
  565.     public function addActivity(\CoreBundle\Entity\Activity $activity)
  566.     {
  567.         $this->activities[] = $activity;
  568.         return $this;
  569.     }
  570.     /**
  571.      * Remove activity
  572.      *
  573.      * @param \CoreBundle\Entity\Activity $activity
  574.      */
  575.     public function removeActivity(\CoreBundle\Entity\Activity $activity)
  576.     {
  577.         $this->activities->removeElement($activity);
  578.     }
  579.     /**
  580.      * Get activities
  581.      *
  582.      * @return \Doctrine\Common\Collections\Collection
  583.      */
  584.     public function getActivities()
  585.     {
  586.         return $this->activities;
  587.     }
  588.     /**
  589.      * Set avatar
  590.      *
  591.      * @param string $avatar
  592.      *
  593.      * @return Tutor
  594.      */
  595.     public function setAvatar($avatar)
  596.     {
  597.         $this->avatar $avatar;
  598.         return $this;
  599.     }
  600.     /**
  601.      * Get avatar
  602.      *
  603.      * @return string
  604.      */
  605.     public function getAvatar()
  606.     {
  607.         return $this->avatar;
  608.     }
  609.     /**
  610.      * Add category
  611.      *
  612.      * @param \CoreBundle\Entity\Category $category
  613.      *
  614.      * @return Tutor
  615.      */
  616.     public function addCategory(\CoreBundle\Entity\Category $category)
  617.     {
  618.         $this->categories[] = $category;
  619.         return $this;
  620.     }
  621.     /**
  622.      * Remove category
  623.      *
  624.      * @param \CoreBundle\Entity\Category $category
  625.      */
  626.     public function removeCategory(\CoreBundle\Entity\Category $category)
  627.     {
  628.         $this->categories->removeElement($category);
  629.     }
  630.     /**
  631.      * Get categories
  632.      *
  633.      * @return \Doctrine\Common\Collections\Collection
  634.      */
  635.     public function getCategories()
  636.     {
  637.         return $this->categories;
  638.     }
  639.     public function addComment(QuestionnaireComment $comment)
  640.     {
  641.         $this->comments[] = $comment;
  642.         return $this;
  643.     }
  644.     public function removeComment(QuestionnaireComment $comment)
  645.     {
  646.         $this->comments->removeElement($comment);
  647.     }
  648.     public function getComments(): Collection
  649.     {
  650.         return $this->comments;
  651.     }
  652.     public function addQuestion(QuestionnaireQcmQuestion $question): self
  653.     {
  654.         $this->questions[] = $question;
  655.         return $this;
  656.     }
  657.     public function removeQuestion(QuestionnaireQcmQuestion $question)
  658.     {
  659.         $this->questions->removeElement($question);
  660.     }
  661.     public function getQuestions(): Collection
  662.     {
  663.         return $this->questions;
  664.     }
  665.     public function addRangeQuestion(QuestionnaireRangeQuestion $rangeQuestion): self
  666.     {
  667.         $this->rangeQuestions[] = $rangeQuestion;
  668.         return $this;
  669.     }
  670.     public function removeRangeQuestion(QuestionnaireRangeQuestion $rangeQuestion)
  671.     {
  672.         $this->rangeQuestions->removeElement($rangeQuestion);
  673.     }
  674.     public function getRangeQuestions(): Collection
  675.     {
  676.         return $this->rangeQuestions;
  677.     }
  678.     /**
  679.      * Set token
  680.      *
  681.      * @param string $token
  682.      *
  683.      * @return Tutor
  684.      */
  685.     public function setToken($token)
  686.     {
  687.         $this->token $token;
  688.         return $this;
  689.     }
  690.     /**
  691.      * Get token
  692.      *
  693.      * @return string
  694.      */
  695.     public function getToken()
  696.     {
  697.         return $this->token;
  698.     }
  699.     /**
  700.      * Set groupId
  701.      *
  702.      * @param integer $groupId
  703.      *
  704.      * @return Tutor
  705.      */
  706.     public function setGroupId($groupId)
  707.     {
  708.         $this->groupId $groupId;
  709.         return $this;
  710.     }
  711.     /**
  712.      * Get groupId
  713.      *
  714.      * @return integer
  715.      */
  716.     public function getGroupId()
  717.     {
  718.         return $this->groupId;
  719.     }
  720.     /**
  721.      * Add secteur
  722.      *
  723.      * @param \CoreBundle\Entity\Secteur $secteur
  724.      *
  725.      * @return Tutor
  726.      */
  727.     public function addSecteur(\CoreBundle\Entity\Secteur $secteur)
  728.     {
  729.         $this->secteurs[] = $secteur;
  730.         return $this;
  731.     }
  732.     /**
  733.      * Remove secteur
  734.      *
  735.      * @param \CoreBundle\Entity\Secteur $secteur
  736.      */
  737.     public function removeSecteur(\CoreBundle\Entity\Secteur $secteur)
  738.     {
  739.         $this->secteurs->removeElement($secteur);
  740.     }
  741.     /**
  742.      * Get secteurs
  743.      *
  744.      * @return \Doctrine\Common\Collections\Collection
  745.      */
  746.     public function getSecteurs()
  747.     {
  748.         return $this->secteurs;
  749.     }
  750.     /**
  751.      * @return string
  752.      */
  753.     public function getPlainPassword()
  754.     {
  755.         return $this->plainPassword;
  756.     }
  757.     /**
  758.      * @param string $plainPassword
  759.      *
  760.      * @return Tutor
  761.      */
  762.     public function setPlainPassword($plainPassword)
  763.     {
  764.         $this->plainPassword $plainPassword;
  765.         return $this;
  766.     }
  767.     /**
  768.      * Add edtLesson
  769.      *
  770.      * @param \CoreBundle\Entity\EdtLesson $edtLesson
  771.      *
  772.      * @return Tutor
  773.      */
  774.     public function addEdtLesson(\CoreBundle\Entity\EdtLesson $edtLesson)
  775.     {
  776.         $this->edtLessons[] = $edtLesson;
  777.         return $this;
  778.     }
  779.     /**
  780.      * Remove edtLesson
  781.      *
  782.      * @param \CoreBundle\Entity\EdtLesson $edtLesson
  783.      */
  784.     public function removeEdtLesson(\CoreBundle\Entity\EdtLesson $edtLesson)
  785.     {
  786.         $this->edtLessons->removeElement($edtLesson);
  787.     }
  788.     /**
  789.      * Get edtLessons
  790.      *
  791.      * @return \Doctrine\Common\Collections\Collection
  792.      */
  793.     public function getEdtLessons()
  794.     {
  795.         return $this->edtLessons;
  796.     }
  797.     /**
  798.      * Add calendar
  799.      *
  800.      * @param \CoreBundle\Entity\Calendar $calendar
  801.      *
  802.      * @return Tutor
  803.      */
  804.     public function addCalendar(\CoreBundle\Entity\Calendar $calendar)
  805.     {
  806.         $this->calendars[] = $calendar;
  807.         return $this;
  808.     }
  809.     /**
  810.      * Remove calendar
  811.      *
  812.      * @param \CoreBundle\Entity\Calendar $calendar
  813.      */
  814.     public function removeCalendar(\CoreBundle\Entity\Calendar $calendar)
  815.     {
  816.         $this->calendars->removeElement($calendar);
  817.     }
  818.     /**
  819.      * Get calendars
  820.      *
  821.      * @return \Doctrine\Common\Collections\Collection
  822.      */
  823.     public function getCalendars()
  824.     {
  825.         return $this->calendars;
  826.     }
  827.     /**
  828.      * Add calendarEvent
  829.      *
  830.      * @param \CoreBundle\Entity\CalendarEvent $calendarEvent
  831.      *
  832.      * @return Tutor
  833.      */
  834.     public function addCalendarEvent(\CoreBundle\Entity\CalendarEvent $calendarEvent)
  835.     {
  836.         $this->calendarEvents[] = $calendarEvent;
  837.         return $this;
  838.     }
  839.     /**
  840.      * Remove calendarEvent
  841.      *
  842.      * @param \CoreBundle\Entity\CalendarEvent $calendarEvent
  843.      */
  844.     public function removeCalendarEvent(\CoreBundle\Entity\CalendarEvent $calendarEvent)
  845.     {
  846.         $this->calendarEvents->removeElement($calendarEvent);
  847.     }
  848.     /**
  849.      * Get calendarEvents
  850.      *
  851.      * @return \Doctrine\Common\Collections\Collection
  852.      */
  853.     public function getCalendarEvents()
  854.     {
  855.         return $this->calendarEvents;
  856.     }
  857.     /**
  858.      * Add noteTestGroup
  859.      *
  860.      * @param \CoreBundle\Entity\NoteTestGroup $noteTestGroup
  861.      *
  862.      * @return Tutor
  863.      */
  864.     public function addNoteTestGroup(\CoreBundle\Entity\NoteTestGroup $noteTestGroup)
  865.     {
  866.         $this->noteTestGroups[] = $noteTestGroup;
  867.         return $this;
  868.     }
  869.     /**
  870.      * Remove noteTestGroup
  871.      *
  872.      * @param \CoreBundle\Entity\NoteTestGroup $noteTestGroup
  873.      */
  874.     public function removeNoteTestGroup(\CoreBundle\Entity\NoteTestGroup $noteTestGroup)
  875.     {
  876.         $this->noteTestGroups->removeElement($noteTestGroup);
  877.     }
  878.     /**
  879.      * Get noteTestGroups
  880.      *
  881.      * @return \Doctrine\Common\Collections\Collection
  882.      */
  883.     public function getNoteTestGroups()
  884.     {
  885.         return $this->noteTestGroups;
  886.     }
  887.     /**
  888.      * @return boolean
  889.      */
  890.     public function getApiAccess()
  891.     {
  892.         return $this->apiAccess;
  893.     }
  894.     /**
  895.      * @param boolean $apiAccess
  896.      *
  897.      * @return Tutor
  898.      */
  899.     public function setApiAccess($apiAccess)
  900.     {
  901.         $this->apiAccess $apiAccess;
  902.         return $this;
  903.     }
  904.     /**
  905.      * @return mixed
  906.      */
  907.     public function getActive(): ?bool
  908.     {
  909.         return $this->active;
  910.     }
  911.     /**
  912.      * @param mixed $active
  913.      *
  914.      * @return Tutor
  915.      */
  916.     public function setActive($active)
  917.     {
  918.         $this->active $active;
  919.         return $this;
  920.     }
  921.     /**
  922.      * @return Collection|Module[]
  923.      */
  924.     public function getModules(): Collection
  925.     {
  926.         return $this->modules;
  927.     }
  928.     public function addModule(Module $module): self
  929.     {
  930.         if (!$this->modules->contains($module)) {
  931.             $this->modules[] = $module;
  932.         }
  933.         return $this;
  934.     }
  935.     public function removeModule(Module $module): self
  936.     {
  937.         $this->modules->removeElement($module);
  938.         return $this;
  939.     }
  940.     public function getNoteTestStudents()
  941.     {
  942.         return $this->noteTestStudents;
  943.     }
  944.     public function setNoteTestStudents($noteTestStudents)
  945.     {
  946.         $this->noteTestStudents $noteTestStudents;
  947.         return $this;
  948.     }
  949.     public function addNoteTestStudent(NoteTestStudent $noteTestStudent): self
  950.     {
  951.         if (!$this->noteTestStudents->contains($noteTestStudent)) {
  952.             $this->noteTestStudents[] = $noteTestStudent;
  953.             $noteTestStudent->setTutor($this);
  954.         }
  955.         return $this;
  956.     }
  957.     public function removeNoteTestStudent(NoteTestStudent $noteTestStudent): self
  958.     {
  959.         if ($this->noteTestStudents->removeElement($noteTestStudent)) {
  960.             // set the owning side to null (unless already changed)
  961.             if ($noteTestStudent->getTutor() === $this) {
  962.                 $noteTestStudent->setTutor(null);
  963.             }
  964.         }
  965.         return $this;
  966.     }
  967.     public function getFirebaseToken(): ?string
  968.     {
  969.         return $this->firebaseToken;
  970.     }
  971.     public function setFirebaseToken(?string $firebaseToken): self
  972.     {
  973.         $this->firebaseToken $firebaseToken;
  974.         return $this;
  975.     }
  976.     public function getFirebaseTokenDate(): ?\DateTimeImmutable
  977.     {
  978.         return $this->firebaseTokenDate;
  979.     }
  980.     public function setFirebaseTokenDate(?\DateTimeImmutable $firebaseTokenDate): self
  981.     {
  982.         $this->firebaseTokenDate $firebaseTokenDate;
  983.         return $this;
  984.     }
  985.     public function getQrCode(): ?string
  986.     {
  987.         return $this->qrCode;
  988.     }
  989.     public function setQrCode(?string $qrCode): self
  990.     {
  991.         $this->qrCode $qrCode;
  992.         return $this;
  993.     }
  994.     public function getQrCodeDate(): ?\DateTimeImmutable
  995.     {
  996.         return $this->qrCodeDate;
  997.     }
  998.     public function setQrCodeDate(?\DateTimeImmutable $qrCodeDate): self
  999.     {
  1000.         $this->qrCodeDate $qrCodeDate;
  1001.         return $this;
  1002.     }
  1003.     public function isAdmin(): ?bool
  1004.     {
  1005.         return $this->admin;
  1006.     }
  1007.     public function isActive(): ?bool
  1008.     {
  1009.         return $this->active;
  1010.     }
  1011.     public function isApiAccess(): ?bool
  1012.     {
  1013.         return $this->apiAccess;
  1014.     }
  1015.     /**
  1016.      * @return Collection<int, NoteTestStudentLog>
  1017.      */
  1018.     public function getNoteTestStudentLogs(): Collection
  1019.     {
  1020.         return $this->noteTestStudentLogs;
  1021.     }
  1022.     public function addNoteTestStudentLog(NoteTestStudentLog $noteTestStudentLog): self
  1023.     {
  1024.         if (!$this->noteTestStudentLogs->contains($noteTestStudentLog)) {
  1025.             $this->noteTestStudentLogs->add($noteTestStudentLog);
  1026.             $noteTestStudentLog->setTutor($this);
  1027.         }
  1028.         return $this;
  1029.     }
  1030.     public function removeNoteTestStudentLog(NoteTestStudentLog $noteTestStudentLog): self
  1031.     {
  1032.         if ($this->noteTestStudentLogs->removeElement($noteTestStudentLog)) {
  1033.             // set the owning side to null (unless already changed)
  1034.             if ($noteTestStudentLog->getTutor() === $this) {
  1035.                 $noteTestStudentLog->setTutor(null);
  1036.             }
  1037.         }
  1038.         return $this;
  1039.     }
  1040. }