AccountAttributes.php
1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
namespace AliyunMNS\Model;
use AliyunMNS\Constants;
/**
* Please refer to
* https://docs.aliyun.com/?spm=#/pub/mns/api_reference/intro&intro
* for more details
*/
class AccountAttributes
{
private $loggingBucket;
public function __construct(
$loggingBucket = NULL)
{
$this->loggingBucket = $loggingBucket;
}
public function setLoggingBucket($loggingBucket)
{
$this->loggingBucket = $loggingBucket;
}
public function getLoggingBucket()
{
return $this->loggingBucket;
}
public function writeXML(\XMLWriter $xmlWriter)
{
if ($this->loggingBucket !== NULL)
{
$xmlWriter->writeElement(Constants::LOGGING_BUCKET, $this->loggingBucket);
}
}
static public function fromXML(\XMLReader $xmlReader)
{
$loggingBucket = NULL;
while ($xmlReader->read())
{
if ($xmlReader->nodeType == \XMLReader::ELEMENT)
{
switch ($xmlReader->name) {
case 'LoggingBucket':
$xmlReader->read();
if ($xmlReader->nodeType == \XMLReader::TEXT)
{
$loggingBucket = $xmlReader->value;
}
break;
}
}
}
$attributes = new AccountAttributes($loggingBucket);
return $attributes;
}
}
?>