1 | <?php |
||
7 | class ZendeskMessage |
||
8 | { |
||
9 | /** @var string */ |
||
10 | protected $subject; |
||
11 | |||
12 | /** @var array */ |
||
13 | protected $requester = []; |
||
14 | |||
15 | /** @var string */ |
||
16 | protected $description = ''; |
||
17 | |||
18 | /** @var string */ |
||
19 | protected $type; |
||
20 | |||
21 | /** @var string */ |
||
22 | protected $status = 'new'; |
||
23 | |||
24 | /** @var array */ |
||
25 | protected $tags = []; |
||
26 | |||
27 | /** @var string */ |
||
28 | protected $content = ''; |
||
29 | |||
30 | /** @var bool */ |
||
31 | protected $isPublic = false; |
||
32 | |||
33 | /** @var string */ |
||
34 | protected $priority = 'normal'; |
||
35 | |||
36 | /** |
||
37 | * @param string $subject |
||
38 | * |
||
39 | * @return static |
||
40 | */ |
||
41 | 1 | public static function create($subject = '') |
|
45 | |||
46 | /** |
||
47 | * @param string $subject |
||
48 | */ |
||
49 | 6 | public function __construct($subject = '') |
|
53 | |||
54 | /** |
||
55 | * Set the ticket subject. |
||
56 | * |
||
57 | * @param $subject |
||
58 | * |
||
59 | * @return $this |
||
60 | */ |
||
61 | public function subject($subject) |
||
67 | |||
68 | /** |
||
69 | * Set the ticket customer name. |
||
70 | * |
||
71 | * @param string $name |
||
72 | * @param string $email |
||
73 | * |
||
74 | * @return $this |
||
75 | */ |
||
76 | 3 | public function from($name, $email) |
|
85 | |||
86 | /** |
||
87 | * Set the content message. |
||
88 | * |
||
89 | * @param $content |
||
90 | * |
||
91 | * @return $this |
||
92 | */ |
||
93 | 2 | public function content($content) |
|
99 | |||
100 | /** |
||
101 | * Set the description. |
||
102 | * |
||
103 | * @param string $description |
||
104 | * |
||
105 | * @return $this |
||
106 | */ |
||
107 | public function description($description) |
||
113 | |||
114 | /** |
||
115 | * Set the ticket type. |
||
116 | * Allowed values are problem, incident, question, or task. |
||
117 | * |
||
118 | * @param string $type |
||
119 | * |
||
120 | * @return $this |
||
121 | */ |
||
122 | public function type($type) |
||
131 | |||
132 | /** |
||
133 | * Set the ticket priority. |
||
134 | * Allowed values are urgent, high, normal, or low. |
||
135 | * |
||
136 | * @param string $priority |
||
137 | * |
||
138 | * @return $this |
||
139 | */ |
||
140 | public function priority($priority) |
||
149 | |||
150 | /** |
||
151 | * Set the ticket status. |
||
152 | * Allowed values are new, open, pending, hold, solved or closed. |
||
153 | * |
||
154 | * @return $this |
||
155 | */ |
||
156 | public function status($status) |
||
162 | |||
163 | /** |
||
164 | * Set the message to be public. |
||
165 | * |
||
166 | * @return $this |
||
167 | */ |
||
168 | 1 | public function visible() |
|
169 | { |
||
170 | 1 | $this->isPublic = true; |
|
171 | |||
172 | 1 | return $this; |
|
173 | } |
||
174 | |||
175 | /** |
||
176 | * Set an array of tags to add to the ticket. |
||
177 | * |
||
178 | * @param array $tags |
||
179 | * |
||
180 | * @return $this |
||
181 | */ |
||
182 | public function tags(array $tags) |
||
188 | |||
189 | /** |
||
190 | * @return array |
||
191 | */ |
||
192 | 6 | public function toArray() |
|
208 | } |
||
209 |