src/Entity/utilisateur/Utilisateurs.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity\utilisateur;
  3. use App\Entity\api\ApiUtilisateur;
  4. use App\Entity\att\AttGroupe;
  5. use App\Entity\utilisateur\UtilisateurSociete;
  6. use App\Repository\administration\UtilisateursRepository;
  7. use Doctrine\Common\Collections\ArrayCollection;
  8. use Doctrine\Common\Collections\Collection;
  9. use Doctrine\ORM\Mapping as ORM;
  10. use Symfony\Component\Security\Core\User\UserInterface;
  11. /**
  12. * @ORM\Entity(repositoryClass=UtilisateursRepository::class)
  13. */
  14. class Utilisateurs implements UserInterface
  15. {
  16. /**
  17. * @var int
  18. *
  19. * @ORM\Column(name="id_utilisateur", type="bigint", nullable=false)
  20. * @ORM\Id
  21. * @ORM\GeneratedValue()
  22. */
  23. private $idUtilisateur;
  24. /**
  25. * @var string|null
  26. *
  27. * @ORM\Column(name="nom", type="string", length=50, nullable=true)
  28. */
  29. private $nom;
  30. /**
  31. * @var string|null
  32. *
  33. * @ORM\Column(name="prenom", type="string", length=50, nullable=true)
  34. */
  35. private $prenom;
  36. /**
  37. * @var string|null
  38. *
  39. * @ORM\Column(name="mail", type="string", length=255, nullable=true)
  40. */
  41. private $mail;
  42. /**
  43. * @var string|null
  44. *
  45. * @ORM\Column(name="fonction", type="string", length=255, nullable=true)
  46. */
  47. private $fonction;
  48. /**
  49. * @var string|null
  50. *
  51. * @ORM\Column(name="commentaire", type="string", length=255, nullable=true)
  52. */
  53. private $commentaire;
  54. /**
  55. * @var string|null
  56. *
  57. * @ORM\Column(name="identifiant", type="string", length=255, nullable=true)
  58. */
  59. private $identifiant;
  60. /**
  61. * @var string|null
  62. *
  63. * @ORM\Column(name="mot_de_passe", type="string", length=255, nullable=true)
  64. */
  65. private $motDePasse;
  66. /**
  67. * @var string|null
  68. *
  69. * @ORM\Column(name="pwd", type="string", length=255, nullable=true)
  70. */
  71. private $pwd;
  72. /**
  73. * @var string|null
  74. *
  75. * @ORM\Column(name="ancien_mot_de_passe", type="string", length=255, nullable=true)
  76. */
  77. private $AncienMotDePasse;
  78. /**
  79. * @var bool
  80. *
  81. * @ORM\Column(name="nb_essai_avant_bloquage", type="integer", nullable=false)
  82. */
  83. private $nbEssaiAvantBloquage = 3;
  84. /**
  85. * @var \DateTime|null
  86. *
  87. * @ORM\Column(name="date_fin_compte", type="date", nullable=true)
  88. */
  89. private $dateFinCompte;
  90. /**
  91. * @var bool
  92. *
  93. * @ORM\Column(name="compte_desactive", type="boolean", nullable=false)
  94. */
  95. private $compteDesactive = '0';
  96. /**
  97. * @var UtilisateurSociete
  98. *
  99. * @ORM\ManyToOne(targetEntity=UtilisateurSociete::class)
  100. * @ORM\JoinColumns({
  101. * @ORM\JoinColumn(name="fk_utilisateur_societe_id", referencedColumnName="id_utilisateur_societe")
  102. * })
  103. */
  104. private $fkUtilisateurSociete;
  105. /**
  106. * @var UtilisateurProfil
  107. *
  108. * @ORM\ManyToOne(targetEntity="UtilisateurProfil", cascade={"persist"})
  109. * @ORM\JoinColumns({
  110. * @ORM\JoinColumn(name="fk_utilisateur_profil_id", referencedColumnName="id_utilisateur_profil")
  111. * })
  112. */
  113. private $fkUtilisateurProfil;
  114. /**
  115. * @var bool
  116. *
  117. * @ORM\Column(name="acces_memo", type="boolean", nullable=false)
  118. */
  119. private $accesMemo = '0';
  120. /**
  121. * @var bool
  122. *
  123. * @ORM\Column(name="acces_elium", type="boolean", nullable=false)
  124. */
  125. private $accesElium = '0';
  126. /**
  127. * @ORM\ManyToOne(targetEntity="App\Entity\att\AttGroupe", cascade={"persist"})
  128. * @ORM\JoinColumns({
  129. * @ORM\JoinColumn(name="fk_att_groupe_id", referencedColumnName="id_att_groupe")
  130. * })
  131. */
  132. private $fkAttGroupeId;
  133. /**
  134. * @ORM\Column(type="datetime", nullable=false)
  135. */
  136. private $derniereConnexion;
  137. /**
  138. * @var bool
  139. *
  140. * @ORM\Column(name="view_quick_cc", type="boolean", nullable=false)
  141. */
  142. private $viewQuickCc = '0';
  143. /**
  144. * @ORM\ManyToOne(targetEntity="App\Entity\utilisateur\Utilisateurs", cascade={"persist"})
  145. * @ORM\JoinColumns({
  146. * @ORM\JoinColumn(name="created_by", referencedColumnName="id_utilisateur")
  147. * })
  148. */
  149. private $createdBy;
  150. /**
  151. * @ORM\Column(type="datetime", nullable=false)
  152. */
  153. private $createdAt;
  154. /**
  155. * @ORM\ManyToOne(targetEntity="App\Entity\utilisateur\Utilisateurs", cascade={"persist"})
  156. * @ORM\JoinColumns({
  157. * @ORM\JoinColumn(name="modified_by", referencedColumnName="id_utilisateur")
  158. * })
  159. */
  160. private $modifiedBy;
  161. /**
  162. * @ORM\Column(type="datetime", nullable=true)
  163. */
  164. private $modifiedAt;
  165. /**
  166. * @var bool
  167. *
  168. * @ORM\Column(name="is_verified", type="boolean", nullable=false)
  169. */
  170. private $isVerified = 0;
  171. /**
  172. * @var bool
  173. *
  174. * @ORM\Column(name="connected_by_app", type="boolean", nullable=false)
  175. */
  176. private $connectedByApp = 0;
  177. public function getIdUtilisateur(): int
  178. {
  179. return $this->idUtilisateur;
  180. }
  181. public function setIdUtilisateur(int $idUtilisateur): void
  182. {
  183. $this->idUtilisateur = $idUtilisateur;
  184. }
  185. public function getNom(): ?string
  186. {
  187. return $this->nom;
  188. }
  189. public function setNom(?string $nom): self
  190. {
  191. $this->nom = htmlspecialchars($nom);
  192. return $this;
  193. }
  194. public function getPrenom(): ?string
  195. {
  196. return $this->prenom;
  197. }
  198. public function setPrenom(?string $prenom): self
  199. {
  200. $this->prenom = htmlspecialchars($prenom);
  201. return $this;
  202. }
  203. public function getMail(): ?string
  204. {
  205. return $this->mail;
  206. }
  207. public function setMail(?string $mail): self
  208. {
  209. $this->mail = htmlspecialchars($mail);
  210. return $this;
  211. }
  212. public function getFonction(): ?string
  213. {
  214. return $this->fonction;
  215. }
  216. public function setFonction(?string $fonction): self
  217. {
  218. $this->fonction = htmlspecialchars($fonction);
  219. return $this;
  220. }
  221. public function getCommentaire(): ?string
  222. {
  223. return $this->commentaire;
  224. }
  225. public function setCommentaire(?string $commentaire): self
  226. {
  227. $this->commentaire = htmlspecialchars($commentaire);
  228. return $this;
  229. }
  230. public function getIdentifiant(): ?string
  231. {
  232. return $this->identifiant;
  233. }
  234. public function setIdentifiant(?string $identifiant): self
  235. {
  236. $this->identifiant = htmlspecialchars($identifiant);
  237. return $this;
  238. }
  239. public function getMotDePasse(): ?string
  240. {
  241. return $this->motDePasse;
  242. }
  243. public function setMotDePasse(?string $motDePasse): self
  244. {
  245. $this->motDePasse = $motDePasse;
  246. return $this;
  247. }
  248. public function getPwd(): ?string
  249. {
  250. return $this->pwd;
  251. }
  252. public function setPwd(?string $pwd): self
  253. {
  254. $this->pwd = $pwd;
  255. return $this;
  256. }
  257. public function getAncienMotDePasse(): ?string
  258. {
  259. return $this->AncienMotDePasse;
  260. }
  261. public function setAncienMotDePasse(?string $AncienMotDePasse): self
  262. {
  263. $this->AncienMotDePasse = $AncienMotDePasse;
  264. return $this;
  265. }
  266. public function getNbEssaiAvantBloquage(): ?int
  267. {
  268. return $this->nbEssaiAvantBloquage;
  269. }
  270. public function setNbEssaiAvantBloquage(int $nbEssaiAvantBloquage): self
  271. {
  272. $this->nbEssaiAvantBloquage = $nbEssaiAvantBloquage;
  273. return $this;
  274. }
  275. public function getDateFinCompte(): ?\DateTimeInterface
  276. {
  277. return $this->dateFinCompte;
  278. }
  279. public function setDateFinCompte(?\DateTimeInterface $dateFinCompte): self
  280. {
  281. $this->dateFinCompte = $dateFinCompte;
  282. return $this;
  283. }
  284. public function getCompteDesactive(): ?bool
  285. {
  286. return $this->compteDesactive;
  287. }
  288. public function setCompteDesactive(bool $compteDesactive): self
  289. {
  290. $this->compteDesactive = $compteDesactive;
  291. return $this;
  292. }
  293. public function getFkUtilisateurSociete(): ?UtilisateurSociete
  294. {
  295. return $this->fkUtilisateurSociete;
  296. }
  297. public function setFkUtilisateurSociete(?UtilisateurSociete $fkUtilisateurSociete): self
  298. {
  299. $this->fkUtilisateurSociete = $fkUtilisateurSociete;
  300. return $this;
  301. }
  302. public function getFkUtilisateurProfil(): ?UtilisateurProfil
  303. {
  304. return $this->fkUtilisateurProfil;
  305. }
  306. public function setFkUtilisateurProfil(?UtilisateurProfil $fkUtilisateurProfil): self
  307. {
  308. $this->fkUtilisateurProfil = $fkUtilisateurProfil;
  309. return $this;
  310. }
  311. public function getAccesMemo(): ?bool
  312. {
  313. return $this->accesMemo;
  314. }
  315. public function setAccesMemo(?bool $accesMemo): self
  316. {
  317. $this->accesElium = $accesMemo;
  318. return $this;
  319. }
  320. public function getAccesElium(): ?bool
  321. {
  322. return $this->accesElium;
  323. }
  324. public function setAccesElium(?bool $accesElium): self
  325. {
  326. $this->accesElium = $accesElium;
  327. return $this;
  328. }
  329. public function getFkAttGroupeId(): ?AttGroupe
  330. {
  331. return $this->fkAttGroupeId;
  332. }
  333. public function setFkAttGroupeId(?AttGroupe $fkAttGroupeId): self
  334. {
  335. $this->fkAttGroupeId = $fkAttGroupeId;
  336. return $this;
  337. }
  338. public function getDerniereConnexion(): ?\DateTimeInterface
  339. {
  340. return $this->derniereConnexion;
  341. }
  342. public function setDerniereConnexion(?\DateTimeInterface $derniereConnexion): self
  343. {
  344. $this->derniereConnexion = $derniereConnexion;
  345. return $this;
  346. }
  347. public function __toString(): string
  348. {
  349. return $this->getPrenom()." ".$this->getNom();
  350. }
  351. public function getRoles(): array
  352. {
  353. $roles[] = 'ROLE_USER';
  354. return array_unique($roles);
  355. }
  356. public function getViewQuickCc(): ?bool
  357. {
  358. return $this->viewQuickCc;
  359. }
  360. public function setViewQuickCc(?bool $viewQuickCc): self
  361. {
  362. $this->viewQuickCc = $viewQuickCc;
  363. return $this;
  364. }
  365. public function getCreatedBy(): ?Utilisateurs
  366. {
  367. return $this->createdBy;
  368. }
  369. public function setCreatedBy(?Utilisateurs $createdBy): self
  370. {
  371. $this->createdBy = $createdBy;
  372. return $this;
  373. }
  374. public function getCreatedAt(): ?\DateTimeInterface
  375. {
  376. return $this->createdAt;
  377. }
  378. public function setCreatedAt(?\DateTimeInterface $createdAt): self
  379. {
  380. $this->createdAt = $createdAt;
  381. return $this;
  382. }
  383. public function getModifiedBy(): ?Utilisateurs
  384. {
  385. return $this->createdBy;
  386. }
  387. public function setModifiedBy(?Utilisateurs $modifiedBy): self
  388. {
  389. $this->modifiedBy = $modifiedBy;
  390. return $this;
  391. }
  392. public function getModifiedAt(): ?\DateTimeInterface
  393. {
  394. return $this->modifiedAt;
  395. }
  396. public function setModifiedAt(?\DateTimeInterface $modifiedAt): self
  397. {
  398. $this->modifiedAt = $modifiedAt;
  399. return $this;
  400. }
  401. public function getIsVerified(): ?bool
  402. {
  403. return $this->isVerified;
  404. }
  405. public function setIsVerified(?bool $isVerified): self
  406. {
  407. $this->isVerified = $isVerified;
  408. return $this;
  409. }
  410. public function getConnectedByApp(): ?bool
  411. {
  412. return $this->connectedByApp;
  413. }
  414. public function setConnectedByApp(?bool $connectedByApp): self
  415. {
  416. $this->connectedByApp = $connectedByApp;
  417. return $this;
  418. }
  419. /**
  420. * A visual identifier that represents this user.
  421. *
  422. * @see UserInterface
  423. */
  424. public function getUserIdentifier(): string
  425. {
  426. return (string) $this->mail;
  427. }
  428. public function getPassword(): string
  429. {
  430. return (string) $this->motDePasse;
  431. }
  432. public function getSalt()
  433. {
  434. return null;
  435. }
  436. public function getUsername()
  437. {
  438. return $this->mail;
  439. }
  440. public function eraseCredentials()
  441. {
  442. }
  443. }