| @@ 47-60 (lines=14) @@ | ||
| 44 | * |
|
| 45 | * @return \EasyWeChat\Support\Collection |
|
| 46 | */ |
|
| 47 | public function add($title, $description, $page_url, $icon_url, $comment = '') |
|
| 48 | { |
|
| 49 | $params = [ |
|
| 50 | 'title' => $title, |
|
| 51 | 'description' => $description, |
|
| 52 | 'page_url' => $page_url, |
|
| 53 | 'icon_url' => $icon_url, |
|
| 54 | ]; |
|
| 55 | if ($comment !== '') { |
|
| 56 | $params['comment'] = $comment; |
|
| 57 | } |
|
| 58 | ||
| 59 | return $this->parseJSON('json', [self::API_ADD, $params]); |
|
| 60 | } |
|
| 61 | ||
| 62 | /** |
|
| 63 | * update a page info. |
|
| @@ 74-88 (lines=15) @@ | ||
| 71 | * |
|
| 72 | * @return \EasyWeChat\Support\Collection |
|
| 73 | */ |
|
| 74 | public function update($page_id, $title, $description, $page_url, $icon_url, $comment = '') |
|
| 75 | { |
|
| 76 | $params = [ |
|
| 77 | 'page_id' => intval($page_id), |
|
| 78 | 'title' => $title, |
|
| 79 | 'description' => $description, |
|
| 80 | 'page_url' => $page_url, |
|
| 81 | 'icon_url' => $icon_url, |
|
| 82 | ]; |
|
| 83 | if ($comment !== '') { |
|
| 84 | $params['comment'] = $comment; |
|
| 85 | } |
|
| 86 | ||
| 87 | return $this->parseJSON('json', [self::API_UPDATE, $params]); |
|
| 88 | } |
|
| 89 | ||
| 90 | /** |
|
| 91 | * Fetch batch of pages by page_ids. |
|