| Total Complexity | 6 |
| Total Lines | 43 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | class CreateQueueRequest extends BaseRequest |
||
| 9 | { |
||
| 10 | private $queueName; |
||
| 11 | private $attributes; |
||
| 12 | |||
| 13 | public function __construct($queueName, QueueAttributes $attributes = NULL) |
||
| 14 | { |
||
| 15 | parent::__construct('put', 'queues/' . $queueName); |
||
| 16 | |||
| 17 | if ($attributes == NULL) |
||
| 18 | { |
||
| 19 | $attributes = new QueueAttributes; |
||
| 20 | } |
||
| 21 | |||
| 22 | $this->queueName = $queueName; |
||
| 23 | $this->attributes = $attributes; |
||
| 24 | } |
||
| 25 | |||
| 26 | public function getQueueName() |
||
| 27 | { |
||
| 28 | return $this->queueName; |
||
| 29 | } |
||
| 30 | |||
| 31 | public function getQueueAttributes() |
||
| 32 | { |
||
| 33 | return $this->attributes; |
||
| 34 | } |
||
| 35 | |||
| 36 | public function generateBody() |
||
| 37 | { |
||
| 38 | $xmlWriter = new \XMLWriter; |
||
| 39 | $xmlWriter->openMemory(); |
||
| 40 | $xmlWriter->startDocument("1.0", "UTF-8"); |
||
| 41 | $xmlWriter->startElementNS(NULL, "Queue", Constants::MNS_XML_NAMESPACE); |
||
| 42 | $this->attributes->writeXML($xmlWriter); |
||
| 43 | $xmlWriter->endElement(); |
||
| 44 | $xmlWriter->endDocument(); |
||
| 45 | return $xmlWriter->outputMemory(); |
||
| 46 | } |
||
| 47 | |||
| 48 | public function generateQueryString() |
||
| 49 | { |
||
| 50 | return NULL; |
||
| 51 | } |
||
| 54 |