private function _update(array $values, $userId)
    {
        if ($this->tracker->filterChangesOnly($this->_trackData, $values)) {

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

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

            // Update values in this object
            $this->_trackData = $values + $this->_trackData;

            // return 1;
            return $this->db->update('gems__tracks', $values, array('gtr_id_track = ?' => $this->_trackId));

        } else {
            return 0;
        }
    }
private function _update(array $values, $userId)
    {
        if ($this->tracker->filterChangesOnly($this->_trackData, $values)) {

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

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

            // Update values in this object
            $this->_trackData = $values + $this->_trackData;

            // return 1;
            return $this->db->update('gems__tracks', $values, array('gtr_id_track = ?' => $this->_trackId));

        } else {
            return 0;
        }
    }
private function _update ( array $ values , $ userId ) { if ( $ this -> tracker -> filterChangesOnly ( $ this -> _trackData , $ values ) ) { if ( \ Gems_Tracker :: $ verbose ) { $ echo = '' ; foreach ( $ values as $ key => $ val ) { $ echo .= $ key . ': ' . $ this -> _trackData [ $ key ] . ' => ' . $ val . "\n" ; } \ MUtil_Echo :: r ( $ echo , 'Updated values for ' . $ this -> _trackId ) ; } if ( ! isset ( $ values [ 'gto_changed' ] ) ) { $ values [ 'gtr_changed' ] = new \ MUtil_Db_Expr_CurrentTimestamp ( ) ; } if ( ! isset ( $ values [ 'gtr_changed_by' ] ) ) { $ values [ 'gtr_changed_by' ] = $ userId ; } // Update values in this object $ this -> _trackData = $ values + $ this -> _trackData ; // return 1; return $ this -> db -> update ( 'gems__tracks' , $ values , array ( 'gtr_id_track = ?' => $ this -> _trackId ) ) ; } else { return 0 ; } }
Update the track, 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 track both in the database and in memory .