• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Types\BaseType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中DTS\eBaySDK\Types\BaseType的典型用法代码示例。如果您正苦于以下问题:PHP BaseType类的具体用法?PHP BaseType怎么用?PHP BaseType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了BaseType类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: callOperation

 /**
  * Sends an API request.
  *
  * This method overrides the parent so that it can modify
  * the request object before is handled by the parent class.
  *
  * @param string $name The name of the operation.
  * @param \DTS\eBaySDK\Types\BaseType $request Request object containing the request information.
  * @param string The name of the PHP class that will be created from the XML response.
  *
  * @return mixed A response object created from the XML respose.
  */
 protected function callOperation($name, \DTS\eBaySDK\Types\BaseType $request, $responseClass)
 {
     /**
        Modify the request object to add xop:Include element.
     */
     if ($name === 'uploadFile' && $request->hasAttachment()) {
         /**
            Don't modify a request if the file attachment already exists.
         */
         if (!isset($request->fileAttachment)) {
             $request->fileAttachment = new \DTS\eBaySDK\FileTransfer\Types\FileAttachment();
         }
         if (!isset($request->fileAttachment->Data)) {
             $request->fileAttachment->Data = new \DTS\eBaySDK\FileTransfer\Types\Data(['xopInclude' => new \DTS\eBaySDK\FileTransfer\Types\XopInclude(['href' => 'cid:[email protected]'])]);
         }
         if (!isset($request->fileAttachment->Size)) {
             $attachment = $request->attachment();
             $request->fileAttachment->Size = strlen($attachment['data']);
         }
     }
     return parent::callOperation($name, $request, $responseClass);
 }
开发者ID:robinkanters,项目名称:ebay-sdk-php,代码行数:34,代码来源:FileTransferBaseService.php


示例2: callOperation

 /**
  * Sends an API request.
  *
  * This method overrides the parent so that it can modify
  * the request object before is handled by the parent class.
  *
  * @param string $name The name of the operation.
  * @param \DTS\eBaySDK\Types\BaseType $request Request object containing the request information.
  * @param string The name of the PHP class that will be created from the XML response.
  *
  * @return mixed A response object created from the XML respose.
  */
 protected function callOperation($name, \DTS\eBaySDK\Types\BaseType $request, $responseClass)
 {
     /**
        Modify the request object to add xop:Include element.
     */
     if ($name === 'uploadFile' && $request->hasAttachment()) {
         /**
            Don't modify a request if the file attachment already exists.
         */
         if (!isset($request->fileAttachment)) {
             $request->fileAttachment = new \DTS\eBaySDK\FileTransfer\Types\FileAttachment();
         }
         if (!isset($request->fileAttachment->Data)) {
             $request->fileAttachment->Data = '<xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:[email protected]"/>';
         }
         if (!isset($request->fileAttachment->Size)) {
             $attachment = $request->attachment();
             $request->fileAttachment->Size = strlen($attachment['data']);
         }
     }
     return parent::callOperation($name, $request, $responseClass);
 }
开发者ID:ronlobo,项目名称:ebay-sdk-php,代码行数:34,代码来源:FileTransferBaseService.php


示例3: buildXopDocument

 /**
  * Builds the XOP document part of the request body string.
  *
  * @param \DTS\eBaySDK\Types\BaseType $request Request object containing the request information.
  *
  * @return string The XOP document part of request body.
  */
 private function buildXopDocument(\DTS\eBaySDK\Types\BaseType $request)
 {
     return sprintf('%s%s%s%s%s', '--MIME_boundary' . self::CRLF, 'Content-Type: application/xop+xml;charset=UTF-8;type="text/xml"' . self::CRLF, 'Content-Transfer-Encoding: 8bit' . self::CRLF, 'Content-ID: <[email protected]>' . self::CRLF . self::CRLF, $request->toRequestXml() . self::CRLF);
 }
开发者ID:jasonthebomb,项目名称:eBayService,代码行数:11,代码来源:BaseService.php


示例4: buildRequestHeaders

 /**
  * Helper function that builds the HTTP request headers.
  *
  * @param string $name The name of the operation.
  * @param \DTS\eBaySDK\Types\BaseType $request Request object containing the request information.
  * @param string $body The request body.
  *
  * @return array An associative array of HTTP headers.
  */
 private function buildRequestHeaders($name, $request, $body)
 {
     $headers = $this->getEbayHeaders($name);
     if ($request->hasAttachment()) {
         $headers['Content-Type'] = 'multipart/related;boundary=MIME_boundary;type="application/xop+xml";start="<[email protected]>";start-info="text/xml"';
     } else {
         $headers['Content-Type'] = 'text/xml';
     }
     $headers['Content-Length'] = strlen($body);
     return $headers;
 }
