protected function _updateToken(array $values, $userId)
    {
        if ($this->tracker->filterChangesOnly($this->_gemsData, $values)) {

            if (\Gems_Tracker::$verbose) {
                $echo = '';
                foreach ($values as $key => $val) {
                    $echo .= $key . ': ' . $this->_gemsData[$key] . ' => ' . $val . "\n";
                }
                \MUtil_Echo::r($echo, 'Updated values for ' . $this->_tokenId);
            }

            if (! isset($values['gto_changed'])) {
                $values['gto_changed'] = new \MUtil_Db_Expr_CurrentTimestamp();
            }
            if (! isset($values['gto_changed_by'])) {
                $values['gto_changed_by'] = $userId;
            }

            // Update values in this object
            $this->_gemsData = $values + (array) $this->_gemsData;

            // return 1;
            return $this->db->update('gems__tokens', $values, array('gto_id_token = ?' => $this->_tokenId));

        } else {
            return 0;
        }
    }
protected function _updateToken(array $values, $userId)
    {
        if ($this->tracker->filterChangesOnly($this->_gemsData, $values)) {

            if (\Gems_Tracker::$verbose) {
                $echo = '';
                foreach ($values as $key => $val) {
                    $echo .= $key . ': ' . $this->_gemsData[$key] . ' => ' . $val . "\n";
                }
                \MUtil_Echo::r($echo, 'Updated values for ' . $this->_tokenId);
            }

            if (! isset($values['gto_changed'])) {
                $values['gto_changed'] = new \MUtil_Db_Expr_CurrentTimestamp();
            }
            if (! isset($values['gto_changed_by'])) {
                $values['gto_changed_by'] = $userId;
            }

            // Update values in this object
            $this->_gemsData = $values + (array) $this->_gemsData;

            // return 1;
            return $this->db->update('gems__tokens', $values, array('gto_id_token = ?' => $this->_tokenId));

        } else {
            return 0;
        }
    }
protected function _updateToken ( array $ values , $ userId ) { if ( $ this -> tracker -> filterChangesOnly ( $ this -> _gemsData , $ values ) ) { if ( \ Gems_Tracker :: $ verbose ) { $ echo = '' ; foreach ( $ values as $ key => $ val ) { $ echo .= $ key . ': ' . $ this -> _gemsData [ $ key ] . ' => ' . $ val . "\n" ; } \ MUtil_Echo :: r ( $ echo , 'Updated values for ' . $ this -> _tokenId ) ; } if ( ! isset ( $ values [ 'gto_changed' ] ) ) { $ values [ 'gto_changed' ] = new \ MUtil_Db_Expr_CurrentTimestamp ( ) ; } if ( ! isset ( $ values [ 'gto_changed_by' ] ) ) { $ values [ 'gto_changed_by' ] = $ userId ; } // Update values in this object $ this -> _gemsData = $ values + ( array ) $ this -> _gemsData ; // return 1; return $ this -> db -> update ( 'gems__tokens' , $ values , array ( 'gto_id_token = ?' => $ this -> _tokenId ) ) ; } else { return 0 ; } }
Update the token, both in the database and in memory.

@param array $values The values that this token should be set to
@param int $userId The current user
@return int 1 if data changed, 0 otherwise
Update the token both in the database and in memory .