Welcome Guest, Not a member yet? Register   Sign In
Invalid serialization data for DateTime object
#1

(This post was last modified: 08-26-2020, 03:07 AM by AngelRodriguez. Edit Reason: Add more info )

Hi,

I create an entity and cache it. When I try to get from cache it gives me error: "Invalid serialization data for DateTime object".

This is example code:

Code:
$web = new \App\Entities\Web();
$web->created_at = date('Y-m-d H:i:s');
$cache->save('webname', $web, 300);

$web = $cache->get('webname');
if ($web) {
    echo 'cached';
    printr($web);
}

Where is the problem? How can fix this?

Thank you,

Angel
Reply


Messages In This Thread
Invalid serialization data for DateTime object - by AngelRodriguez - 08-26-2020, 03:04 AM



Theme © iAndrew 2016 - Forum software by © MyBB