1 | <?php |
||
12 | abstract class AbstractMessage implements \JsonSerializable |
||
13 | { |
||
14 | |||
15 | const TYPE_AUTHENTICATION_REQUEST = 'authenticationRequest'; |
||
16 | const TYPE_AUTHENTICATION_RESPONSE = 'authenticationResponse'; |
||
17 | const TYPE_STATUS_UPDATES = 'statusUpdates'; |
||
18 | const TYPE_POPULAR_CHANNELS_REQUEST = 'popularChannelsRequest'; |
||
19 | const TYPE_POPULAR_CHANNELS_RESPONSE = 'popularChannelsResponse'; |
||
20 | const TYPE_MOST_ACTIVE_WATCHERS_REQUEST = 'mostActiveWatchersRequest'; |
||
21 | const TYPE_MOST_ACTIVE_WATCHERS_RESPONSE = 'mostActiveWatchersResponse'; |
||
22 | const TYPE_INSTANCES_REQUEST = 'instancesRequest'; |
||
23 | const TYPE_INSTANCES_RESPONSE = 'instancesResponse'; |
||
24 | const TYPE_USERS_REQUEST = 'usersRequest'; |
||
25 | const TYPE_USERS_RESPONSE = 'usersResponse'; |
||
26 | |||
27 | /** |
||
28 | * @var string |
||
29 | */ |
||
30 | private $_type; |
||
31 | |||
32 | /** |
||
33 | * @var mixed |
||
34 | */ |
||
35 | private $_payload; |
||
36 | |||
37 | |||
38 | /** |
||
39 | * @param string $type |
||
40 | * @param mixed $payload |
||
41 | */ |
||
42 | 1 | public function __construct($type, $payload) |
|
47 | |||
48 | |||
49 | /** |
||
50 | * @return string |
||
51 | */ |
||
52 | public function getType() |
||
56 | |||
57 | |||
58 | /** |
||
59 | * @return mixed |
||
60 | */ |
||
61 | public function getPayload() |
||
65 | |||
66 | |||
67 | /** |
||
68 | * @inheritdoc |
||
69 | */ |
||
70 | public function jsonSerialize() |
||
77 | |||
78 | } |
||
79 |