$item to array didn't make things better.
Array ( [menu_id] => 26 [comp_id] => 20002 [name] => Appetizers [image] => 20210905162616247.jpg [edited_by] => 0 [created_at] => CodeIgniter\I18n\Time Object ( [timezone:protected] => DateTimeZone Object ( [timezone_type] => 3 [timezone] => xx/xx) [locale:protected] => en-ae [toStringFormat:protected] => yyyy-MM-dd HH:mm
s [date] => 2021-09-05 16:25:34.000000 [timezone_type] => 3 [timezone] => xx/xx) [updated_at] => CodeIgniter\I18n\Time Object ( [timezone:protected] => DateTimeZone Object ( [timezone_type] => 3 [timezone] => xx/xx) [locale:protected] => en-ae [toStringFormat:protected] => yyyy-MM-dd HH:mm
s [date] => 2021-09-05 16:26:17.000000 [timezone_type] => 3 [timezone] => xx/xx ) )
Thank you guys for the recommendations but I want to do this is the new CI4 way with entities. Hope I get a CI4 way to solve this.