| Total Complexity | 7 |
| Total Lines | 51 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | class UpdateChatChatList extends Update |
||
| 15 | { |
||
| 16 | public const TYPE_NAME = 'updateChatChatList'; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * Chat identifier. |
||
| 20 | * |
||
| 21 | * @var int |
||
| 22 | */ |
||
| 23 | protected int $chatId; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * The new chat's chat list; may be null. |
||
| 27 | * |
||
| 28 | * @var ChatList|null |
||
| 29 | */ |
||
| 30 | protected ?ChatList $chatList; |
||
| 31 | |||
| 32 | public function __construct(int $chatId, ?ChatList $chatList) |
||
| 33 | { |
||
| 34 | parent::__construct(); |
||
| 35 | |||
| 36 | $this->chatId = $chatId; |
||
| 37 | $this->chatList = $chatList; |
||
| 38 | } |
||
| 39 | |||
| 40 | public static function fromArray(array $array): UpdateChatChatList |
||
| 41 | { |
||
| 42 | return new static( |
||
| 43 | $array['chat_id'], |
||
| 44 | (isset($array['chat_list']) ? TdSchemaRegistry::fromArray($array['chat_list']) : null), |
||
| 45 | ); |
||
| 46 | } |
||
| 47 | |||
| 48 | public function typeSerialize(): array |
||
| 49 | { |
||
| 50 | return [ |
||
| 51 | '@type' => static::TYPE_NAME, |
||
| 52 | 'chat_id' => $this->chatId, |
||
| 53 | 'chat_list' => (isset($this->chatList) ? $this->chatList : null), |
||
| 54 | ]; |
||
| 55 | } |
||
| 56 | |||
| 57 | public function getChatId(): int |
||
| 58 | { |
||
| 59 | return $this->chatId; |
||
| 60 | } |
||
| 61 | |||
| 62 | public function getChatList(): ?ChatList |
||
| 65 | } |
||
| 66 | } |
||
| 67 |