1 | <?php |
||
5 | class KavenegarMessage |
||
6 | { |
||
7 | /** @var string */ |
||
8 | protected $receptor; |
||
9 | |||
10 | /** @var string */ |
||
11 | protected $sender; |
||
12 | |||
13 | /** @var string */ |
||
14 | protected $message; |
||
15 | |||
16 | /** @var string */ |
||
17 | protected $template; |
||
18 | |||
19 | /** @var string */ |
||
20 | protected $type; |
||
21 | |||
22 | /** @var array */ |
||
23 | protected $tokens = []; |
||
24 | |||
25 | /** |
||
26 | * @param string $receptor |
||
27 | * @return static |
||
28 | */ |
||
29 | public static function create($receptor = '') |
||
33 | |||
34 | /** |
||
35 | * @param string $receptor |
||
36 | */ |
||
37 | public function __construct($receptor = '') |
||
41 | |||
42 | /** |
||
43 | * Set the receptor. |
||
44 | * |
||
45 | * @param $receptor |
||
46 | * |
||
47 | * @return $this |
||
48 | */ |
||
49 | public function receptor($receptor) |
||
55 | |||
56 | /** |
||
57 | * Set the sender. |
||
58 | * |
||
59 | * @param $sender |
||
60 | * |
||
61 | * @return $this |
||
62 | */ |
||
63 | public function sender($sender) |
||
69 | |||
70 | /** |
||
71 | * Set the message. |
||
72 | * |
||
73 | * @param $message |
||
74 | * |
||
75 | * @return $this |
||
76 | */ |
||
77 | public function message($message) |
||
83 | |||
84 | /** |
||
85 | * Set the template. |
||
86 | * |
||
87 | * @param $template |
||
88 | * |
||
89 | * @return $this |
||
90 | */ |
||
91 | public function template($template) |
||
97 | |||
98 | /** |
||
99 | * Set the type. |
||
100 | * |
||
101 | * @param $type |
||
102 | * |
||
103 | * @return $this |
||
104 | */ |
||
105 | public function type($type) |
||
111 | |||
112 | /** |
||
113 | * Set the token. |
||
114 | * |
||
115 | * @param string $token |
||
116 | * @param string $num |
||
117 | * @return $this |
||
118 | */ |
||
119 | public function token($token, $num = '') |
||
125 | |||
126 | /** |
||
127 | * @return array |
||
128 | */ |
||
129 | public function toArray() |
||
152 | } |
||
153 |