<?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\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
use Symfony\Component\Security\Core\User\UserInterface;
use Symfony\Component\Validator\Constraints\Cascade;
#[ORM\Entity(repositoryClass: UserRepository::class)]
class User implements UserInterface, PasswordAuthenticatedUserInterface
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'string', length: 180, unique: true)]
private $email;
#[ORM\Column(type: 'json')]
private $roles = [];
#[ORM\Column(type: 'string', nullable: true)]
private $password;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $lastname;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $firstname;
#[ORM\Column(type: 'boolean')]
private $is_active;
#[ORM\Column(type: 'boolean')]
private $is_optin;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $token = null;
#[ORM\Column(type: 'datetime_immutable')]
private $created_at;
#[ORM\Column(type: 'boolean')]
private $is_dark_mode;
#[ORM\OneToMany(mappedBy: 'user', targetEntity: UserLog::class)]
private $userLogs;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $telephone;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $adeli;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $adresse;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $complementAdresse;
#[ORM\Column(type: 'string', nullable: true)]
private $zip;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $ville;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $siret;
#[ORM\Column(type: 'array', nullable: true)]
private $asso;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $diplome;
#[ORM\Column(type: 'array', nullable: true)]
private $specialite = [];
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $anneeDiplome;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $statuts;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $asso_autre;
#[ORM\Column(type: 'date', nullable: true)]
private $naissance;
#[ORM\OneToMany(mappedBy: 'user', targetEntity: Abonnement::class)]
private $abonnements;
#[ORM\ManyToMany(targetEntity: Praticien::class, inversedBy: 'users')]
private $Praticiens;
#[ORM\OneToMany(mappedBy: 'user', targetEntity: Subscription::class)]
private Collection $subscriptions;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $registerToken = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $profil = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $data = null;
#[ORM\ManyToMany(targetEntity: Prescription::class, inversedBy: 'users')]
private Collection $prescriptions;
#[ORM\OneToMany(mappedBy: 'user', targetEntity: Consultation::class)]
private Collection $consultations;
#[ORM\ManyToOne(targetEntity: self::class, inversedBy: 'medecins')]
private ?self $medecin = null;
#[ORM\OneToMany(mappedBy: 'medecin', targetEntity: self::class)]
private Collection $medecins;
#[ORM\Column(length: 255, nullable: true)]
private ?string $diplome_copy = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $adeli_certif = null;
#[ORM\ManyToOne(inversedBy: 'users')]
private ?DataStatus $status = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $stripe_id = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $comment = null;
#[ORM\Column]
private ?bool $optinContact = null;
#[ORM\Column]
private ?bool $optinConsentement = null;
#[ORM\Column(type: Types::DATE_MUTABLE, nullable: true)]
private ?\DateTimeInterface $optinConsentementDate = null;
#[ORM\OneToMany(mappedBy: 'user', targetEntity: Praticien::class)]
private Collection $praticiens;
#[ORM\Column(length: 255, nullable: true)]
private ?string $family = null;
#[ORM\Column(nullable: true)]
private ?bool $children = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $nb_child = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $job = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $job_detail = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $schedules = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $gender = null;
#[ORM\OneToMany(mappedBy: 'patient', targetEntity: DocumentPatient::class)]
private Collection $documents;
#[ORM\Column(nullable: true)]
private ?\DateTimeImmutable $deleteAccountAt = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $logo = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $country = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $office = null;
#[ORM\OneToMany(mappedBy: 'user', targetEntity: QuestionnairePatient::class, cascade: ["persist", "remove"])]
private Collection $questionnairesPatient;
#[ORM\Column(length: 255, nullable: true)]
private ?string $specialite_autre = null;
#[ORM\OneToMany(mappedBy: 'patient', targetEntity: NoteHonoraire::class)]
private Collection $notesHonoraires;
#[ORM\Column(length: 255, nullable: true)]
private ?string $signature = null;
#[ORM\OneToMany(mappedBy: 'patient', targetEntity: DocumentSaved::class)]
private Collection $documentSaveds;
#[ORM\OneToMany(mappedBy: 'patient', targetEntity: DocumentUploaded::class)]
private Collection $documentUploadeds;
#[ORM\Column(length: 255, nullable: true)]
private ?string $website = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $price_number = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $price_letter = null;
#[ORM\Column(type: 'text', nullable: true)]
private ?string $notes = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $price_number_2 = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $price_letter_2 = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $notePraticien = null;
public function __construct()
{
$this->userLogs = new ArrayCollection();
$this->abonnements = new ArrayCollection();
$this->Praticiens = new ArrayCollection();
$this->subscriptions = new ArrayCollection();
$this->prescriptions = new ArrayCollection();
$this->consultations = new ArrayCollection();
$this->medecins = new ArrayCollection();
$this->praticiens = new ArrayCollection();
$this->documents = new ArrayCollection();
$this->questionnaires = new ArrayCollection();
$this->questionnairesPatient = new ArrayCollection();
$this->notesHonoraires = new ArrayCollection();
$this->documentSaveds = new ArrayCollection();
$this->documentUploadeds = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getEmail(): ?string
{
return $this->email;
}
public function setEmail(string $email): self
{
$this->email = $email;
return $this;
}
/**
* A visual identifier that represents this user.
*
* @see UserInterface
*/
public function getUserIdentifier(): string
{
return (string) $this->email;
}
/**
* @see UserInterface
*/
public function getRoles(): array
{
$roles = $this->roles;
// guarantee every user at least has ROLE_USER & ROLE_PATIENT
$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 getLastname(): ?string
{
return $this->lastname;
}
public function setLastname(?string $lastname): self
{
$this->lastname = $lastname;
return $this;
}
public function getFirstname(): ?string
{
return $this->firstname;
}
public function setFirstname(?string $firstname): self
{
$this->firstname = $firstname;
return $this;
}
public function getIsActive(): ?bool
{
return $this->is_active;
}
public function setIsActive(bool $is_active): self
{
$this->is_active = $is_active;
return $this;
}
public function getIsOptin(): ?bool
{
return $this->is_optin;
}
public function setIsOptin(bool $is_optin): self
{
$this->is_optin = $is_optin;
return $this;
}
public function getToken(): ?string
{
return $this->token;
}
public function setToken(?string $token): self
{
$this->token = $token;
return $this;
}
public function getCreatedAt(): ?\DateTimeImmutable
{
return $this->created_at;
}
public function setCreatedAt(\DateTimeImmutable $created_at): self
{
$this->created_at = $created_at;
return $this;
}
public function getIsDarkMode(): ?bool
{
return $this->is_dark_mode;
}
public function setIsDarkMode(bool $is_dark_mode): self
{
$this->is_dark_mode = $is_dark_mode;
return $this;
}
/**
* @return Collection<int, UserLog>
*/
public function getUserLogs(): Collection
{
return $this->userLogs;
}
public function addUserLog(UserLog $userLog): self
{
if (!$this->userLogs->contains($userLog)) {
$this->userLogs[] = $userLog;
$userLog->setUser($this);
}
return $this;
}
public function removeUserLog(UserLog $userLog): self
{
if ($this->userLogs->removeElement($userLog)) {
// set the owning side to null (unless already changed)
if ($userLog->getUser() === $this) {
$userLog->setUser(null);
}
}
return $this;
}
public function isIsActive(): ?bool
{
return $this->is_active;
}
public function isIsOptin(): ?bool
{
return $this->is_optin;
}
public function isIsDarkMode(): ?bool
{
return $this->is_dark_mode;
}
public function getTelephone(): ?string
{
return $this->telephone;
}
public function setTelephone(?string $telephone): self
{
$this->telephone = $telephone;
return $this;
}
public function getAdeli(): ?string
{
return $this->adeli;
}
public function setAdeli(string $adeli): self
{
$this->adeli = $adeli;
return $this;
}
public function getAdresse(): ?string
{
return $this->adresse;
}
public function setAdresse(?string $adresse): self
{
$this->adresse = $adresse;
return $this;
}
public function getComplementAdresse(): ?string
{
return $this->complementAdresse;
}
public function setComplementAdresse(?string $complementAdresse): self
{
$this->complementAdresse = $complementAdresse;
return $this;
}
public function getZip(): ?string
{
return $this->zip;
}
public function setZip(?string $zip): self
{
$this->zip = $zip;
return $this;
}
public function getVille(): ?string
{
return $this->ville;
}
public function setVille(?string $ville): self
{
$this->ville = $ville;
return $this;
}
public function getSiret(): ?string
{
return $this->siret;
}
public function setSiret(?string $siret): self
{
$this->siret = $siret;
return $this;
}
public function getAsso(): ?array
{
return $this->asso;
}
public function setAsso(?array $asso): self
{
$this->asso = $asso;
return $this;
}
public function getDiplome(): ?string
{
return $this->diplome;
}
public function setDiplome(?string $diplome): self
{
$this->diplome = $diplome;
return $this;
}
public function getSpecialite(): ?array
{
return $this->specialite;
}
public function setSpecialite(?array $specialite): self
{
$this->specialite = $specialite;
return $this;
}
public function getAnneeDiplome(): ?string
{
return $this->anneeDiplome;
}
public function setAnneeDiplome(?string $anneeDiplome): self
{
$this->anneeDiplome = $anneeDiplome;
return $this;
}
public function getStatuts(): ?string
{
return $this->statuts;
}
public function setStatuts(?string $statuts): self
{
$this->statuts = $statuts;
return $this;
}
public function getAssoAutre(): ?string
{
return $this->asso_autre;
}
public function setAssoAutre(?string $asso_autre): self
{
$this->asso_autre = $asso_autre;
return $this;
}
public function getNaissance(): ?\DateTimeInterface
{
return $this->naissance;
}
public function setNaissance(?\DateTimeInterface $naissance): self
{
$this->naissance = $naissance;
return $this;
}
/**
* @return Collection<int, Abonnement>
*/
public function getAbonnements(): Collection
{
return $this->abonnements;
}
public function addAbonnement(Abonnement $abonnement): self
{
if (!$this->abonnements->contains($abonnement)) {
$this->abonnements[] = $abonnement;
$abonnement->setUser($this);
}
return $this;
}
public function removeAbonnement(Abonnement $abonnement): self
{
if ($this->abonnements->removeElement($abonnement)) {
// set the owning side to null (unless already changed)
if ($abonnement->getUser() === $this) {
$abonnement->setUser(null);
}
}
return $this;
}
/**
* @return Collection<int, Subscription>
*/
public function getSubscriptions(): Collection
{
return $this->subscriptions;
}
public function addSubscription(Subscription $subscription): static
{
if (!$this->subscriptions->contains($subscription)) {
$this->subscriptions->add($subscription);
$subscription->setUser($this);
}
return $this;
}
public function removeSubscription(Subscription $subscription): static
{
if ($this->subscriptions->removeElement($subscription)) {
// set the owning side to null (unless already changed)
if ($subscription->getUser() === $this) {
$subscription->setUser(null);
}
}
return $this;
}
public function getRegisterToken(): ?string
{
return $this->registerToken;
}
public function setRegisterToken(?string $registerToken): static
{
$this->registerToken = $registerToken;
return $this;
}
public function getProfil(): ?string
{
return $this->profil;
}
public function setProfil(?string $profil): static
{
$this->profil = $profil;
return $this;
}
public function getData(): ?string
{
return $this->data;
}
public function setData(?string $data): static
{
$this->data = $data;
return $this;
}
/**
* @return Collection<int, Prescription>
*/
public function getPrescriptions(): Collection
{
return $this->prescriptions;
}
public function addPrescription(Prescription $prescription): static
{
if (!$this->prescriptions->contains($prescription)) {
$this->prescriptions->add($prescription);
}
return $this;
}
public function removePrescription(Prescription $prescription): static
{
$this->prescriptions->removeElement($prescription);
return $this;
}
/**
* @return Collection<int, Consultation>
*/
public function getConsultations(): Collection
{
return $this->consultations;
}
public function addConsultation(Consultation $consultation): static
{
if (!$this->consultations->contains($consultation)) {
$this->consultations->add($consultation);
$consultation->setUser($this);
}
return $this;
}
public function removeConsultation(Consultation $consultation): static
{
if ($this->consultations->removeElement($consultation)) {
// set the owning side to null (unless already changed)
if ($consultation->getUser() === $this) {
$consultation->setUser(null);
}
}
return $this;
}
public function getMedecin(): ?self
{
return $this->medecin;
}
public function setMedecin(?self $medecin): static
{
$this->medecin = $medecin;
return $this;
}
/**
* @return Collection<int, self>
*/
public function getMedecins(): Collection
{
return $this->medecins;
}
public function addMedecin(self $medecin): static
{
if (!$this->medecins->contains($medecin)) {
$this->medecins->add($medecin);
$medecin->setMedecin($this);
}
return $this;
}
public function removeMedecin(self $medecin): static
{
if ($this->medecins->removeElement($medecin)) {
// set the owning side to null (unless already changed)
if ($medecin->getMedecin() === $this) {
$medecin->setMedecin(null);
}
}
return $this;
}
public function getDiplomeCopy(): ?string
{
return $this->diplome_copy;
}
public function setDiplomeCopy(?string $diplome_copy): static
{
$this->diplome_copy = $diplome_copy;
return $this;
}
public function getAdeliCertif(): ?string
{
return $this->adeli_certif;
}
public function setAdeliCertif(?string $adeli_certif): static
{
$this->adeli_certif = $adeli_certif;
return $this;
}
public function getStatus(): ?DataStatus
{
return $this->status;
}
public function setStatus(?DataStatus $status): static
{
$this->status = $status;
return $this;
}
public function getStripeId(): ?string
{
return $this->stripe_id;
}
public function setStripeId(?string $stripe_id): static
{
$this->stripe_id = $stripe_id;
return $this;
}
public function getComment(): ?string
{
return $this->comment;
}
public function setComment(?string $comment): static
{
$this->comment = $comment;
return $this;
}
public function isOptinContact(): ?bool
{
return $this->optinContact;
}
public function setOptinContact(bool $optinContact): static
{
$this->optinContact = $optinContact;
return $this;
}
public function isOptinConsentement(): ?bool
{
return $this->optinConsentement;
}
public function setOptinConsentement(bool $optinConsentement): static
{
$this->optinConsentement = $optinConsentement;
return $this;
}
public function getOptinConsentementDate(): ?\DateTimeInterface
{
return $this->optinConsentementDate;
}
public function setOptinConsentementDate(?\DateTimeInterface $optinConsentementDate): static
{
$this->optinConsentementDate = $optinConsentementDate;
return $this;
}
/**
* @return Collection<int, Praticien>
*/
public function getPraticiens(): Collection
{
return $this->praticiens;
}
public function addPraticien(Praticien $praticien): static
{
if (!$this->praticiens->contains($praticien)) {
$this->praticiens->add($praticien);
$praticien->setUser($this);
}
return $this;
}
public function removePraticien(Praticien $praticien): static
{
if ($this->praticiens->removeElement($praticien)) {
// set the owning side to null (unless already changed)
if ($praticien->getUser() === $this) {
$praticien->setUser(null);
}
}
return $this;
}
public function getFamily(): ?string
{
return $this->family;
}
public function setFamily(?string $family): static
{
$this->family = $family;
return $this;
}
public function isChildren(): ?bool
{
return $this->children;
}
public function setChildren(?bool $children): static
{
$this->children = $children;
return $this;
}
public function getNbChild(): ?string
{
return $this->nb_child;
}
public function setNbChild(?string $nb_child): static
{
$this->nb_child = $nb_child;
return $this;
}
public function getJob(): ?string
{
return $this->job;
}
public function setJob(?string $job): static
{
$this->job = $job;
return $this;
}
public function getJobDetail(): ?string
{
return $this->job_detail;
}
public function setJobDetail(?string $job_detail): static
{
$this->job_detail = $job_detail;
return $this;
}
public function getSchedules(): ?string
{
return $this->schedules;
}
public function setSchedules(?string $schedules): static
{
$this->schedules = $schedules;
return $this;
}
public function getGender(): ?string
{
return $this->gender;
}
public function setGender(?string $gender): static
{
$this->gender = $gender;
return $this;
}
/**
* @return Collection<int, DocumentPatient>
*/
public function getDocuments(): Collection
{
return $this->documents;
}
public function addDocument(DocumentPatient $document): static
{
if (!$this->documents->contains($document)) {
$this->documents->add($document);
$document->setPatient($this);
}
return $this;
}
public function removeDocument(DocumentPatient $document): static
{
if ($this->documents->removeElement($document)) {
// set the owning side to null (unless already changed)
if ($document->getPatient() === $this) {
$document->setPatient(null);
}
}
return $this;
}
public function getDeleteAccountAt(): ?\DateTimeImmutable
{
return $this->deleteAccountAt;
}
public function setDeleteAccountAt(?\DateTimeImmutable $deleteAccountAt): static
{
$this->deleteAccountAt = $deleteAccountAt;
return $this;
}
public function getLogo(): ?string
{
return $this->logo;
}
public function setLogo(?string $logo): static
{
$this->logo = $logo;
return $this;
}
public function getCountry(): ?string
{
return $this->country;
}
public function setCountry(?string $country): static
{
$this->country = $country;
return $this;
}
public function getOffice(): ?string
{
return $this->office;
}
public function setOffice(?string $office): static
{
$this->office = $office;
return $this;
}
/**
* @return Collection<int, QuestionnairePatient>
*/
public function getQuestionnairesPatient(): Collection
{
return $this->questionnairesPatient;
}
public function addQuestionnairesPatient(QuestionnairePatient $questionnairesPatient): static
{
if (!$this->questionnairesPatient->contains($questionnairesPatient)) {
$this->questionnairesPatient->add($questionnairesPatient);
$questionnairesPatient->setUser($this);
}
return $this;
}
public function removeQuestionnairesPatient(QuestionnairePatient $questionnairesPatient): static
{
if ($this->questionnairesPatient->removeElement($questionnairesPatient)) {
// set the owning side to null (unless already changed)
if ($questionnairesPatient->getUser() === $this) {
$questionnairesPatient->setUser(null);
}
}
return $this;
}
public function getSpecialiteAutre(): ?string
{
return $this->specialite_autre;
}
public function setSpecialiteAutre(?string $specialite_autre): static
{
$this->specialite_autre = $specialite_autre;
return $this;
}
/**
* @return Collection<int, NoteHonoraire>
*/
public function getNotesHonoraires(): Collection
{
return $this->notesHonoraires;
}
public function addNotesHonoraire(NoteHonoraire $notesHonoraire): static
{
if (!$this->notesHonoraires->contains($notesHonoraire)) {
$this->notesHonoraires->add($notesHonoraire);
$notesHonoraire->setPatient($this);
}
return $this;
}
public function removeNotesHonoraire(NoteHonoraire $notesHonoraire): static
{
if ($this->notesHonoraires->removeElement($notesHonoraire)) {
// set the owning side to null (unless already changed)
if ($notesHonoraire->getPatient() === $this) {
$notesHonoraire->setPatient(null);
}
}
return $this;
}
public function getSignature(): ?string
{
return $this->signature;
}
public function setSignature(?string $signature): static
{
$this->signature = $signature;
return $this;
}
/**
* @return Collection<int, DocumentSaved>
*/
public function getDocumentSaveds(): Collection
{
return $this->documentSaveds;
}
public function addDocumentSaved(DocumentSaved $documentSaved): static
{
if (!$this->documentSaveds->contains($documentSaved)) {
$this->documentSaveds->add($documentSaved);
$documentSaved->setPatient($this);
}
return $this;
}
public function removeDocumentSaved(DocumentSaved $documentSaved): static
{
if ($this->documentSaveds->removeElement($documentSaved)) {
// set the owning side to null (unless already changed)
if ($documentSaved->getPatient() === $this) {
$documentSaved->setPatient(null);
}
}
return $this;
}
/**
* @return Collection<int, DocumentUploaded>
*/
public function getDocumentUploadeds(): Collection
{
return $this->documentUploadeds;
}
public function addDocumentUploaded(DocumentUploaded $documentUploaded): static
{
if (!$this->documentUploadeds->contains($documentUploaded)) {
$this->documentUploadeds->add($documentUploaded);
$documentUploaded->setPatient($this);
}
return $this;
}
public function removeDocumentUploaded(DocumentUploaded $documentUploaded): static
{
if ($this->documentUploadeds->removeElement($documentUploaded)) {
// set the owning side to null (unless already changed)
if ($documentUploaded->getPatient() === $this) {
$documentUploaded->setPatient(null);
}
}
return $this;
}
public function getWebsite(): ?string
{
return $this->website;
}
public function setWebsite(?string $website): static
{
$this->website = $website;
return $this;
}
public function getPriceNumber(): ?string
{
return $this->price_number;
}
public function setPriceNumber(string $price_number): static
{
$this->price_number = $price_number;
return $this;
}
public function getPriceLetter(): ?string
{
return $this->price_letter;
}
public function setPriceLetter(string $price_letter): static
{
$this->price_letter = $price_letter;
return $this;
}
public function getNotes(): ?string
{
return $this->notes;
}
public function setNotes(?string $notes): static
{
$this->notes = $notes;
return $this;
}
public function getPriceNumber2(): ?string
{
return $this->price_number_2;
}
public function setPriceNumber2(?string $price_number_2): static
{
$this->price_number_2 = $price_number_2;
return $this;
}
public function getPriceLetter2(): ?string
{
return $this->price_letter_2;
}
public function setPriceLetter2(?string $price_letter_2): static
{
$this->price_letter_2 = $price_letter_2;
return $this;
}
public function getNotePraticien(): ?string
{
return $this->notePraticien;
}
public function setNotePraticien(?string $notePraticien): static
{
$this->notePraticien = $notePraticien;
return $this;
}
// === DÉBUT MODIFICATION ROLES 2025-10-29 ===
/**
* Vérifie si l'utilisateur est un PRATICIEN
* Note: CUSTOMER legacy est considéré comme PRATICIEN
*/
public function isPraticien(): bool
{
return in_array('ROLE_PRATICIEN', $this->roles) ||
(in_array('ROLE_CUSTOMER', $this->roles) &&
!in_array('ROLE_COACH', $this->roles) &&
!in_array('ROLE_PRATICIEN', $this->roles));
}
/**
* Vérifie si l'utilisateur est un COACH
*/
public function isCoach(): bool
{
return in_array('ROLE_COACH', $this->roles);
}
// === FIN MODIFICATION ROLES ===
}