| Total Complexity | 5 |
| Total Lines | 35 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | class SetSubscriptionAttributeRequest extends BaseRequest |
||
| 9 | { |
||
| 10 | |||
| 11 | public function __construct(UpdateSubscriptionAttributes $attributes = NULL) |
||
| 12 | { |
||
| 13 | parent::__construct('put', 'topics/' . $attributes->getTopicName() . '/subscriptions/' . $attributes->getSubscriptionName() . '?metaoverride=true'); |
||
| 14 | |||
| 15 | if ($attributes == NULL) |
||
| 16 | { |
||
| 17 | $attributes = new UpdateSubscriptionAttributes(); |
||
| 18 | } |
||
| 19 | |||
| 20 | $this->attributes = $attributes; |
||
| 21 | } |
||
| 22 | |||
| 23 | public function getSubscriptionAttributes() |
||
| 24 | { |
||
| 25 | return $this->attributes; |
||
| 26 | } |
||
| 27 | |||
| 28 | public function generateBody() |
||
| 29 | { |
||
| 30 | $xmlWriter = new \XMLWriter; |
||
| 31 | $xmlWriter->openMemory(); |
||
| 32 | $xmlWriter->startDocument("1.0", "UTF-8"); |
||
| 33 | $xmlWriter->startElementNS(NULL, "Subscription", Constants::MNS_XML_NAMESPACE); |
||
| 34 | $this->attributes->writeXML($xmlWriter); |
||
| 35 | $xmlWriter->endElement(); |
||
| 36 | $xmlWriter->endDocument(); |
||
| 37 | return $xmlWriter->outputMemory(); |
||
| 38 | } |
||
| 39 | |||
| 40 | public function generateQueryString() |
||
| 41 | { |
||
| 42 | return NULL; |
||
| 43 | } |
||
| 47 |