/** * @param Button $button * @throws \Jenner\Wechat\Exception\WechatException */ public function addSubButton(Button $button) { if (!isset($this->button['sub_button'])) { $this->button['sub_button'] = []; } if (count($this->button) == 5) { throw new WechatException('too many sub buttons'); } $this->button['sub_button'][] = $button->getButton(); }
public function addButton(Button $button) { $this->buttons[] = $button->getButton(); }