ObjectWithNamespacesAndList.php 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <?php
  2. namespace JMS\Serializer\Tests\Fixtures;
  3. use JMS\Serializer\Annotation\SerializedName;
  4. use JMS\Serializer\Annotation\Type;
  5. use JMS\Serializer\Annotation\XmlElement;
  6. use JMS\Serializer\Annotation\XmlList;
  7. use JMS\Serializer\Annotation\XmlMap;
  8. use JMS\Serializer\Annotation\XmlNamespace;
  9. use JMS\Serializer\Annotation\XmlRoot;
  10. /**
  11. * @XmlRoot("ObjectWithNamespacesAndList", namespace="http://example.com/namespace")
  12. * @XmlNamespace(uri="http://example.com/namespace")
  13. * @XmlNamespace(uri="http://example.com/namespace2", prefix="x")
  14. */
  15. class ObjectWithNamespacesAndList
  16. {
  17. /**
  18. * @Type("string")
  19. * @SerializedName("name")
  20. * @XmlElement(namespace="http://example.com/namespace")
  21. */
  22. public $name;
  23. /**
  24. * @Type("string")
  25. * @SerializedName("name")
  26. * @XmlElement(namespace="http://example.com/namespace2")
  27. */
  28. public $nameAlternativeB;
  29. /**
  30. * @Type("array<string>")
  31. * @SerializedName("phones")
  32. * @XmlElement(namespace="http://example.com/namespace2")
  33. * @XmlList(inline = false, entry = "phone", namespace="http://example.com/namespace2")
  34. */
  35. public $phones;
  36. /**
  37. * @Type("array<string,string>")
  38. * @SerializedName("addresses")
  39. * @XmlElement(namespace="http://example.com/namespace2")
  40. * @XmlMap(inline = false, entry = "address", keyAttribute = "id", namespace="http://example.com/namespace2")
  41. */
  42. public $addresses;
  43. /**
  44. * @Type("array<string>")
  45. * @SerializedName("phones")
  46. * @XmlList(inline = true, entry = "phone", namespace="http://example.com/namespace")
  47. */
  48. public $phonesAlternativeB;
  49. /**
  50. * @Type("array<string,string>")
  51. * @SerializedName("addresses")
  52. * @XmlMap(inline = true, entry = "address", keyAttribute = "id", namespace="http://example.com/namespace")
  53. */
  54. public $addressesAlternativeB;
  55. /**
  56. * @Type("array<string>")
  57. * @SerializedName("phones")
  58. * @XmlList(inline = true, entry = "phone", namespace="http://example.com/namespace2")
  59. */
  60. public $phonesAlternativeC;
  61. /**
  62. * @Type("array<string,string>")
  63. * @SerializedName("addresses")
  64. * @XmlMap(inline = true, entry = "address", keyAttribute = "id", namespace="http://example.com/namespace2")
  65. */
  66. public $addressesAlternativeC;
  67. /**
  68. * @Type("array<string>")
  69. * @SerializedName("phones")
  70. * @XmlList(inline = false, entry = "phone")
  71. */
  72. public $phonesAlternativeD;
  73. /**
  74. * @Type("array<string,string>")
  75. * @SerializedName("addresses")
  76. * @XmlMap(inline = false, entry = "address", keyAttribute = "id")
  77. */
  78. public $addressesAlternativeD;
  79. }