CurrencyAwarePrice.php 519 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace JMS\SerializerBundle\Tests\Fixtures;
  3. use JMS\SerializerBundle\Annotation as Serializer;
  4. /** @Serializer\XmlRoot("price") */
  5. class CurrencyAwarePrice
  6. {
  7. /**
  8. * @Serializer\XmlAttribute
  9. * @Serializer\Type("string")
  10. */
  11. private $currency;
  12. /**
  13. * @Serializer\XmlValue
  14. * @Serializer\Type("double")
  15. */
  16. private $amount;
  17. public function __construct($amount, $currency = 'EUR')
  18. {
  19. $this->currency = $currency;
  20. $this->amount = $amount;
  21. }
  22. }