| 1 | <?php |
||
| 7 | class Attachment implements \JsonSerializable |
||
| 8 | { |
||
| 9 | const TYPE_AUDIO = 'audio'; |
||
| 10 | const TYPE_FILE = 'file'; |
||
| 11 | const TYPE_IMAGE = 'image'; |
||
| 12 | const TYPE_VIDEO = 'video'; |
||
| 13 | |||
| 14 | const TYPE_TEMPLATE = 'template'; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @var string |
||
| 18 | */ |
||
| 19 | private $type; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @var array|Template |
||
| 23 | */ |
||
| 24 | private $payload; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * Attachment constructor. |
||
| 28 | * |
||
| 29 | * @param $type |
||
| 30 | * @param array|Template $payload |
||
| 31 | */ |
||
| 32 | 23 | public function __construct($type, $payload = []) |
|
| 37 | |||
| 38 | /** |
||
| 39 | * @return string |
||
| 40 | */ |
||
| 41 | 6 | public function getType() |
|
| 45 | |||
| 46 | /** |
||
| 47 | * @return array|Template |
||
| 48 | */ |
||
| 49 | 3 | public function getPayload() |
|
| 53 | |||
| 54 | /** |
||
| 55 | * @return array |
||
| 56 | */ |
||
| 57 | 1 | public function jsonSerialize() |
|
| 64 | } |
||
| 65 |