Hi all,
I have a model named cache and save some serialized data to the field ‘result_object’. In the model i set ‘result_object’ as a serialized typed column
protected static $_typed_columns = array(
'result_object' => 'serialized'
);
Saving an array result in a serialized string. But getting the data wont unserialize the data.
echo ee('Model')->get('gmaps:Cache')->first()->result_object;
Above code just print a serialized string, instead of an object/array of the data.
Do i miss something, or is this incorrect/correct?
EE version 3.5.4
Hi Kevin,
No luck, same result, just a serialized string.
The model is simple, so i have no idea what it could be…
namespace Gmaps\Model;
use EllisLab\ExpressionEngine\Service\Model\Model;
class Cache extends Model {
protected static $_primary_key = 'cache_id';
protected static $_table_name = 'gmaps_cache';
protected $cache_id;
protected $address;
protected $lat;
protected $lng;
protected $date;
protected $search_key;
protected $geocoder;
protected $type;
protected $result_object;
protected static $_typed_columns = array(
'result_object' => 'serialized'
);
}
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.