1 | <?php |
||
16 | class Account |
||
17 | { |
||
18 | /** |
||
19 | * Telegram user ID |
||
20 | * |
||
21 | * @var int |
||
22 | * |
||
23 | * @ORM\Id() |
||
24 | * @ORM\Column(name="account_id", type="integer") |
||
25 | */ |
||
26 | private $id; |
||
27 | |||
28 | /** |
||
29 | * @var \DateTime |
||
30 | * |
||
31 | * @ORM\Column(name="created_at", type="datetime") |
||
32 | */ |
||
33 | private $createdAt; |
||
34 | |||
35 | /** |
||
36 | * @var \DateTime |
||
37 | * |
||
38 | * @ORM\Column(name="updated_at", type="datetime", nullable=true) |
||
39 | */ |
||
40 | private $updatedAt; |
||
41 | |||
42 | /** |
||
43 | * @var \DateTime |
||
44 | * |
||
45 | * @ORM\Column(name="linked_at", type="datetime", nullable=true) |
||
46 | */ |
||
47 | private $linkedAt; |
||
48 | |||
49 | /** |
||
50 | * @var string |
||
51 | * |
||
52 | * @ORM\Column(name="first_name", type="text") |
||
53 | */ |
||
54 | private $firstName; |
||
55 | |||
56 | /** |
||
57 | * @var string|null |
||
58 | * |
||
59 | * @ORM\Column(name="last_name", type="text", nullable=true) |
||
60 | */ |
||
61 | private $lastName; |
||
62 | |||
63 | /** |
||
64 | * @var string|null |
||
65 | * |
||
66 | * @ORM\Column(name="username", type="text", nullable=true) |
||
67 | */ |
||
68 | private $username; |
||
69 | |||
70 | /** |
||
71 | * ID of private chat with user |
||
72 | * |
||
73 | * @var int |
||
74 | * |
||
75 | * @ORM\Column(name="private_chat_id", type="bigint", nullable=true) |
||
76 | */ |
||
77 | private $chatId; |
||
78 | |||
79 | /** |
||
80 | * @var User |
||
81 | * |
||
82 | * @ORM\OneToOne(targetEntity="Skobkin\Bundle\PointToolsBundle\Entity\User") |
||
83 | * @ORM\JoinColumn(name="user_id", nullable=true, onDelete="CASCADE") |
||
84 | */ |
||
85 | private $user; |
||
86 | |||
87 | /** |
||
88 | * Notifications about new subscribers |
||
89 | * |
||
90 | * @var bool |
||
91 | * |
||
92 | * @ORM\Column(name="subscriber_notification", type="boolean") |
||
93 | */ |
||
94 | private $subscriberNotification = false; |
||
95 | |||
96 | /** |
||
97 | * Notifications about user renaming |
||
98 | * |
||
99 | * @var bool |
||
100 | * |
||
101 | * @ORM\Column(name="rename_notification", type="boolean") |
||
102 | */ |
||
103 | private $renameNotification = false; |
||
104 | |||
105 | |||
106 | public function __construct(int $id) |
||
111 | |||
112 | /** |
||
113 | * @ORM\PreUpdate() |
||
114 | */ |
||
115 | public function preUpdate(): void |
||
119 | |||
120 | public function getId(): int |
||
124 | |||
125 | public function getCreatedAt(): \DateTime |
||
129 | |||
130 | public function getUpdatedAt(): \DateTime |
||
134 | |||
135 | public function getLinkedAt(): \DateTime |
||
139 | |||
140 | public function getFirstName(): string |
||
144 | |||
145 | public function updateFromMessageData(string $firstName, ?string $lastName, ?string $username, int $chatId): void |
||
152 | |||
153 | public function getLastName(): ?string |
||
157 | |||
158 | public function getUsername(): string |
||
162 | |||
163 | public function getChatId(): int |
||
167 | |||
168 | public function getUser(): ?User |
||
172 | |||
173 | public function setUser(User $user): Account |
||
183 | |||
184 | public function getUserId(): int |
||
188 | |||
189 | public function disableNotifications(): self |
||
196 | |||
197 | public function setSubscriberNotification(bool $subscriberNotification): self |
||
203 | |||
204 | public function toggleSubscriberNotification(): self |
||
210 | |||
211 | public function isSubscriberNotification(): bool |
||
215 | |||
216 | public function setRenameNotification(bool $renameNotification): self |
||
222 | |||
223 | public function toggleRenameNotification(): self |
||
229 | |||
230 | public function isRenameNotification(): bool |
||
234 | } |
||
235 |