1 | <?php |
||
28 | abstract class AbstractMessage extends Attribute |
||
29 | { |
||
30 | /** |
||
31 | * Message type. |
||
32 | * |
||
33 | * @var string |
||
34 | */ |
||
35 | protected $type; |
||
36 | |||
37 | /** |
||
38 | * Message id. |
||
39 | * |
||
40 | * @var int |
||
41 | */ |
||
42 | protected $id; |
||
43 | |||
44 | /** |
||
45 | * Message target user open id. |
||
46 | * |
||
47 | * @var string |
||
48 | */ |
||
49 | protected $to; |
||
50 | |||
51 | /** |
||
52 | * Message sender open id. |
||
53 | * |
||
54 | * @var string |
||
55 | */ |
||
56 | protected $from; |
||
57 | |||
58 | /** |
||
59 | * Message attributes. |
||
60 | * |
||
61 | * @var array |
||
62 | */ |
||
63 | protected $properties = []; |
||
64 | |||
65 | /** |
||
66 | * Return type name message. |
||
67 | * |
||
68 | * @return string |
||
69 | */ |
||
70 | 4 | public function getType() |
|
74 | |||
75 | /** |
||
76 | * Magic getter. |
||
77 | * |
||
78 | * @param string $property |
||
79 | * |
||
80 | * @return mixed |
||
81 | */ |
||
82 | 7 | public function __get($property) |
|
90 | |||
91 | /** |
||
92 | * Magic setter. |
||
93 | * |
||
94 | * @param string $property |
||
95 | * @param mixed $value |
||
96 | * |
||
97 | * @return AbstractMessage |
||
98 | */ |
||
99 | 5 | public function __set($property, $value) |
|
109 | } |
||
110 |