id = $id; $this->createdAt = new \DateTime(); } /** * @ORM\PreUpdate() */ public function preUpdate(): void { $this->updatedAt = new \DateTime(); } public function getId(): int { return $this->id; } public function getCreatedAt(): \DateTime { return $this->createdAt; } public function getUpdatedAt(): \DateTime { return $this->updatedAt; } public function getLinkedAt(): \DateTime { return $this->linkedAt; } public function getFirstName(): string { return $this->firstName; } public function updateFromMessageData(string $firstName, ?string $lastName, ?string $username, int $chatId): void { $this->firstName = $firstName; $this->lastName = $lastName; $this->username = $username; $this->chatId = $chatId; } public function getLastName(): ?string { return $this->lastName; } public function getUsername(): string { return $this->username; } public function getChatId(): int { return $this->chatId; } public function getUser(): ?User { return $this->user; } public function setUser(User $user): Account { if (!$this->user && $user) { $this->linkedAt = new \DateTime(); } $this->user = $user; return $this; } public function getUserId(): int { return $this->user->getId(); } public function disableNotifications(): self { $this->subscriberNotification = false; $this->renameNotification = false; return $this; } public function setSubscriberNotification(bool $subscriberNotification): self { $this->subscriberNotification = $subscriberNotification; return $this; } public function toggleSubscriberNotification(): self { $this->subscriberNotification = !$this->subscriberNotification; return $this; } public function isSubscriberNotification(): bool { return $this->subscriberNotification; } public function setRenameNotification(bool $renameNotification): self { $this->renameNotification = $renameNotification; return $this; } public function toggleRenameNotification(): self { $this->renameNotification = !$this->renameNotification; return $this; } public function isRenameNotification(): bool { return $this->renameNotification; } }