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