zend-blog-3-backend
142 строки · 2.5 Кб
1<?php
2
3namespace App\Entity;
4
5use App\Entity\Traits\ModifyEntityTrait;
6use Doctrine\ORM\Mapping as ORM;
7
8/**
9* @ORM\Table(name="telegram_updates")
10* @ORM\Entity(repositoryClass="App\Repository\TelegramUpdateRepository")
11* @ORM\HasLifecycleCallbacks()
12*/
13class TelegramUpdate
14{
15use ModifyEntityTrait;
16
17/**
18* @var int
19*
20* @ORM\Id
21* @ORM\Column(type="integer")
22* @ORM\GeneratedValue(strategy="AUTO")
23*/
24private $id;
25
26/**
27* @var TelegramUser|null
28*
29* @ORM\ManyToOne(targetEntity="TelegramUser")
30* @ORM\JoinColumn(onDelete="SET NULL")
31*/
32private $telegramUser;
33
34/**
35* @var int|null
36*
37* @ORM\Column(type="bigint", nullable=true)
38*/
39private $chatId;
40
41/**
42* @var string
43*
44* @ORM\Column(type="text", length=65535, nullable=true)
45*/
46private $textMessage;
47
48/**
49* @var string
50*
51* @ORM\Column(type="text", length=65535)
52*/
53private $rawMessage;
54
55/**
56* @return int
57*/
58public function getId(): ?int
59{
60return $this->id;
61}
62
63/**
64* @return TelegramUser|null
65*/
66public function getTelegramUser(): ?TelegramUser
67{
68return $this->telegramUser;
69}
70
71/**
72* @param TelegramUser|null $telegramUser
73*
74* @return TelegramUpdate
75*/
76public function setTelegramUser(?TelegramUser $telegramUser): self
77{
78$this->telegramUser = $telegramUser;
79
80return $this;
81}
82
83/**
84* @return int|null
85*/
86public function getChatId(): ?int
87{
88return $this->chatId;
89}
90
91/**
92* @param int|null $chatId
93*
94* @return TelegramUpdate
95*/
96public function setChatId(?int $chatId): self
97{
98$this->chatId = $chatId;
99
100return $this;
101}
102
103/**
104* @return string
105*/
106public function getRawMessage(): string
107{
108return $this->rawMessage;
109}
110
111/**
112* @param string $rawMessage
113*
114* @return TelegramUpdate
115*/
116public function setRawMessage(string $rawMessage): self
117{
118$this->rawMessage = $rawMessage;
119
120return $this;
121}
122
123/**
124* @return string|null
125*/
126public function getTextMessage(): ?string
127{
128return $this->textMessage;
129}
130
131/**
132* @param string|null $textMessage
133*
134* @return TelegramUpdate
135*/
136public function setTextMessage(string $textMessage = null): self
137{
138$this->textMessage = $textMessage;
139
140return $this;
141}
142}
143