0])] private $isAdmin; #[ORM\Column(type: 'boolean', options: ['default' => 0])] private $isWriter; public function __construct() { } public function __toString() { return (string) $this->getDisplayName(); } public function getId(): ?int { return $this->id; } public function getUserIdentifier(): string { return $this->getUsername(); } public function getEmail(): ?string { return $this->email; } public function setEmail(string $email): self { $this->email = $email; return $this; } public function getUsername(): string { return (string) $this->email; } public function getRoles(): array { $roles = []; if ($this->getIsWriter()) { $roles[] = 'ROLE_WRITER'; } if ($this->getIsAdmin()) { $roles[] = 'ROLE_ADMIN'; } return array_unique($roles); } public function setRoles(array $roles): self { $this->roles = $roles; return $this; } public function getPassword(): string { return (string) $this->password; } public function setPassword(string $password): self { $this->password = $password; return $this; } public function getSalt(): ?string { return null; } public function eraseCredentials() { // If you store any temporary, sensitive data on the user, clear it here // $this->plainPassword = null; } public function getDisplayName(): ?string { return $this->displayName; } public function setDisplayName(?string $displayName): self { $this->displayName = $displayName; return $this; } public function getTotpSecret(): ?string { return $this->totpSecret; } public function setTotpSecret(?string $totpSecret): self { $this->totpSecret = $totpSecret; return $this; } public function isTotpAuthenticationEnabled(): bool { return null !== $this->getTotpSecret(); } public function isGoogleAuthenticatorEnabled(): bool { return $this->isTotpAuthenticationEnabled(); } public function getGoogleAuthenticatorUsername(): string { return $this->getEmail(); } public function getGoogleAuthenticatorSecret(): ?string { return $this->getTotpSecret(); } public function setGoogleAuthenticatorSecret(?string $googleAuthenticatorSecret): void { $this->setTotpSecret($googleAuthenticatorSecret); } public function getPasswordRequestedAt(): ?\DateTimeInterface { return $this->passwordRequestedAt; } public function setPasswordRequestedAt(?\DateTimeInterface $passwordRequestedAt): self { $this->passwordRequestedAt = $passwordRequestedAt; return $this; } public function getConfirmationToken(): ?string { return $this->confirmationToken; } public function setConfirmationToken(?string $confirmationToken): self { $this->confirmationToken = $confirmationToken; return $this; } public function getIsAdmin(): ?bool { return $this->isAdmin; } public function setIsAdmin(bool $isAdmin): self { $this->isAdmin = $isAdmin; return $this; } public function getIsWriter(): ?bool { return $this->isWriter; } public function setIsWriter(bool $isWriter): self { $this->isWriter = $isWriter; return $this; } }