<?php
namespace App\Entity;
use App\Repository\UserRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
use Symfony\Component\Security\Core\User\UserInterface;
#[ORM\Entity(repositoryClass: UserRepository::class)]
#[UniqueEntity('phone', message: 'Le numéro de téléphone est déjà utilisé')]
class User implements UserInterface, PasswordAuthenticatedUserInterface
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 180, unique: true)]
private ?string $phone = null;
#[ORM\Column]
private ?array $roles = [];
/**
* @var string|null The hashed password
*/
#[ORM\Column(nullable: true)]
private ?string $password = null;
#[ORM\Column(length: 255)]
private ?string $firstname = null;
#[ORM\Column(length: 255)]
private ?string $lastname = null;
#[ORM\Column(type: Types::DATE_MUTABLE, nullable: true)]
private ?\DateTimeInterface $birthday = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $adress = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $adressBis = null;
#[ORM\Column(nullable: true)]
private ?int $zipcode = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $city = null;
#[ORM\Column(length: 255)]
private ?string $email = null;
#[ORM\Column(type: Types::DATE_MUTABLE, nullable: true)]
private ?\DateTimeInterface $created_at = null;
#[ORM\Column(type: Types::DATE_MUTABLE, nullable: true)]
private ?\DateTimeInterface $edited_at = null;
#[ORM\Column(nullable: true)]
private ?bool $handicapped = false;
#[ORM\Column(length: 1024, nullable: true)]
private ?string $reset_token = null;
#[ORM\Column]
private ?bool $enabled = false;
#[ORM\Column(nullable: true)]
private ?int $admission = null;
#[ORM\Column(length: 1, nullable: true)]
private ?string $ranking = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $situation = null;
#[ORM\Column]
private ?bool $drivinglicence = false;
#[ORM\Column(length: 255, nullable: true)]
private ?string $rgpd = null;
#[ORM\Column]
private ?bool $hasCompany = false;
#[ORM\Column(type:'string', length: 255, nullable: true)]
private ?string $countryCode = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $verificationCode = null;
#[ORM\Column]
private ?bool $verified = false;
#[ORM\ManyToOne(inversedBy: 'User')]
private ?Progress $progress = null;
#[ORM\OneToMany(mappedBy: 'User', targetEntity: Attachments::class)]
private Collection $attachments;
#[ORM\OneToMany(mappedBy: 'user', targetEntity: LogUser::class)]
private Collection $logUsers;
#[ORM\Column(nullable: true)]
private ?bool $parcourssup = false;
#[ORM\ManyToOne(inversedBy: 'users')]
private ?Training $training = null;
#[ORM\OneToMany(mappedBy: 'user', targetEntity: MCQResult::class)]
private Collection $mCQResults;
#[ORM\OneToMany(mappedBy: 'user', targetEntity: Score::class)]
private Collection $scores;
#[ORM\OneToMany(mappedBy: 'user', targetEntity: StudentResponse::class)]
private Collection $studentResponses;
#[ORM\OneToMany(mappedBy: 'user', targetEntity: LogAttachments::class)]
private Collection $logAttachments;
#[ORM\Column(nullable: true)]
private ?bool $validatedPj = false;
#[ORM\Column(nullable: true)]
private ?bool $mCQValid = false;
#[ORM\ManyToOne(inversedBy: 'users')]
private ?AdmissionCategory $admissionCategory = null;
#[ORM\OneToMany(mappedBy: 'user', targetEntity: Commitment::class)]
private Collection $commitments;
#[ORM\OneToMany(mappedBy: 'user', targetEntity: Application::class)]
private Collection $applications;
#[ORM\OneToMany(mappedBy: 'user', targetEntity: MCQQuestionsStorage::class)]
private Collection $mcqQuestionsStorages;
#[ORM\ManyToMany(targetEntity: Appointment::class, mappedBy: 'user')]
private Collection $appointments;
#[ORM\OneToMany(mappedBy: 'user', targetEntity: AppointmentsCheck::class)]
private Collection $appointmentsChecks;
#[ORM\OneToMany(mappedBy: 'user', targetEntity: BookCv::class)]
private Collection $bookCvs;
#[ORM\Column(nullable: true)]
private ?bool $waitCommitment = false;
#[ORM\OneToMany(mappedBy: 'user', targetEntity: HistoryUser::class)]
private Collection $historyUsers;
#[ORM\OneToMany(mappedBy: 'user', targetEntity: AcapellaDemand::class)]
private Collection $acapellaDemands;
#[ORM\Column(nullable: true)]
private ?bool $commimtmentInfo = false;
#[ORM\OrderBy(['createdAt' => 'DESC'])]
#[ORM\OneToMany(mappedBy: 'user', targetEntity: UserComment::class)]
private Collection $userComments;
#[ORM\Column(nullable: true)]
private ?string $id_ypareo = null;
#[ORM\Column]
private ?bool $poursuite = false;
#[ORM\OneToMany(mappedBy: 'User', targetEntity: ComplementaryPj::class)]
private Collection $complementaryPjs;
#[ORM\OneToMany(mappedBy: 'user', targetEntity: AttachmentsAf::class)]
private Collection $attachmentsAfs;
#[ORM\OneToMany(mappedBy: 'users', targetEntity: LegalRepresentative::class)]
private Collection $legalRepresentatives;
#[ORM\Column(length: 255, nullable: true)]
private ?string $lastSchoolName = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $brevoId = null;
#[ORM\OneToMany(mappedBy: 'user', targetEntity: LogSms::class)]
private Collection $sms;
public function __construct()
{
$this->attachments = new ArrayCollection();
$this->logUsers = new ArrayCollection();
$this->mCQResults = new ArrayCollection();
$this->scores = new ArrayCollection();
$this->studentResponses = new ArrayCollection();
$this->logAttachments = new ArrayCollection();
$this->commitments = new ArrayCollection();
$this->applications = new ArrayCollection();
$this->mcqQuestionsStorages = new ArrayCollection();
$this->appointments = new ArrayCollection();
$this->appointmentsChecks = new ArrayCollection();
$this->bookCvs = new ArrayCollection();
$this->historyUsers = new ArrayCollection();
$this->acapellaDemands = new ArrayCollection();
$this->userComments = new ArrayCollection();
$this->complementaryPjs = new ArrayCollection();
$this->attachmentsAfs = new ArrayCollection();
$this->legalRepresentatives = new ArrayCollection();
$this->sms = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getPhone(): ?string
{
return $this->phone;
}
public function setPhone(string $phone): self
{
$this->phone = $phone;
return $this;
}
/**
* A visual identifier that represents this user.
*
* @see UserInterface
*/
public function getUserIdentifier(): string
{
return (string) $this->phone;
}
/**
* @see UserInterface
*/
public function getRoles(): array
{
$roles = $this->roles;
// guarantee every user at least has ROLE_USER
$roles[] = 'ROLE_USER';
return array_unique($roles);
}
public function setRoles(array $roles): self
{
$this->roles = $roles;
return $this;
}
/**
* @see PasswordAuthenticatedUserInterface
*/
public function getPassword(): string
{
return $this->password;
}
public function setPassword(string $password): self
{
$this->password = $password;
return $this;
}
/**
* @see UserInterface
*/
public function eraseCredentials()
{
// If you store any temporary, sensitive data on the user, clear it here
// $this->plainPassword = null;
}
public function getFirstname(): ?string
{
return $this->firstname;
}
public function setFirstname(string $firstname): self
{
$this->firstname = $firstname;
return $this;
}
public function getLastname(): ?string
{
return $this->lastname;
}
public function setLastname(string $lastname): self
{
$this->lastname = $lastname;
return $this;
}
public function getBirthday(): ?\DateTimeInterface
{
return $this->birthday;
}
public function setBirthday(?\DateTimeInterface $birthday): self
{
$this->birthday = $birthday;
return $this;
}
public function getAdress(): ?string
{
return $this->adress;
}
public function setAdress(string $adress): self
{
$this->adress = $adress;
return $this;
}
public function getAdressBis(): ?string
{
return $this->adressBis;
}
public function setAdressBis(string $adressBis): self
{
$this->adressBis = $adressBis;
return $this;
}
public function getZipcode(): ?int
{
return $this->zipcode;
}
public function setZipcode(int $zipcode): self
{
$this->zipcode = $zipcode;
return $this;
}
public function getCity(): ?string
{
return $this->city;
}
public function setCity(string $city): self
{
$this->city = $city;
return $this;
}
public function getEmail(): ?string
{
return $this->email;
}
public function setEmail(string $email): self
{
$this->email = $email;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->created_at;
}
public function setCreatedAt(\DateTimeInterface $created_at): self
{
$this->created_at = $created_at;
return $this;
}
public function getEditedAt(): ?\DateTimeInterface
{
return $this->edited_at;
}
public function setEditedAt(\DateTimeInterface $edited_at): self
{
$this->edited_at = $edited_at;
return $this;
}
public function isHandicapped(): ?bool
{
return $this->handicapped;
}
public function setHandicapped(bool $handicapped): self
{
$this->handicapped = $handicapped;
return $this;
}
public function getResetToken(): ?string
{
return $this->reset_token;
}
public function setResetToken(string $reset_token): self
{
$this->reset_token = $reset_token;
return $this;
}
public function isEnabled(): ?bool
{
return $this->enabled;
}
public function setEnabled(bool $enabled): self
{
$this->enabled = $enabled;
return $this;
}
public function getAdmission(): ?int
{
return $this->admission;
}
public function setAdmission(int $admission): self
{
$this->admission = $admission;
return $this;
}
public function getRanking(): ?string
{
return $this->ranking;
}
public function setRanking(string $ranking): self
{
$this->ranking = $ranking;
return $this;
}
public function getSituation(): ?string
{
return $this->situation;
}
public function setSituation(string $situation): self
{
$this->situation = $situation;
return $this;
}
public function isDrivinglicence(): ?bool
{
return $this->drivinglicence;
}
public function setDrivinglicence(bool $drivinglicence): self
{
$this->drivinglicence = $drivinglicence;
return $this;
}
public function getRgpd(): ?string
{
return $this->rgpd;
}
public function setRgpd(?string $rgpd): self
{
$this->rgpd = $rgpd;
return $this;
}
public function isHasCompany(): ?bool
{
return $this->hasCompany;
}
public function setHasCompany(bool $hasCompany): self
{
$this->hasCompany = $hasCompany;
return $this;
}
public function getCountryCode(): ?string
{
return $this->countryCode;
}
public function setCountryCode(string $countryCode): self
{
$this->countryCode = $countryCode;
return $this;
}
public function getVerificationCode(): ?string
{
return $this->verificationCode;
}
public function setVerificationCode(?string $verificationCode): self
{
$this->verificationCode = $verificationCode;
return $this;
}
public function getVerified(): ?bool
{
return $this->verified;
}
public function setVerified(bool $verified): self
{
$this->verified = $verified;
return $this;
}
public function getProgress(): ?Progress
{
return $this->progress;
}
public function setProgress(?Progress $progress): self
{
$this->progress = $progress;
return $this;
}
/**
* @return Collection<int, Attachments>
*/
public function getAttachments(): Collection
{
return $this->attachments;
}
public function addAttachment(Attachments $attachment): self
{
if (!$this->attachments->contains($attachment)) {
$this->attachments->add($attachment);
$attachment->setUser($this);
}
return $this;
}
public function removeAttachment(Attachments $attachment): self
{
if ($this->attachments->removeElement($attachment)) {
// set the owning side to null (unless already changed)
if ($attachment->getUser() === $this) {
$attachment->setUser(null);
}
}
return $this;
}
/**
* @return Collection<int, LogUser>
*/
public function getLogUsers(): Collection
{
return $this->logUsers;
}
public function addLogUser(LogUser $logUser): self
{
if (!$this->logUsers->contains($logUser)) {
$this->logUsers->add($logUser);
$logUser->setUser($this);
}
return $this;
}
public function removeLogUser(LogUser $logUser): self
{
if ($this->logUsers->removeElement($logUser)) {
// set the owning side to null (unless already changed)
if ($logUser->getUser() === $this) {
$logUser->setUser(null);
}
}
return $this;
}
public function isParcourssup(): ?bool
{
return $this->parcourssup;
}
public function setParcourssup(bool $parcourssup): self
{
$this->parcourssup = $parcourssup;
return $this;
}
public function getTraining(): ?Training
{
return $this->training;
}
public function setTraining(?Training $training): self
{
$this->training = $training;
return $this;
}
/**
* @return Collection<int, MCQResult>
*/
public function getMCQResults(): Collection
{
return $this->mCQResults;
}
public function addMCQResult(MCQResult $mCQResult): self
{
if (!$this->mCQResults->contains($mCQResult)) {
$this->mCQResults->add($mCQResult);
$mCQResult->setUser($this);
}
return $this;
}
/**
* @return Collection<int, MCQQuestionsStorage>
*/
public function getMcqQuestionsStorages(): Collection
{
return $this->mcqQuestionsStorages;
}
public function addMcqQuestionsStorages(MCQQuestionsStorage $mcqQuestionsStorages): self
{
if (!$this->mcqQuestionsStorages->contains($mcqQuestionsStorages)) {
$this->mcqQuestionsStorages->add($mcqQuestionsStorages);
$mcqQuestionsStorages->setUser($this);
}
return $this;
}
public function removeMCQResult(MCQResult $mCQResult): self
{
if ($this->mCQResults->removeElement($mCQResult)) {
// set the owning side to null (unless already changed)
if ($mCQResult->getUser() === $this) {
$mCQResult->setUser(null);
}
}
return $this;
}
public function removeMcqQuestionsStorages(MCQQuestionsStorage $mcqQuestionsStorages): self
{
if ($this->mcqQuestionsStorages->removeElement($mcqQuestionsStorages)) {
// set the owning side to null (unless already changed)
if ($mcqQuestionsStorages->getUser() === $this) {
$mcqQuestionsStorages->setUser(null);
}
}
return $this;
}
/**
* @return Collection<int, Score>
*/
public function getScores(): Collection
{
return $this->scores;
}
public function addScore(Score $score): self
{
if (!$this->scores->contains($score)) {
$this->scores->add($score);
$score->setUser($this);
}
return $this;
}
public function removeScore(Score $score): self
{
if ($this->scores->removeElement($score)) {
// set the owning side to null (unless already changed)
if ($score->getUser() === $this) {
$score->setUser(null);
}
}
return $this;
}
/**
* @return Collection<int, StudentResponse>
*/
public function getStudentResponses(): Collection
{
return $this->studentResponses;
}
public function addStudentResponse(StudentResponse $studentResponse): self
{
if (!$this->studentResponses->contains($studentResponse)) {
$this->studentResponses->add($studentResponse);
$studentResponse->setUser($this);
}
return $this;
}
public function removeStudentResponse(StudentResponse $studentResponse): self
{
if ($this->studentResponses->removeElement($studentResponse)) {
// set the owning side to null (unless already changed)
if ($studentResponse->getUser() === $this) {
$studentResponse->setUser(null);
}
}
return $this;
}
/**
* @return Collection<int, LogAttachments>
*/
public function getLogAttachments(): Collection
{
return $this->logAttachments;
}
public function addLogAttachment(LogAttachments $logAttachment): self
{
if (!$this->logAttachments->contains($logAttachment)) {
$this->logAttachments->add($logAttachment);
$logAttachment->setUser($this);
}
return $this;
}
public function removeLogAttachment(LogAttachments $logAttachment): self
{
if ($this->logAttachments->removeElement($logAttachment)) {
// set the owning side to null (unless already changed)
if ($logAttachment->getUser() === $this) {
$logAttachment->setUser(null);
}
}
return $this;
}
public function isValidatedPj(): ?bool
{
return $this->validatedPj;
}
public function setValidatedPj(bool $validatedPj): self
{
$this->validatedPj = $validatedPj;
return $this;
}
public function isMCQValid(): ?bool
{
return $this->mCQValid;
}
public function setMCQValid(?bool $mCQValid): self
{
$this->mCQValid = $mCQValid;
return $this;
}
public function getAdmissionCategory(): ?AdmissionCategory
{
return $this->admissionCategory;
}
public function setAdmissionCategory(?AdmissionCategory $admissionCategory): self
{
$this->admissionCategory = $admissionCategory;
return $this;
}
/**
* @return Collection<int, Commitment>
*/
public function getCommitments(): Collection
{
return $this->commitments;
}
public function addCommitment(Commitment $commitment): self
{
if (!$this->commitments->contains($commitment)) {
$this->commitments->add($commitment);
$commitment->setUser($this);
}
return $this;
}
public function removeCommitment(Commitment $commitment): self
{
if ($this->commitments->removeElement($commitment)) {
// set the owning side to null (unless already changed)
if ($commitment->getUser() === $this) {
$commitment->setUser(null);
}
}
return $this;
}
/**
* @return Collection<int, Application>
*/
public function getApplications(): Collection
{
return $this->applications;
}
public function addApplication(Application $application): self
{
if (!$this->applications->contains($application)) {
$this->applications->add($application);
$application->setUser($this);
}
return $this;
}
public function removeApplication(Application $application): self
{
if ($this->applications->removeElement($application)) {
// set the owning side to null (unless already changed)
if ($application->getUser() === $this) {
$application->setUser(null);
}
}
return $this;
}
/**
* @return Collection<int, Appointment>
*/
public function getAppointments(): Collection
{
return $this->appointments;
}
public function addAppointment(Appointment $appointment): self
{
if (!$this->appointments->contains($appointment)) {
$this->appointments->add($appointment);
$appointment->addUser($this);
}
return $this;
}
public function removeAppointment(Appointment $appointment): self
{
if ($this->appointments->removeElement($appointment)) {
$appointment->removeUser($this);
}
return $this;
}
/**
* @return Collection<int, AppointmentsCheck>
*/
public function getAppointmentsChecks(): Collection
{
return $this->appointmentsChecks;
}
public function addAppointmentsChecks(AppointmentsCheck $appointmentsCheck): self
{
if (!$this->appointmentsChecks->contains($appointmentsCheck)) {
$this->appointmentsChecks->add($appointmentsCheck);
$appointmentsCheck->setUser($this);
}
return $this;
}
public function removeAppointmentsChecks(AppointmentsCheck $appointmentsCheck): self
{
if ($this->appointmentsChecks->removeElement($appointmentsCheck)) {
// set the owning side to null (unless already changed)
if ($appointmentsCheck->getUser() === $this) {
$appointmentsCheck->setUser(null);
}
}
return $this;
}
/**
* @return Collection<int, BookCv>
*/
public function getBookCvs(): Collection
{
return $this->bookCvs;
}
public function addBookCv(BookCv $bookCv): self
{
if (!$this->bookCvs->contains($bookCv)) {
$this->bookCvs->add($bookCv);
$bookCv->setUser($this);
}
return $this;
}
public function removeBookCv(BookCv $bookCv): self
{
if ($this->bookCvs->removeElement($bookCv)) {
// set the owning side to null (unless already changed)
if ($bookCv->getUser() === $this) {
$bookCv->setUser(null);
}
}
return $this;
}
public function isWaitCommitment(): ?bool
{
return $this->waitCommitment;
}
public function setWaitCommitment(?bool $waitCommitment): self
{
$this->waitCommitment = $waitCommitment;
return $this;
}
/**
* @return Collection<int, HistoryUser>
*/
public function getHistoryUsers(): Collection
{
return $this->historyUsers;
}
public function addHistoryUser(HistoryUser $historyUser): self
{
if (!$this->historyUsers->contains($historyUser)) {
$this->historyUsers->add($historyUser);
$historyUser->setUser($this);
}
return $this;
}
public function removeHistoryUser(HistoryUser $historyUser): self
{
if ($this->historyUsers->removeElement($historyUser)) {
// set the owning side to null (unless already changed)
if ($historyUser->getUser() === $this) {
$historyUser->setUser(null);
}
}
return $this;
}
/**
* @return Collection<int, AcapellaDemand>
*/
public function getAcapellaDemands(): Collection
{
return $this->acapellaDemands;
}
public function addAcapellaDemand(AcapellaDemand $acapellaDemand): self
{
if (!$this->acapellaDemands->contains($acapellaDemand)) {
$this->acapellaDemands->add($acapellaDemand);
$acapellaDemand->setUser($this);
}
return $this;
}
public function removeAcapellaDemand(AcapellaDemand $acapellaDemand): self
{
if ($this->acapellaDemands->removeElement($acapellaDemand)) {
// set the owning side to null (unless already changed)
if ($acapellaDemand->getUser() === $this) {
$acapellaDemand->setUser(null);
}
}
return $this;
}
public function isCommimtmentInfo(): ?bool
{
return $this->commimtmentInfo;
}
public function setCommimtmentInfo(?bool $commimtmentInfo): self
{
$this->commimtmentInfo = $commimtmentInfo;
return $this;
}
/**
* @return Collection<int, UserComment>
*/
public function getUserComments(): Collection
{
return $this->userComments;
}
public function addUserComment(UserComment $userComment): self
{
if (!$this->userComments->contains($userComment)) {
$this->userComments->add($userComment);
$userComment->setUser($this);
}
return $this;
}
public function removeUserComment(UserComment $userComment): self
{
if ($this->userComments->removeElement($userComment)) {
// set the owning side to null (unless already changed)
if ($userComment->getUser() === $this) {
$userComment->setUser(null);
}
}
return $this;
}
public function getIdYpareo(): ?string
{
return $this->id_ypareo;
}
public function setIdYpareo(?string $id_ypareo): self
{
$this->id_ypareo = $id_ypareo;
return $this;
}
public function toYpareo(?array $u_ypareo): self
{
if ($u_ypareo['adresse']['tel2'] != null) {
$this->setPhone($u_ypareo['adresse']['tel2']);
} else {
$this->setPhone($u_ypareo['adresse']['tel1']);
}
$mystringBirthday = str_replace("/", "-", $u_ypareo['dateNaissanceApprenant']);
$newDateString = new \DateTimeImmutable($mystringBirthday);
$this->setFirstname($u_ypareo['prenomApprenant']);
$this->setLastname($u_ypareo['nomApprenant']);
$this->setBirthday($newDateString);
$this->setAdress($u_ypareo['adresse']['adr1']);
$this->setCity($u_ypareo['adresse']['ville']);
$this->setZipcode($u_ypareo['adresse']['cp']);
$this->setEmail($u_ypareo['adresse']['email']);
$this->setHasCompany(false);
// $this->setStep(1);
$this->setHandicapped(false);
$this->setIdYpareo($u_ypareo['codeApprenant']);
return $this;
}
public function isPoursuite(): ?bool
{
return $this->poursuite;
}
public function setPoursuite(bool $poursuite): self
{
$this->poursuite = $poursuite;
return $this;
}
/**
* @return Collection<int, ComplementaryPj>
*/
public function getComplementaryPjs(): Collection
{
return $this->complementaryPjs;
}
public function addComplementaryPj(ComplementaryPj $complementaryPj): self
{
if (!$this->complementaryPjs->contains($complementaryPj)) {
$this->complementaryPjs->add($complementaryPj);
$complementaryPj->setUser($this);
}
return $this;
}
public function removeComplementaryPj(ComplementaryPj $complementaryPj): self
{
if ($this->complementaryPjs->removeElement($complementaryPj)) {
// set the owning side to null (unless already changed)
if ($complementaryPj->getUser() === $this) {
$complementaryPj->setUser(null);
}
}
return $this;
}
/**
* @return Collection<int, AttachmentsAf>
*/
public function getAttachmentsAfs(): Collection
{
return $this->attachmentsAfs;
}
public function addAttachmentsAf(AttachmentsAf $attachmentsAf): self
{
if (!$this->attachmentsAfs->contains($attachmentsAf)) {
$this->attachmentsAfs->add($attachmentsAf);
$attachmentsAf->setUser($this);
}
return $this;
}
public function removeAttachmentsAf(AttachmentsAf $attachmentsAf): self
{
if ($this->attachmentsAfs->removeElement($attachmentsAf)) {
// set the owning side to null (unless already changed)
if ($attachmentsAf->getUser() === $this) {
$attachmentsAf->setUser(null);
}
}
return $this;
}
/**
* @return Collection<int, LegalRepresentative>
*/
public function getLegalRepresentatives(): Collection
{
return $this->legalRepresentatives;
}
public function addLegalRepresentative(LegalRepresentative $legalRepresentative): self
{
if (!$this->legalRepresentatives->contains($legalRepresentative)) {
$this->legalRepresentatives->add($legalRepresentative);
$legalRepresentative->setUsers($this);
}
return $this;
}
public function removeLegalRepresentative(LegalRepresentative $legalRepresentative): self
{
if ($this->legalRepresentatives->removeElement($legalRepresentative)) {
// set the owning side to null (unless already changed)
if ($legalRepresentative->getUsers() === $this) {
$legalRepresentative->setUsers(null);
}
}
return $this;
}
public function getLastSchoolName(): ?string
{
return $this->lastSchoolName;
}
public function setLastSchoolName(?string $lastSchoolName): self
{
$this->lastSchoolName = $lastSchoolName;
return $this;
}
public function getBrevoId(): ?string
{
return $this->brevoId;
}
public function setBrevoId(?string $brevoId): self
{
$this->brevoId = $brevoId;
return $this;
}
/**
* @return Collection<int, LogSms>
*/
public function getSms(): Collection
{
return $this->sms;
}
public function addSms(LogSms $sms): static
{
if (!$this->sms->contains($sms)) {
$this->sms->add($sms);
$sms->setUser($this);
}
return $this;
}
public function removeSms(LogSms $sms): static
{
if ($this->sms->removeElement($sms)) {
// set the owning side to null (unless already changed)
if ($sms->getUser() === $this) {
$sms->setUser(null);
}
}
return $this;
}
}