projects = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getUsername(): ?string { return $this->username; } public function setUsername(string $username): static { $this->username = $username; return $this; } /** * A visual identifier that represents this user. * * @see UserInterface */ public function getUserIdentifier(): string { return (string) $this->username; } /** * @see UserInterface * * @return list */ public function getRoles(): array { $roles = $this->roles; // guarantee every user at least has ROLE_USER $roles[] = 'ROLE_USER'; return array_unique($roles); } /** * @param list $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; } public function getApikey(): ?string { return $this->apikey; } public function setApikey(?string $apikey): static { $this->apikey = $apikey; return $this; } public function getAvatar(): ?string { return $this->avatar ? $this->avatar : 'medias/avatar/noavatar.png'; } public function setAvatar(?string $avatar): static { $this->avatar = $avatar; return $this; } public function getEmail(): ?string { return $this->email; } public function setEmail(string $email): static { $this->email = $email; return $this; } /** * @return Collection */ public function getProjects(): ?Collection { return $this->projects; } public function addProject(Project $project): static { if (!$this->projects->contains($project)) { $this->projects->add($project); } return $this; } public function removeProject(Project $project): static { $this->projects->removeElement($project); return $this; } public function getProject(): ?Project { if (!$this->projects) { return null; } return $this->project; } public function setProject(?Project $project): static { $this->project = $project; return $this; } }