NamedDateTimeArraysObject.php 635 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace JMS\Serializer\Tests\Fixtures;
  3. use JMS\Serializer\Annotation\Type;
  4. use JMS\Serializer\Annotation\XmlKeyValuePairs;
  5. class NamedDateTimeArraysObject
  6. {
  7. /**
  8. * @var \DateTime[]
  9. * @Type("array<string,DateTime<'d.m.Y H:i:s'>>")
  10. * @XmlKeyValuePairs
  11. */
  12. private $namedArrayWithFormattedDate;
  13. function __construct($namedArrayWithFormattedDate)
  14. {
  15. $this->namedArrayWithFormattedDate = $namedArrayWithFormattedDate;
  16. }
  17. /**
  18. * @return \DateTime[]
  19. */
  20. public function getNamedArrayWithFormattedDate()
  21. {
  22. return $this->namedArrayWithFormattedDate;
  23. }
  24. }