| 141 | | if ($property->hasAnnotation('XMLIgnore')) { |
|---|
| 142 | | continue; |
|---|
| 143 | | } |
|---|
| 144 | | if (null !== $matcher && !$matcher->matches($property->getName())) { |
|---|
| 145 | | continue; |
|---|
| 146 | | } |
|---|
| 147 | | |
|---|
| 148 | | $propValue = $property->getValue($object); |
|---|
| 149 | | if ($property->hasAnnotation('XMLAttribute')) { |
|---|
| 150 | | $xmlAttribute = $property->getAnnotation('XMLAttribute'); |
|---|
| 151 | | $xmlWriter->writeAttribute($xmlAttribute->getAttributeName(), (string)$propValue); |
|---|
| 152 | | continue; |
|---|
| 153 | | } |
|---|
| 154 | | if ($property->hasAnnotation('XMLTag')) { |
|---|
| 155 | | $xmlTag = $property->getAnnotation('XMLTag'); |
|---|
| 156 | | $tagName = $xmlTag->getTagName(); |
|---|
| 157 | | $elementName = $xmlTag->getElementTagName(); |
|---|
| 158 | | } else { |
|---|
| 159 | | $tagName = $property->getName(); |
|---|
| 160 | | $elementName = null; |
|---|
| 161 | | } |
|---|
| 162 | | |
|---|
| 163 | | if (is_array($propValue)) { |
|---|
| 164 | | $this->serializeArray($propValue, $xmlWriter, $tagName, $elementName); |
|---|
| 165 | | } else { |
|---|
| | 141 | if ($property->hasAnnotation('XMLIgnore')) { |
|---|
| | 142 | continue; |
|---|
| | 143 | } |
|---|
| | 144 | if (null !== $matcher && !$matcher->matches($property->getName())) { |
|---|
| | 145 | continue; |
|---|
| | 146 | } |
|---|
| | 147 | |
|---|
| | 148 | $propValue = $property->getValue($object); |
|---|
| | 149 | if ($property->hasAnnotation('XMLAttribute')) { |
|---|
| | 150 | $xmlAttribute = $property->getAnnotation('XMLAttribute'); |
|---|
| | 151 | $xmlWriter->writeAttribute($xmlAttribute->getAttributeName(), (string)$propValue); |
|---|
| | 152 | continue; |
|---|
| | 153 | } |
|---|
| | 154 | if ($property->hasAnnotation('XMLTag')) { |
|---|
| | 155 | $xmlTag = $property->getAnnotation('XMLTag'); |
|---|
| | 156 | $tagName = $xmlTag->getTagName(); |
|---|
| | 157 | $elementName = $xmlTag->getElementTagName(); |
|---|
| | 158 | } else { |
|---|
| | 159 | $tagName = $property->getName(); |
|---|
| | 160 | $elementName = null; |
|---|
| | 161 | } |
|---|
| | 162 | |
|---|
| | 163 | if (is_array($propValue)) { |
|---|
| | 164 | $this->serializeArray($propValue, $xmlWriter, $tagName, $elementName); |
|---|
| | 165 | } else { |
|---|
| 193 | | if ($method->hasAnnotation('XMLIgnore')) { |
|---|
| 194 | | continue; |
|---|
| 195 | | } |
|---|
| 196 | | if (null !== $matcher && !$matcher->matches($method->getName())) { |
|---|
| 197 | | continue; |
|---|
| 198 | | } |
|---|
| 199 | | |
|---|
| 200 | | |
|---|
| 201 | | $returnValue = $method->invoke($object); |
|---|
| 202 | | if ($method->hasAnnotation('XMLAttribute')) { |
|---|
| 203 | | $xmlAttribute = $method->getAnnotation('XMLAttribute'); |
|---|
| 204 | | $xmlWriter->writeAttribute($xmlAttribute->getAttributeName(), (string)$returnValue); |
|---|
| 205 | | continue; |
|---|
| 206 | | } |
|---|
| 207 | | if ($method->hasAnnotation('XMLTag')) { |
|---|
| 208 | | $xmlTag = $method->getAnnotation('XMLTag'); |
|---|
| 209 | | $tagName = $xmlTag->getTagName(); |
|---|
| 210 | | $elementName = $xmlTag->getElementTagName(); |
|---|
| 211 | | } else { |
|---|
| 212 | | $tagName = $method->getName(); |
|---|
| 213 | | $elementName = null; |
|---|
| 214 | | } |
|---|
| 215 | | |
|---|
| 216 | | if (is_array($returnValue)) { |
|---|
| 217 | | $this->serializeArray($returnValue, $xmlWriter, $tagName, $elementName); |
|---|
| 218 | | } else { |
|---|
| | 193 | if ($method->hasAnnotation('XMLIgnore')) { |
|---|
| | 194 | continue; |
|---|
| | 195 | } |
|---|
| | 196 | if (null !== $matcher && !$matcher->matches($method->getName())) { |
|---|
| | 197 | continue; |
|---|
| | 198 | } |
|---|
| | 199 | |
|---|
| | 200 | |
|---|
| | 201 | $returnValue = $method->invoke($object); |
|---|
| | 202 | if ($method->hasAnnotation('XMLAttribute')) { |
|---|
| | 203 | $xmlAttribute = $method->getAnnotation('XMLAttribute'); |
|---|
| | 204 | $xmlWriter->writeAttribute($xmlAttribute->getAttributeName(), (string)$returnValue); |
|---|
| | 205 | continue; |
|---|
| | 206 | } |
|---|
| | 207 | if ($method->hasAnnotation('XMLTag')) { |
|---|
| | 208 | $xmlTag = $method->getAnnotation('XMLTag'); |
|---|
| | 209 | $tagName = $xmlTag->getTagName(); |
|---|
| | 210 | $elementName = $xmlTag->getElementTagName(); |
|---|
| | 211 | } else { |
|---|
| | 212 | $tagName = $method->getName(); |
|---|
| | 213 | $elementName = null; |
|---|
| | 214 | } |
|---|
| | 215 | |
|---|
| | 216 | if (is_array($returnValue)) { |
|---|
| | 217 | $this->serializeArray($returnValue, $xmlWriter, $tagName, $elementName); |
|---|
| | 218 | } else { |
|---|