public function write($id, $data)
    {
        if (!$id) {
            return false;
        }
        $expires = time() + $this->_timeout;
        $record = compact('data', 'expires');
        $record[$this->_table->getPrimaryKey()] = $id;
        $result = $this->_table->save(new Entity($record));

        return (bool)$result;
    }
public function write($id, $data)
    {
        if (!$id) {
            return false;
        }
        $expires = time() + $this->_timeout;
        $record = compact('data', 'expires');
        $record[$this->_table->getPrimaryKey()] = $id;
        $result = $this->_table->save(new Entity($record));

        return (bool)$result;
    }
public function write ( $ id , $ data ) { if ( ! $ id ) { return false ; } $ expires = time ( ) + $ this -> _timeout ; $ record = compact ( 'data' , 'expires' ) ; $ record [ $ this -> _table -> getPrimaryKey ( ) ] = $ id ; $ result = $ this -> _table -> save ( new Entity ( $ record ) ) ; return ( bool ) $ result ; }
Helper function called on write for database sessions.

@param string|int $id ID that uniquely identifies session in database.
@param mixed $data The data to be saved.
@return bool True for successful write, false otherwise.
Helper function called on write for database sessions .