开发者ID:robinkanters,项目名称:ebay-sdk-php,代码行数:20,代码来源:BaseService.php


示例5: callOperation

 /**
  * Sends an API request.
  *
  * @param string $name The name of the operation.
  * @param \DTS\eBaySDK\Types\BaseType $request Request object containing the request information.
  * @param string The name of the PHP class that will be created from the XML response.
  *
  * @return mixed A response object created from the XML respose.
  */
 protected function callOperation($name, \DTS\eBaySDK\Types\BaseType $request, $responseClass)
 {
     $debug = $this->config('debug');
     $url = $this->getUrl();
     $body = $request->toRequestXml();
     $headers = $this->getEbayHeaders($name);
     $headers['Content-Type'] = 'text/xml';
     $headers['Content-Length'] = strlen($body);
     if ($debug) {
         $this->logRequest($url, $name, $headers, $body);
     }
     $response = $this->httpClient->post($url, $headers, $body);
     if ($debug) {
         $this->logResponse($response);
     }
     $xmlParser = new XmlParser($responseClass);
     return $xmlParser->parse($response);
 }
开发者ID:bryon-czoch,项目名称:eBay-CLI,代码行数:27,代码来源:BaseService.php


示例6: __construct

 /**
  * @param array $values Optional properties and values to assign to the object.
  */
 public function __construct(array $values = [])
 {
     list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values);
     parent::__construct($parentValues);
     if (!array_key_exists(__CLASS__, self::$properties)) {
         self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes);
     }
     $this->setValues(__CLASS__, $childValues);
 }
开发者ID:robinkanters,项目名称:ebay-sdk-php,代码行数:12,代码来源:TokenType.php


示例7: __construct

 /**
  * @param array $values Optional properties and values to assign to the object.
  */
 public function __construct(array $values = array())
 {
     list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values);
     parent::__construct($parentValues);
     if (!array_key_exists(__CLASS__, self::$properties)) {
         self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes);
     }
     if (!array_key_exists(__CLASS__, self::$xmlNamespaces)) {
         self::$xmlNamespaces[__CLASS__] = 'urn:ebay:apis:eBLBaseComponents';
     }
     $this->setValues(__CLASS__, $childValues);
 }
开发者ID:ronlobo,项目名称:ebay-sdk-php,代码行数:15,代码来源:UserType.php


示例8: __construct

 /**
  * @param array $values Optional properties and values to assign to the object.
  */
 public function __construct(array $values = [])
 {
     list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values);
     parent::__construct($parentValues);
     if (!array_key_exists(__CLASS__, self::$properties)) {
         self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes);
     }
     if (!array_key_exists(__CLASS__, self::$xmlNamespaces)) {
         self::$xmlNamespaces[__CLASS__] = 'xmlns="http://www.ebay.com/marketplace/returns/v1/services"';
     }
     $this->setValues(__CLASS__, $childValues);
 }
开发者ID:robinkanters,项目名称:ebay-sdk-php,代码行数:15,代码来源:BaseActivityOptionType.php


示例9: __construct

 public function __construct(array $values = array())
 {
     list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values);
     parent::__construct($parentValues);
     if (!array_key_exists(__CLASS__, self::$properties)) {
         self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes);
     }
     if (!array_key_exists(__CLASS__, self::$xmlNamespaces)) {
         self::$xmlNamespaces[__CLASS__] = 'http://davidtsadler.com';
     }
     $this->setValues(__CLASS__, $childValues);
 }
开发者ID:ronlobo,项目名称:ebay-sdk-php,代码行数:12,代码来源:SimpleClass.php


示例10: __construct

 /**
  * @param array $values Optional properties and values to assign to the object.
  */
 public function __construct(array $values = [])
 {
     list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values);
     parent::__construct($parentValues);
     if (!array_key_exists(__CLASS__, self::$properties)) {
         self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes);
     }
     if (!array_key_exists(__CLASS__, self::$xmlNamespaces)) {
         self::$xmlNamespaces[__CLASS__] = 'xmlns="urn:ebay:apis:eBLBaseComponents"';
     }
     if (!array_key_exists(__CLASS__, self::$requestXmlRootElementNames)) {
         self::$requestXmlRootElementNames[__CLASS__] = 'SetShipmentTrackingInfoRequest';
     }
     $this->setValues(__CLASS__, $childValues);
 }
开发者ID:robinkanters,项目名称:ebay-sdk-php,代码行数:18,代码来源:SetShipmentTrackingInfoRequestType.php



注:本文中的DTS\eBaySDK\Types\BaseType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Eccube\Application类代码示例发布时间:2022-05-23
下一篇:
PHP Types\AbstractRequestType类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap