DateTimeArraysObject.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. /**
  3. * DateTimeArraysObject.php
  4. *
  5. * @author Jens Hassler <lukey@skytrek.de>
  6. * @since 12/2013
  7. */
  8. namespace JMS\Serializer\Tests\Fixtures;
  9. use JMS\Serializer\Annotation\Type;
  10. use JMS\Serializer\Annotation\XmlMap;
  11. use JMS\Serializer\Annotation\XmlList;
  12. use JMS\Serializer\Annotation\XmlKeyValuePairs;
  13. class DateTimeArraysObject
  14. {
  15. /**
  16. * @var \DateTime[]
  17. * @Type("array<DateTime>")
  18. */
  19. private $arrayWithDefaultDateTime;
  20. /**
  21. * @var \DateTime[]
  22. * @Type("array<DateTime<'d.m.Y H:i:s'>>")
  23. */
  24. private $arrayWithFormattedDateTime;
  25. /**
  26. * @var \DateTime[]
  27. * @Type("array<string,DateTime<'d.m.Y H:i:s'>>")
  28. * @XmlKeyValuePairs
  29. */
  30. private $namedArrayWithFormattedDate;
  31. function __construct($arrayWithDefaultDateTime, $arrayWithFormattedDateTime, $namedArrayWithFormattedDate)
  32. {
  33. $this->arrayWithDefaultDateTime = $arrayWithDefaultDateTime;
  34. $this->arrayWithFormattedDateTime = $arrayWithFormattedDateTime;
  35. $this->namedArrayWithFormattedDate = $namedArrayWithFormattedDate;
  36. }
  37. /**
  38. * @return \DateTime[]
  39. */
  40. public function getArrayWithDefaultDateTime()
  41. {
  42. return $this->arrayWithDefaultDateTime;
  43. }
  44. /**
  45. * @return \DateTime[]
  46. */
  47. public function getArrayWithFormattedDateTime()
  48. {
  49. return $this->arrayWithFormattedDateTime;
  50. }
  51. /**
  52. * @return \DateTime[]
  53. */
  54. public function getNamedArrayWithFormattedDate()
  55. {
  56. return $this->namedArrayWithFormattedDate;
  57. }
  58. }