添加网站文件
This commit is contained in:
68
vendor/aliyuncs/oss-sdk-php/src/OSS/Model/RequestPaymentConfig.php
vendored
Normal file
68
vendor/aliyuncs/oss-sdk-php/src/OSS/Model/RequestPaymentConfig.php
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
namespace OSS\Model;
|
||||
|
||||
|
||||
use OSS\Core\OssException;
|
||||
|
||||
/**
|
||||
* Class RequestPaymentConfig
|
||||
* @package OSS\Model
|
||||
*
|
||||
* @link https://help.aliyun.com/document_detail/117914.htm
|
||||
*/
|
||||
class RequestPaymentConfig implements XmlConfig
|
||||
{
|
||||
/**
|
||||
* RequestPaymentConfig constructor.
|
||||
* @param null $payer
|
||||
*/
|
||||
public function __construct($payer = null)
|
||||
{
|
||||
$this->payer = $payer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse ServerSideEncryptionConfig from the xml.
|
||||
*
|
||||
* @param string $strXml
|
||||
* @throws OssException
|
||||
* @return null
|
||||
*/
|
||||
public function parseFromXml($strXml)
|
||||
{
|
||||
$xml = simplexml_load_string($strXml);
|
||||
if (isset($xml->Payer)) {
|
||||
$this->payer = strval($xml->Payer);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Serialize the object into xml string.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function serializeToXml()
|
||||
{
|
||||
$xml = new \SimpleXMLElement('<?xml version="1.0" encoding="utf-8"?><RequestPaymentConfiguration></RequestPaymentConfiguration>');
|
||||
if (isset($this->payer)) {
|
||||
$xml->addChild('Payer', $this->payer);
|
||||
}
|
||||
return $xml->asXML();
|
||||
}
|
||||
|
||||
public function __toString()
|
||||
{
|
||||
return $this->serializeToXml();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getPayer()
|
||||
{
|
||||
return $this->payer;
|
||||
}
|
||||
|
||||
private $payer = "";
|
||||
}
|
||||
Reference in New Issue
Block a user