projects = new ArrayCollection(); $this->pages = new ArrayCollection(); } public function __toString(): string { return $this->username; } public function getId(): ?int { return $this->id; } public function getUsername(): ?string { return $this->username; } public function setUsername(string $username): self { $this->username = $username; return $this; } /** * A visual identifier that represents this user. * * @see UserInterface */ public function getUserIdentifier(): string { return $this->username; } /** * @see UserInterface */ public function getRoles(): array { $roles = $this->roles; // guarantee every user at least has ROLE_USER $roles[] = 'ROLE_USER'; return array_unique(array: $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() { $this->plainPassword = ''; } public function getEmail(): ?string { return $this->email; } public function setEmail(string $email): self { $this->email = $email; return $this; } public function setPlainPassword(string $plainPassword): void { $this->plainPassword = $plainPassword; } public function getFirstName(): ?string { return $this->firstName; } public function setFirstName(?string $firstName): self { $this->firstName = $firstName; return $this; } public function getLastName(): ?string { return $this->lastName; } public function setLastName(?string $lastName): self { $this->lastName = $lastName; return $this; } /** * @return Collection */ public function getProjects(): Collection { return $this->projects; } public function addProject(Projects $project): self { if (!$this->projects->contains(element: $project)) { $this->projects[] = $project; $project->addDeveloper(developer: $this); } return $this; } public function removeProject(Projects $project): self { if ($this->projects->removeElement(element: $project)) { $project->removeDeveloper(developer: $this); } return $this; } public function getAvatar(): string { return $this->avatar ?? ''; } public function setAvatar(?string $avatar): self { $this->avatar = $avatar; return $this; } /** * @return Collection */ public function getPages(): Collection { return $this->pages; } public function addPage(Pages $page): self { if (!$this->pages->contains(element: $page)) { $this->pages[] = $page; $page->setOwner(owner: $this); } return $this; } public function removePage(Pages $page): self { if ($this->pages->removeElement(element: $page)) { // set the owning side to null (unless already changed) if ($page->getOwner() === $this) { $page->setOwner(owner: null); } } return $this; } public function getCreatedAt(): ?DateTimeImmutable { return $this->createdAt; } public function setCreatedAt(DateTimeImmutable $createdAt): self { $this->createdAt = $createdAt; return $this; } public function getModifiedAt(): ?DateTimeImmutable { return $this->modifiedAt; } public function setModifiedAt(?DateTimeImmutable $modifiedAt): self { $this->modifiedAt = $modifiedAt; return $this; } /** * @return string */ public function getAvatarUri() { return 'avatar'; } #[ORM\PrePersist] public function onPrePersist(): void { $this->createdAt = new DateTimeImmutable(datetime: 'now'); } #[ORM\PreUpdate] public function onPreUpdate(): void { $this->modifiedAt = new DateTimeImmutable(datetime: 'now'); } public function isVerified(): bool { return $this->isVerified; } public function setIsVerified(bool $isVerified): self { $this->isVerified = $isVerified; return $this; } public function getAgreedTermsAt(): ?DateTimeImmutable { return $this->agreedTermsAt; } public function agreeTerms(): self { $this->agreedTermsAt = new DateTimeImmutable(); return $this; } }