CodeIgniter Forums
Cast datetime from JSON string? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Feature Requests (https://forum.codeigniter.com/forumdisplay.php?fid=29)
+--- Thread: Cast datetime from JSON string? (/showthread.php?tid=88938)

Pages: 1 2


RE: Cast datetime from JSON string? - ozornick - 12-06-2023

I can't tell you about it. I like the entity as a class, but looking at the issues it leads to horror.
It is so problematic that it is worth completely reviewing it.

But for now, I'm using it as it is...


RE: Cast datetime from JSON string? - kenjis - 12-06-2023

Don't worry. Entity works well most of cases. So it is unlikely to cause any real problems.

However, the internal implementation is a bit difficult to understand because there are too many functions,
and it holds only raw data (data from database) but if you use datetime, it holds Time objects.
Also it is not possible to specify the property types by PHP because Entity does not have real class properties.


RE: Cast datetime from JSON string? - ozornick - 12-06-2023

We were discussing that here on the forum, I asked for fill() after the builder() response. I installed get/set on my own and worked fine with the real properties of the class.


RE: Cast datetime from JSON string? - kenjis - 12-06-2023

I created issues:
https://github.com/codeigniter4/CodeIgniter4/issues/8302
https://github.com/codeigniter4/CodeIgniter4/issues/8303


RE: Cast datetime from JSON string? - ozornick - 12-06-2023

Thanks.