ZF-5549: Date objects not being sent with typed VOs
Description
When sending over an array of database rows which have been turned into typed VOs, when they arrive back in the Flex environment they are not being converted into Date objects.
here is an example of what the array that is being sent looks like:
Array ( [0] => Array ( [Prf] => PrfDTO Object ( [_explicitType] => com.gn.model.dtos.PrfDTO [id] => 1 [name] => Test PRF 1 [io] => 45488366 [production_revenue] => 120 [io_total] => 250 [io_date] => DateTime Object ( )
[division] => GN Kids
[approval_date] => DateTime Object
(
)
[approved_by] => Adam Duro
[flight_date] => DateTime Object
(
)
[account_exec] => Lance Wolder
[vendor] => Motif
[production_cost] => 120
[contact_email] => adam.duro@gorillanation.com
[cost_of_revenue] => 10
[created_by] => Adam Duro
[created] => DateTime Object
(
)
[modified] => DateTime Object
(
)
[dates:private] => Array
(
[0] => io_date
[1] => approval_date
[2] => flight_date
[3] => created
[4] => modified
)
)
)
[1] => Array
(
[Prf] => PrfDTO Object
(
[_explicitType] => com.gn.model.dtos.PrfDTO
[id] => 2
[name] => test PRF 2
[io] => 46457777
[production_revenue] => 190
[io_total] => 456
[io_date] => DateTime Object
(
)
[division] => GN
[approval_date] => DateTime Object
(
)
[approved_by] => John Olmeda
[flight_date] => DateTime Object
(
)
[account_exec] => Andrew Fryer
[vendor] => Pointroll
[production_cost] => 670
[contact_email] => john.olmeda@gorillanation.com
[cost_of_revenue] => 40
[created_by] => John Olmeda
[created] => DateTime Object
(
)
[modified] => DateTime Object
(
)
[dates:private] => Array
(
[0] => io_date
[1] => approval_date
[2] => flight_date
[3] => created
[4] => modified
)
)
)
)
When this arrives in Flex, the VO is being properly converted to the typed Flex VO. The only issue is that the fields that have been converted to DateTime objects in PHP, are not being converted to Flex Date objects. They are simply showing up as various Number objects. The VO on the flex side does have those values data typed to Date.
When I send this same array back without converting the objects to VOs, but still convert the date fields to DateTime objects, they convert just fine on the Flex side. This issues only seems to appear when the DateTime objects are being sent over inside typed VO objects.
Comments
No comments to display