user = $user; } /** * * @return \App\Entity\User */ public function getUser() { return $this->user; } /** * * @return \DateTime|null */ public function getLastLogin() { return $this->lastLogin; } /** * * @param \DateTime|null $lastLogin */ public function setLastLogin($lastLogin) { $this->lastLogin = $lastLogin; } /** * * @return \DateTime|null */ public function getExpiredAt() { return $this->expiredAt; } /** * * @param \DateTime|null $expiredAt */ public function setExpiredAt($expiredAt) { $this->expiredAt = $expiredAt; } /** * Checks if the user is expired (expiry date is not null and in the past) * * @return boolean */ public function isExpired() { return $this->expiredAt !== null && $this->expiredAt < new \DateTime(); } }