userLogs = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getUserId(): ?int { return $this->userId; } public function setUserId(int $userId): self { $this->userId = $userId; return $this; } public function getRoles(): array { return ['ROLE_USER']; } public function getPassword(): ?string { return null; } /** * Returns the salt that was originally used to encode the password. * * This can return null if the password was not encoded using a salt. * * @return string|null The salt */ public function getSalt(): ?string { return null; } /** * Returns the username used to authenticate the user. * * @return int The username */ public function getUsername(): int { return (int) $this->userId; } /** * Removes sensitive data from the user. * * This is important if, at any given point, sensitive information like * the plain-text password is stored on this object. */ public function eraseCredentials(): void { } public function setGroups(array $groups) { $this->groups = $groups; return $this; } public function getGroups() { return $this->groups; } /** * @return Collection|UserLog[] */ public function getUserLogs(): Collection // Only getter no need add or remove methods { return $this->userLogs; } }