ObjectWithXmlNamespacesAndObjectProperty.php 895 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace JMS\Serializer\Tests\Fixtures;
  3. use JMS\Serializer\Annotation\Type;
  4. use JMS\Serializer\Annotation\XmlElement;
  5. use JMS\Serializer\Annotation\XmlNamespace;
  6. use JMS\Serializer\Annotation\XmlRoot;
  7. /**
  8. * @XmlRoot("property:test-object", namespace="http://example.com/namespace-property")
  9. * @XmlNamespace(uri="http://example.com/namespace-property", prefix="property")
  10. */
  11. class ObjectWithXmlNamespacesAndObjectProperty
  12. {
  13. /**
  14. * @Type("string")
  15. * @XmlElement(namespace="http://example.com/namespace-property");
  16. */
  17. private $title;
  18. /**
  19. * @Type("JMS\Serializer\Tests\Fixtures\ObjectWithXmlNamespacesAndObjectPropertyAuthor")
  20. * @XmlElement(namespace="http://example.com/namespace-property")
  21. */
  22. private $author;
  23. public function __construct($title, $author)
  24. {
  25. $this->title = $title;
  26. $this->author = $author;
  27. }
  28. }