We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5edebe7 commit f70dc82Copy full SHA for f70dc82
Templates/PHP/Model/EntityType.php.tt
@@ -256,12 +256,19 @@ if (property.Type.GetTypeString()[0] == '\\') { #>
256
257
/**
258
* Serializes the object by property array
259
+ * Manually serialize DateTime into RFC3339 format
260
*
261
* @return array The list of properties
262
*/
263
public function jsonSerialize()
264
{
- return $this->getProperties();
265
+ $serializableProperties = $this->getProperties();
266
+ foreach ($serializableProperties as $property => $val) {
267
+ if (is_a($val, "\DateTime")) {
268
+ $serializableProperties[$property] = $val->format(\DateTime::RFC3339);
269
+ }
270
271
+ return $serializableProperties;
272
}
273
<#
274
0 commit comments