protected function _updateTrack(array $values, $userId  = null)
    {
        if (null === $userId) {
            $userId = $this->currentUser->getUserId();
        }
        // \MUtil_Echo::track($values);
        if ($this->tracker->filterChangesOnly($this->_respTrackData, $values)) {
            $where = $this->db->quoteInto('gr2t_id_respondent_track = ?', $this->_respTrackId);

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

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

            $this->_respTrackData = $values + $this->_respTrackData;
            // \MUtil_Echo::track($values);
            // return 1;
            return $this->db->update('gems__respondent2track', $values, $where);

        } else {
            return 0;
        }
    }
protected function _updateTrack(array $values, $userId  = null)
    {
        if (null === $userId) {
            $userId = $this->currentUser->getUserId();
        }
        // \MUtil_Echo::track($values);
        if ($this->tracker->filterChangesOnly($this->_respTrackData, $values)) {
            $where = $this->db->quoteInto('gr2t_id_respondent_track = ?', $this->_respTrackId);

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

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

            $this->_respTrackData = $values + $this->_respTrackData;
            // \MUtil_Echo::track($values);
            // return 1;
            return $this->db->update('gems__respondent2track', $values, $where);

        } else {
            return 0;
        }
    }
protected function _updateTrack ( array $ values , $ userId = null ) { if ( null === $ userId ) { $ userId = $ this -> currentUser -> getUserId ( ) ; } // \MUtil_Echo::track($values); if ( $ this -> tracker -> filterChangesOnly ( $ this -> _respTrackData , $ values ) ) { $ where = $ this -> db -> quoteInto ( 'gr2t_id_respondent_track = ?' , $ this -> _respTrackId ) ; if ( \ Gems_Tracker :: $ verbose ) { $ echo = '' ; foreach ( $ values as $ key => $ val ) { $ echo .= $ key . ': ' . $ this -> _respTrackData [ $ key ] . ' => ' . $ val . "\n" ; } \ MUtil_Echo :: r ( $ echo , 'Updated values for ' . $ this -> _respTrackId ) ; } if ( ! isset ( $ values [ 'gr2t_changed' ] ) ) { $ values [ 'gr2t_changed' ] = new \ MUtil_Db_Expr_CurrentTimestamp ( ) ; } if ( ! isset ( $ values [ 'gr2t_changed_by' ] ) ) { $ values [ 'gr2t_changed_by' ] = $ userId ; } $ this -> _respTrackData = $ values + $ this -> _respTrackData ; // \MUtil_Echo::track($values); // return 1; return $ this -> db -> update ( 'gems__respondent2track' , $ values , $ where ) ; } else { return 0 ; } }
Save the values if any have been changed

@param array $values
@param int $userId
@return int
Save the values if any have been changed