Total Complexity | 5 |
Total Lines | 41 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
7 | class ActionCard extends Message |
||
8 | { |
||
9 | |||
10 | protected $service; |
||
11 | |||
12 | public function __construct(DingTalkService $service,$title, $markdown, $hideAvatar = 0, $btnOrientation = 0) |
||
16 | } |
||
17 | |||
18 | public function setMessage($title, $markdown, $hideAvatar = 0, $btnOrientation = 0){ |
||
19 | $this->message = [ |
||
20 | 'msgtype' => 'actionCard', |
||
21 | 'actionCard' => [ |
||
22 | 'title' => $title, |
||
23 | 'text' => $markdown, |
||
24 | 'hideAvatar' => $hideAvatar, |
||
25 | 'btnOrientation' => $btnOrientation |
||
26 | ] |
||
27 | ]; |
||
28 | } |
||
29 | |||
30 | public function single($title,$url){ |
||
31 | $this->message['actionCard']['singleTitle'] = $title; |
||
32 | $this->message['actionCard']['singleURL'] = $url; |
||
33 | $this->service->setMessage($this); |
||
34 | return $this; |
||
35 | } |
||
36 | |||
37 | public function addButtons($title,$url){ |
||
38 | $this->message['actionCard']['btns'][] = [ |
||
39 | 'title' => $title, |
||
40 | 'actionURL' => $url |
||
41 | ]; |
||
42 | return $this; |
||
43 | } |
||
44 | |||
45 | public function send(){ |
||
48 | } |
||
49 | |||
50 | } |