1 | <?php |
||
10 | class QuickReply implements \JsonSerializable |
||
11 | { |
||
12 | use ValidatorTrait; |
||
13 | |||
14 | public const CONTENT_TYPE_TEXT = 'text'; |
||
15 | public const CONTENT_TYPE_PHONE = 'user_phone_number'; |
||
16 | public const CONTENT_TYPE_EMAIL = 'user_email'; |
||
17 | |||
18 | /** @deprecated Since version 3.2.0 and will be removed in version 4.0.0. */ |
||
19 | public const CONTENT_TYPE_LOCATION = 'location'; |
||
20 | |||
21 | /** |
||
22 | * @var string |
||
23 | */ |
||
24 | protected $contentType; |
||
25 | |||
26 | /** |
||
27 | * @var string|null |
||
28 | */ |
||
29 | protected $title; |
||
30 | |||
31 | /** |
||
32 | * @var string|null |
||
33 | */ |
||
34 | protected $payload; |
||
35 | |||
36 | /** |
||
37 | * @var string|null |
||
38 | */ |
||
39 | protected $imageUrl; |
||
40 | |||
41 | /** |
||
42 | * QuickReply constructor. |
||
43 | * |
||
44 | * @throws \Exception |
||
45 | */ |
||
46 | 6 | public function __construct(string $contentType = self::CONTENT_TYPE_TEXT) |
|
52 | |||
53 | /** |
||
54 | * @throws \Exception |
||
55 | * |
||
56 | * @return \Kerox\Messenger\Model\Message\QuickReply |
||
57 | */ |
||
58 | 6 | public static function create(string $contentType = self::CONTENT_TYPE_TEXT): self |
|
62 | |||
63 | /** |
||
64 | * @throws \Exception |
||
65 | * |
||
66 | * @return \Kerox\Messenger\Model\Message\QuickReply |
||
67 | */ |
||
68 | 5 | public function setTitle(string $title): self |
|
77 | |||
78 | /** |
||
79 | * @throws \Exception |
||
80 | * |
||
81 | * @return \Kerox\Messenger\Model\Message\QuickReply |
||
82 | */ |
||
83 | 4 | public function setPayload(string $payload): self |
|
92 | |||
93 | /** |
||
94 | * @throws \Exception |
||
95 | * |
||
96 | * @return \Kerox\Messenger\Model\Message\QuickReply |
||
97 | */ |
||
98 | 4 | public function setImageUrl(string $imageUrl): self |
|
106 | |||
107 | /** |
||
108 | * @throws \Kerox\Messenger\Exception\InvalidTypeException |
||
109 | */ |
||
110 | 6 | private function isValidContentType(string $contentType): void |
|
117 | |||
118 | 6 | private function getAllowedContentType(): array |
|
127 | |||
128 | /** |
||
129 | * @throws \Kerox\Messenger\Exception\InvalidTypeException |
||
130 | */ |
||
131 | 5 | private function checkContentType(): void |
|
137 | |||
138 | 2 | public function toArray(): array |
|
149 | |||
150 | 2 | public function jsonSerialize(): array |
|
154 | } |
||
155 |
This class constant has been deprecated. The supplier of the class has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the constant will be removed from the class and what other constant to use instead.