ChatJoinRequest::setUserChatId()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
namespace TelegramBot\Api\Types;
4
5
use TelegramBot\Api\BaseType;
6
use TelegramBot\Api\TypeInterface;
7
8
class ChatJoinRequest extends BaseType implements TypeInterface
9
{
10
    /**
11
     * {@inheritdoc}
12
     *
13
     * @var array
14
     */
15
    protected static $requiredParams = ['chat', 'from', 'user_chat_id', 'date'];
16
17
    /**
18
     * {@inheritdoc}
19
     *
20
     * @var array
21
     */
22
    protected static $map = [
23
        'chat' => Chat::class,
24
        'from' => User::class,
25
        'user_chat_id' => true,
26
        'date' => true,
27
        'bio' => true,
28
        'invite_link' => ChatInviteLink::class,
29
    ];
30
31
    /**
32
     * Chat to which the request was sent
33
     *
34
     * @var Chat
35
     */
36
    protected $chat;
37
38
    /**
39
     * User that sent the join request
40
     *
41
     * @var User
42
     */
43
    protected $from;
44
45
    /**
46
     * Identifier of a private chat with the user who sent the join request. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. The bot can use this identifier for 24 hours to send messages until the join request is processed, assuming no other administrator contacted the user.
47
     *
48
     * @var int
49
     */
50
    protected $userChatId;
51
52
    /**
53
     * Date the request was sent in Unix time
54
     *
55
     * @var int
56
     */
57
    protected $date;
58
59
    /**
60
     * Optional. Bio of the user.
61
     *
62
     * @var string|null
63
     */
64
    protected $bio;
65
66
    /**
67
     * Optional. Chat invite link that was used by the user to send the join request
68
     *
69
     * @var ChatInviteLink|null
70
     */
71
    protected $inviteLink;
72
73
    /**
74
     * @return Chat
75
     */
76
    public function getChat()
77
    {
78
        return $this->chat;
79
    }
80
81
    /**
82
     * @param Chat $chat
83
     * @return void
84
     */
85
    public function setChat($chat)
86
    {
87
        $this->chat = $chat;
88
    }
89
90
    /**
91
     * @return User
92
     */
93
    public function getFrom()
94
    {
95
        return $this->from;
96
    }
97
98
    /**
99
     * @param User $from
100
     * @return void
101
     */
102
    public function setFrom($from)
103
    {
104
        $this->from = $from;
105
    }
106
107
    /**
108
     * @return int
109
     */
110
    public function getUserChatId()
111
    {
112
        return $this->userChatId;
113
    }
114
115
    /**
116
     * @param int $userChatId
117
     * @return void
118
     */
119
    public function setUserChatId($userChatId)
120
    {
121
        $this->userChatId = $userChatId;
122
    }
123
124
    /**
125
     * @return int
126
     */
127
    public function getDate()
128
    {
129
        return $this->date;
130
    }
131
132
    /**
133
     * @param int $date
134
     * @return void
135
     */
136
    public function setDate($date)
137
    {
138
        $this->date = $date;
139
    }
140
141
    /**
142
     * @return string|null
143
     */
144
    public function getBio()
145
    {
146
        return $this->bio;
147
    }
148
149
    /**
150
     * @param string|null $bio
151
     * @return void
152
     */
153
    public function setBio($bio)
154
    {
155
        $this->bio = $bio;
156
    }
157
158
    /**
159
     * @return ChatInviteLink|null
160
     */
161
    public function getInviteLink()
162
    {
163
        return $this->inviteLink;
164
    }
165
166
    /**
167
     * @param ChatInviteLink|null $inviteLink
168
     * @return void
169
     */
170
    public function setInviteLink($inviteLink)
171
    {
172
        $this->inviteLink = $inviteLink;
173
    }
174
}
175