src/Entity/User.php line 16
<?phpnamespace App\Entity;use App\Repository\UserRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;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)]#[ORM\UniqueConstraint(name: 'UNIQ_IDENTIFIER_EMAIL', fields: ['email'])]#[UniqueEntity(fields: ['email'], message: 'There is already an account with this email')]class User implements UserInterface, PasswordAuthenticatedUserInterface{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 180)]private ?string $email = null;/*** @var string[] The user roles*/#[ORM\Column(type: 'array')]private array $roles = [];/*** @var string The hashed password*/#[ORM\Column]private ?string $password = null;#[ORM\OneToMany(targetEntity: Documento::class, mappedBy: 'user')]private Collection $documentos;#[ORM\ManyToMany(targetEntity: Cliente::class, inversedBy: 'users')]#[ORM\JoinTable(name: 'users_clientes')]private Collection $clientes;#[ORM\Column(length: 255)]private ?string $nome = null;#[ORM\Column(nullable: true)]private ?array $tipoAcesso = null;#[ORM\OneToMany(mappedBy: 'user', targetEntity: Fluxo::class)]private Collection $fluxos;#[ORM\OneToMany(mappedBy: 'user', targetEntity: Etapa::class)]private Collection $etapas;#[ORM\Column]private ?bool $enabled = null;public function __construct(){$this->documentos = new ArrayCollection();$this->logs = new ArrayCollection();$this->clientes = new ArrayCollection();$this->registros = new ArrayCollection();$this->fluxos = new ArrayCollection();$this->etapas = new ArrayCollection();}public function getId(): ?int{return $this->id;}public function getEmail(): ?string{return $this->email;}public function setEmail(string $email): static{$this->email = $email;return $this;}/*** A visual identifier that represents this user.** @see UserInterface*/public function getUserIdentifier(): string{return (string) $this->email;}/*** @see UserInterface** @return list<string>*/public function getRoles(): array{$roles = $this->roles;// guarantee every user at least has ROLE_USER$roles[] = 'ROLE_USER';return array_unique($roles);}/*** @param list<string> $roles*/public function setRoles(array $roles): static{$this->roles = $roles;return $this;}/*** @see PasswordAuthenticatedUserInterface*/public function getPassword(): string{return $this->password;}public function setPassword(string $password): static{$this->password = $password;return $this;}/*** @see UserInterface*/public function eraseCredentials(): void{// If you store any temporary, sensitive data on the user, clear it here// $this->plainPassword = null;}/*** @return Collection<int, Documento>*/public function getDocumentos(): Collection{return $this->documentos;}public function addDocumento(Documento $documento): static{if (!$this->documentos->contains($documento)) {$this->documentos->add($documento);$documento->setUser($this);}return $this;}public function removeDocumento(Documento $documento): static{if ($this->documentos->removeElement($documento)) {// set the owning side to null (unless already changed)if ($documento->getUser() === $this) {$documento->setUser(null);}}return $this;}/*** @return Collection<int, Cliente>*/public function getClientes(): Collection{return $this->clientes;}public function addCliente(Cliente $cliente): static{if (!$this->clientes->contains($cliente)) {$this->clientes->add($cliente);$cliente->addUser($this);}return $this;}public function removeCliente(Cliente $cliente): static{if ($this->clientes->removeElement($cliente)) {$cliente->removeUser($this);}return $this;}public function getNome(): ?string{return $this->nome;}public function setNome(string $nome): static{$this->nome = $nome;return $this;}public function getTipoAcesso(): ?array{return $this->tipoAcesso;}public function setTipoAcesso(?array $tipoAcesso): static{$this->tipoAcesso = $tipoAcesso;return $this;}/*** @return Collection<int, Fluxo>*/public function getFluxos(): Collection{return $this->fluxos;}public function addFluxo(Fluxo $fluxo): static{if (!$this->fluxos->contains($fluxo)) {$this->fluxos->add($fluxo);$fluxo->setUser($this);}return $this;}public function removeFluxo(Fluxo $fluxo): static{if ($this->fluxos->removeElement($fluxo)) {// set the owning side to null (unless already changed)if ($fluxo->getUser() === $this) {$fluxo->setUser(null);}}return $this;}/*** @return Collection<int, Etapa>*/public function getEtapas(): Collection{return $this->etapas;}public function addEtapa(Etapa $etapa): static{if (!$this->etapas->contains($etapa)) {$this->etapas->add($etapa);$etapa->setUser($this);}return $this;}public function removeEtapa(Etapa $etapa): static{if ($this->etapas->removeElement($etapa)) {// set the owning side to null (unless already changed)if ($etapa->getUser() === $this) {$etapa->setUser(null);}}return $this;}public function isEnabled(): ?bool{return $this->enabled;}public function setEnabled(bool $enabled): static{$this->enabled = $enabled;return $this;}}