@@ -41,13 +41,23 @@ discard block |
||
| 41 | 41 | { |
| 42 | 42 | $this->writer->startElement('offer'); |
| 43 | 43 | $this->writer->writeAttribute('id', $this->id); |
| 44 | - if(null !== $this->type) $this->writer->writeAttribute('type', $this->type); |
|
| 44 | + if(null !== $this->type) { |
|
| 45 | + $this->writer->writeAttribute('type', $this->type); |
|
| 46 | + } |
|
| 45 | 47 | $this->writer->writeAttribute('available', $this->available ? 'true' : 'false'); |
| 46 | 48 | |
| 47 | - if(null !== $this->url) $this->writer->writeElement('url', $this->url); |
|
| 48 | - if(null !== $this->price) $this->writer->writeElement('price', $this->price); |
|
| 49 | - if(null !== $this->currencyId) $this->writer->writeElement('currencyId', $this->currencyId); |
|
| 50 | - if(null !== $this->categoryId) $this->writer->writeElement('categoryId', $this->categoryId); |
|
| 49 | + if(null !== $this->url) { |
|
| 50 | + $this->writer->writeElement('url', $this->url); |
|
| 51 | + } |
|
| 52 | + if(null !== $this->price) { |
|
| 53 | + $this->writer->writeElement('price', $this->price); |
|
| 54 | + } |
|
| 55 | + if(null !== $this->currencyId) { |
|
| 56 | + $this->writer->writeElement('currencyId', $this->currencyId); |
|
| 57 | + } |
|
| 58 | + if(null !== $this->categoryId) { |
|
| 59 | + $this->writer->writeElement('categoryId', $this->categoryId); |
|
| 60 | + } |
|
| 51 | 61 | |
| 52 | 62 | if (count($this->pictures) > 0) { |
| 53 | 63 | foreach ($this->pictures as $picture) { |
@@ -55,17 +65,39 @@ discard block |
||
| 55 | 65 | } |
| 56 | 66 | } |
| 57 | 67 | |
| 58 | - if($this->store) $this->writer->writeElement('store', $this->store ? 'true' : 'false'); |
|
| 59 | - if($this->delivery) $this->writer->writeElement('delivery', $this->delivery ? 'true' : 'false'); |
|
| 60 | - if(null !== $this->name) $this->writer->writeElement('name', $this->name); |
|
| 61 | - if(null !== $this->vendor) $this->writer->writeElement('vendor', $this->vendor); |
|
| 62 | - if(null !== $this->vendorCode) $this->writer->writeElement('vendorCode', $this->vendorCode); |
|
| 63 | - if(null !== $this->model) $this->writer->writeElement('model', $this->model); |
|
| 64 | - if(null !== $this->description) $this->writer->writeElement('description', $this->description); |
|
| 65 | - if(null !== $this->salesNotes) $this->writer->writeElement('sales_notes', $this->salesNotes); |
|
| 66 | - if(null !== $this->barcode) $this->writer->writeElement('barcode', $this->barcode); |
|
| 67 | - if(null !== $this->age) $this->writer->writeElement('age', $this->age); |
|
| 68 | - if($this->manufacturerWarranty) $this->writer->writeElement('manufacturer_warranty', $this->manufacturerWarranty ? 'true' : 'false'); |
|
| 68 | + if($this->store) { |
|
| 69 | + $this->writer->writeElement('store', $this->store ? 'true' : 'false'); |
|
| 70 | + } |
|
| 71 | + if($this->delivery) { |
|
| 72 | + $this->writer->writeElement('delivery', $this->delivery ? 'true' : 'false'); |
|
| 73 | + } |
|
| 74 | + if(null !== $this->name) { |
|
| 75 | + $this->writer->writeElement('name', $this->name); |
|
| 76 | + } |
|
| 77 | + if(null !== $this->vendor) { |
|
| 78 | + $this->writer->writeElement('vendor', $this->vendor); |
|
| 79 | + } |
|
| 80 | + if(null !== $this->vendorCode) { |
|
| 81 | + $this->writer->writeElement('vendorCode', $this->vendorCode); |
|
| 82 | + } |
|
| 83 | + if(null !== $this->model) { |
|
| 84 | + $this->writer->writeElement('model', $this->model); |
|
| 85 | + } |
|
| 86 | + if(null !== $this->description) { |
|
| 87 | + $this->writer->writeElement('description', $this->description); |
|
| 88 | + } |
|
| 89 | + if(null !== $this->salesNotes) { |
|
| 90 | + $this->writer->writeElement('sales_notes', $this->salesNotes); |
|
| 91 | + } |
|
| 92 | + if(null !== $this->barcode) { |
|
| 93 | + $this->writer->writeElement('barcode', $this->barcode); |
|
| 94 | + } |
|
| 95 | + if(null !== $this->age) { |
|
| 96 | + $this->writer->writeElement('age', $this->age); |
|
| 97 | + } |
|
| 98 | + if($this->manufacturerWarranty) { |
|
| 99 | + $this->writer->writeElement('manufacturer_warranty', $this->manufacturerWarranty ? 'true' : 'false'); |
|
| 100 | + } |
|
| 69 | 101 | |
| 70 | 102 | if (count($this->params) > 0) { |
| 71 | 103 | foreach ($this->params as $param) { |