public function __construct(AccessToken $accessToken, $config) { parent::setAccessToken($accessToken); $this->config = $config; $this->deviceType = $this->config['device_type']; $this->productId = $this->config['product_id']; }
/** * Notice constructor. * * @param \EasyWeChat\Core\AccessToken $accessToken */ public function __construct(AccessToken $accessToken) { parent::__construct($accessToken); $this->messageBackup = $this->message; }
/** * Get API by type. * * @param string $type * * @return string */ public function getAPIByType($type) { switch ($type) { case 'news_image': $api = parent::getAPI(self::API_NEWS_IMAGE_UPLOAD); break; default: $api = parent::getAPI(self::API_UPLOAD); } return $api; }