Root/
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | <?php namespace application\models; class Sessions extends \system\engine\HF_Model { public $sessionid ; public $ip ; public $userAgent ; public $data ; public function setData( $key , $val ) { $raw = json_decode( $this ->data, true); $raw [ $key ] = $val ; $this ->data = json_encode( $raw ); } public function getData( $key ) { $raw = json_decode( $this ->data, true); if (isset( $raw [ $key ])) { return $raw [ $key ]; } else { return null; } } } |