|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* This phpFile is auto-generated. |
|
5
|
|
|
*/ |
|
6
|
|
|
|
|
7
|
|
|
declare(strict_types=1); |
|
8
|
|
|
|
|
9
|
|
|
namespace PHPTdGram\Schema; |
|
10
|
|
|
|
|
11
|
|
|
/** |
|
12
|
|
|
* A photo message. |
|
13
|
|
|
*/ |
|
14
|
|
|
class PushMessageContentPhoto extends PushMessageContent |
|
15
|
|
|
{ |
|
16
|
|
|
public const TYPE_NAME = 'pushMessageContentPhoto'; |
|
17
|
|
|
|
|
18
|
|
|
/** |
|
19
|
|
|
* Message content; may be null. |
|
20
|
|
|
*/ |
|
21
|
|
|
protected ?Photo $photo; |
|
22
|
|
|
|
|
23
|
|
|
/** |
|
24
|
|
|
* Photo caption. |
|
25
|
|
|
*/ |
|
26
|
|
|
protected string $caption; |
|
27
|
|
|
|
|
28
|
|
|
/** |
|
29
|
|
|
* True, if the photo is secret. |
|
30
|
|
|
*/ |
|
31
|
|
|
protected bool $isSecret; |
|
32
|
|
|
|
|
33
|
|
|
/** |
|
34
|
|
|
* True, if the message is a pinned message with the specified content. |
|
35
|
|
|
*/ |
|
36
|
|
|
protected bool $isPinned; |
|
37
|
|
|
|
|
38
|
|
|
public function __construct(?Photo $photo, string $caption, bool $isSecret, bool $isPinned) |
|
39
|
|
|
{ |
|
40
|
|
|
parent::__construct(); |
|
41
|
|
|
|
|
42
|
|
|
$this->photo = $photo; |
|
43
|
|
|
$this->caption = $caption; |
|
44
|
|
|
$this->isSecret = $isSecret; |
|
45
|
|
|
$this->isPinned = $isPinned; |
|
46
|
|
|
} |
|
47
|
|
|
|
|
48
|
|
|
public static function fromArray(array $array): PushMessageContentPhoto |
|
49
|
|
|
{ |
|
50
|
|
|
return new static( |
|
51
|
|
|
(isset($array['photo']) ? TdSchemaRegistry::fromArray($array['photo']) : null), |
|
52
|
|
|
$array['caption'], |
|
53
|
|
|
$array['is_secret'], |
|
54
|
|
|
$array['is_pinned'], |
|
55
|
|
|
); |
|
56
|
|
|
} |
|
57
|
|
|
|
|
58
|
|
|
public function typeSerialize(): array |
|
59
|
|
|
{ |
|
60
|
|
|
return [ |
|
61
|
|
|
'@type' => static::TYPE_NAME, |
|
62
|
|
|
'photo' => (isset($this->photo) ? $this->photo : null), |
|
63
|
|
|
'caption' => $this->caption, |
|
64
|
|
|
'is_secret' => $this->isSecret, |
|
65
|
|
|
'is_pinned' => $this->isPinned, |
|
66
|
|
|
]; |
|
67
|
|
|
} |
|
68
|
|
|
|
|
69
|
|
|
public function getPhoto(): ?Photo |
|
70
|
|
|
{ |
|
71
|
|
|
return $this->photo; |
|
72
|
|
|
} |
|
73
|
|
|
|
|
74
|
|
|
public function getCaption(): string |
|
75
|
|
|
{ |
|
76
|
|
|
return $this->caption; |
|
77
|
|
|
} |
|
78
|
|
|
|
|
79
|
|
|
public function getIsSecret(): bool |
|
80
|
|
|
{ |
|
81
|
|
|
return $this->isSecret; |
|
82
|
|
|
} |
|
83
|
|
|
|
|
84
|
|
|
public function getIsPinned(): bool |
|
85
|
|
|
{ |
|
86
|
|
|
return $this->isPinned; |
|
87
|
|
|
} |
|
88
|
|
|
} |
|
89
|
|
|
|